Making WordPress.org


Ignore:
Timestamp:
03/04/2021 10:46:49 PM (4 years ago)
Author:
coffee2code
Message:

Handbooks, Handbook: Add missing function docblocks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/handbook.php

    r10751 r10752  
    88class WPorg_Handbook {
    99
     10    /**
     11     * The handbook post type.
     12     *
     13     * @var string
     14     */
    1015    public $post_type = '';
     16
     17    /**
     18     * The name of the setting for the handbook's name.
     19     *
     20     * @var string
     21     */
    1122    public $setting_name = '';
    1223
     24    /**
     25     * The memoized and filtered label text for the handbook.
     26     *
     27     * @var string
     28     */
    1329    protected $label = '';
    1430
     31    /**
     32     * Returns the custom handbook-related capabilities granted to site users.
     33     *
     34     * @return array
     35     */
    1536    public static function caps() {
    1637        return [
     
    2142    }
    2243
     44    /**
     45     * Returns the custom capabilities granted to handbook editors.
     46     *
     47     * @return array
     48     */
    2349    public static function editor_caps() {
    2450        return [
     
    6591    }
    6692
     93    /**
     94     * Constructor
     95     */
    6796    public function __construct( $type ) {
    6897        if ( 'handbook' !== $type ) {
     
    154183    }
    155184
     185    /**
     186     * Adds the setting for the handbook's name.
     187     */
    156188    public function add_name_setting() {
    157189        register_setting( 'general', $this->setting_name, 'esc_attr' );
     
    169201    }
    170202
     203    /**
     204     * Outputs the HTML for the input field for the handbook's name.
     205     */
    171206    public function name_setting_html() {
    172207        $value = get_option( $this->setting_name, '' );
     
    174209    }
    175210
     211    /**
     212     * Grants handbook caps to the current user.
     213     *
     214     * @return array
     215     */
    176216    public function grant_handbook_caps( $caps ) {
    177217        if ( ! is_user_member_of_blog() ) {
     
    192232    }
    193233
     234    /**
     235     * Registers handbook post types.
     236     */
    194237    public function register_post_type() {
    195238        if ( 'handbook' != $this->post_type ) {
     
    345388    }
    346389
     390    /**
     391     * Performs query object adjustments for handbook requests prior to querying
     392     * for posts.
     393     */
    347394    public function pre_get_posts( $query ) {
    348395        // Bail early if query is not for this handbook's post type.
     
    384431    }
    385432
     433    /**
     434     * Registers sidebar and widgets for handbook pages.
     435     */
    386436    public function handbook_sidebar() {
    387437        $sidebar_args = [
     
    403453    }
    404454
     455    /**
     456     * Amends list of post types for which users can opt into receiving emails
     457     * about changes.
     458     *
     459     * @param array $post_types Post types.
     460     * @return array
     461     */
    405462    public function wporg_email_changes_for_post_types( $post_types ) {
    406463        if ( ! in_array( $this->post_type, $post_types ) ) {
Note: See TracChangeset for help on using the changeset viewer.