Make WordPress Core


Ignore:
Timestamp:
02/25/2014 10:04:46 AM (10 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/includes/screen.php.

Props enej, kpdesign.
Fixes #26821.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/screen.php

    r26518 r27256  
    2121    static $column_headers = array();
    2222
    23     if ( ! isset( $column_headers[ $screen->id ] ) )
     23    if ( ! isset( $column_headers[ $screen->id ] ) ) {
     24
     25        /**
     26         * Filter the column headers for a list table on a specific screen.
     27         *
     28         * The dynamic portion of the hook name, $screen->id, refers to the
     29         * ID of a specific screen. For example, the screen ID for the Posts
     30         * list table is edit-post, so the filter for that screen would be
     31         * manage_edit-post_columns.
     32         *
     33         * @since 3.0.0
     34         *
     35         * @param array $columns An array of column headers. Default empty.
     36         */
    2437        $column_headers[ $screen->id ] = apply_filters( 'manage_' . $screen->id . '_columns', array() );
     38    }
    2539
    2640    return $column_headers[ $screen->id ];
     
    102116                $hidden = array( 'slugdiv' );
    103117        }
     118
     119        /**
     120         * Filter the default list of hidden meta boxes.
     121         *
     122         * @since 3.1.0
     123         *
     124         * @param array     $hidden An array of meta boxes hidden by default.
     125         * @param WP_Screen $screen WP_Screen object of the current screen.
     126         */
    104127        $hidden = apply_filters( 'default_hidden_meta_boxes', $hidden, $screen );
    105128    }
    106129
     130    /**
     131     * Filter the list of hidden meta boxes.
     132     *
     133     * @since 3.3.0
     134     *
     135     * @param array     $hidden       An array of hidden meta boxes.
     136     * @param WP_Screen $screen       WP_Screen object of the current screen.
     137     * @param bool      $use_defaults Whether to show the default meta boxes.
     138     *                                Default true.
     139     */
    107140    return apply_filters( 'hidden_meta_boxes', $hidden, $screen, $use_defaults );
    108141}
     
    503536        $taxnow = $this->taxonomy;
    504537        $typenow = $this->post_type;
     538
     539        /**
     540         * Fires after the current screen has been set.
     541         *
     542         * @since 3.0.0
     543         *
     544         * @param WP_Screen $current_screen Current WP_Screen object.
     545         */
    505546        do_action( 'current_screen', $current_screen );
    506547    }
     
    748789    public function render_screen_meta() {
    749790
    750         // Call old contextual_help_list filter.
     791        /**
     792         * Filter the legacy contextual help list.
     793         *
     794         * @since 2.7.0
     795         * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
     796         *                   get_current_screen()->remove_help_tab() instead.
     797         *
     798         * @param array     $old_compat_help Old contextual help.
     799         * @param WP_Screen $this            Current WP_Screen instance.
     800         */
    751801        self::$_old_compat_help = apply_filters( 'contextual_help_list', self::$_old_compat_help, $this );
    752802
    753803        $old_help = isset( self::$_old_compat_help[ $this->id ] ) ? self::$_old_compat_help[ $this->id ] : '';
     804
     805        /**
     806         * Filter the legacy contextual help text.
     807         *
     808         * @since 2.7.0
     809         * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
     810         *                   get_current_screen()->remove_help_tab() instead.
     811         *
     812         * @param string    $old_help  Help text that appears on the screen.
     813         * @param string    $screen_id Screen ID.
     814         * @param WP_Screen $this      Current WP_Screen instance.
     815         *
     816         */
    754817        $old_help = apply_filters( 'contextual_help', $old_help, $this->id, $this );
    755818
    756819        // Default help only if there is no old-style block of text and no new-style help tabs.
    757820        if ( empty( $old_help ) && ! $this->get_help_tabs() ) {
     821
     822            /**
     823             * Filter the default legacy contextual help text.
     824             *
     825             * @since 2.8.0
     826             * @deprecated 3.3.0 Use get_current_screen()->add_help_tab() or
     827             *                   get_current_screen()->remove_help_tab() instead.
     828             *
     829             * @param string $old_help_default Default contextual help text.
     830             */
    758831            $default_help = apply_filters( 'default_contextual_help', '' );
    759832            if ( $default_help )
     
    836909        // Setup layout columns
    837910
    838         // Back compat for plugins using the filter instead of add_screen_option()
     911        /**
     912         * Filter the array of screen layout columns.
     913         *
     914         * This hook provides back-compat for plugins using the back-compat
     915         * filter instead of add_screen_option().
     916         *
     917         * @since 2.8.0
     918         *
     919         * @param array     $empty_columns Empty array.
     920         * @param string    $screen_id     Screen ID.
     921         * @param WP_Screen $this          Current WP_Screen instance.
     922         */
    839923        $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this );
    840924
     
    893977        }
    894978
     979        /**
     980         * Filter the screen settings text displayed in the Screen Options tab.
     981         *
     982         * This filter is currently only used on the Widgets screen to enable
     983         * accessibility mode.
     984         *
     985         * @since 3.0.0
     986         *
     987         * @param string    $screen_settings Screen settings.
     988         * @param WP_Screen $this            WP_Screen object.
     989         */
    895990        $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
    896991
     
    898993            $show_screen = true;
    899994
     995        /**
     996         * Filter whether to show the Screen Options tab.
     997         *
     998         * @since 3.2.0
     999         *
     1000         * @param bool      $show_screen Whether to show Screen Options tab.
     1001         *                               Default true.
     1002         * @param WP_Screen $this        Current WP_Screen instance.
     1003         */
    9001004        $this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
    9011005        return $this->_show_screen_options;
     
    10351139        if ( 'edit_comments_per_page' == $option ) {
    10361140            $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
     1141
     1142            /** This filter is documented in wp-admin/includes/class-wp-comments-list-table.php */
    10371143            $per_page = apply_filters( 'comments_per_page', $per_page, $comment_status );
    10381144        } elseif ( 'categories_per_page' == $option ) {
     1145            /** This filter is documented in wp-admin/includes/class-wp-terms-list-table.php */
    10391146            $per_page = apply_filters( 'edit_categories_per_page', $per_page );
    10401147        } else {
     1148            /** This filter is documented in wp-admin/includes/class-wp-list-table.php */
    10411149            $per_page = apply_filters( $option, $per_page );
    10421150        }
    10431151
    10441152        // Back compat
    1045         if ( isset( $this->post_type ) )
     1153        if ( isset( $this->post_type ) ) {
     1154            /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */
    10461155            $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type );
     1156        }
    10471157
    10481158        ?>
Note: See TracChangeset for help on using the changeset viewer.