Make WordPress Core

Changeset 48098


Ignore:
Timestamp:
06/19/2020 10:24:14 PM (3 years ago)
Author:
johnbillion
Message:

Docs: Corrections and improvements to inline docs related to XML sitemaps.

See #50117, #49572

Location:
trunk/src/wp-includes
Files:
10 edited

Legend:

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

    r48094 r48098  
    5050         * @since 5.5.0
    5151         *
    52          * @param WP_Sitemaps $sitemaps Server object.
     52         * @param WP_Sitemaps $wp_sitemaps Sitemaps object.
    5353         */
    5454        do_action( 'wp_sitemaps_init', $wp_sitemaps );
     
    5959
    6060/**
    61  * Gets a list of sitemap providers.
     61 * Gets an array of sitemap providers.
    6262 *
    6363 * @since 5.5.0
    6464 *
    65  * @return array $sitemaps A list of registered sitemap providers.
     65 * @return WP_Sitemaps_Provider[] Array of sitemap providers.
    6666 */
    6767function wp_get_sitemaps() {
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-index.php

    r48093 r48098  
    4141     * @since 5.5.0
    4242     *
    43      * @return array List of all sitemaps.
     43     * @return array[] Array of all sitemaps.
    4444     */
    4545    public function get_sitemap_list() {
     
    7070     * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    7171     *
    72      * @return string The sitemap index url.
     72     * @return string The sitemap index URL.
    7373     */
    7474    public function get_index_url() {
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-provider.php

    r48093 r48098  
    6262     * @since 5.5.0
    6363     *
    64      * @return array List of sitemap types including object subtype name and number of pages.
     64     * @return array[] Array of sitemap types including object subtype name and number of pages.
    6565     */
    6666    public function get_sitemap_type_data() {
     
    9999     * @since 5.5.0
    100100     *
    101      * @return array List of sitemaps.
     101     * @return array[] Array of sitemap entries.
    102102     */
    103103    public function get_sitemap_entries() {
     
    121121                 * @param string $object_subtype Object subtype name.
    122122                 *                               Empty string if the object type does not support subtypes.
    123                  * @param string $page           Page of results.
     123                 * @param int    $page           Page number of results.
    124124                 */
    125125                $sitemap_entry = apply_filters( 'wp_sitemaps_index_entry', $sitemap_entry, $this->object_type, $type['name'], $page );
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-registry.php

    r48072 r48098  
    2121     * @since 5.5.0
    2222     *
    23      * @var array Array of registered sitemaps.
     23     * @var WP_Sitemaps_Provider[] Array of registered sitemaps.
    2424     */
    2525    private $sitemaps = array();
     
    7474     * @since 5.5.0
    7575     *
    76      * @return array List of sitemaps.
     76     * @return WP_Sitemaps_Provider[] Array of sitemap providers.
    7777     */
    7878    public function get_sitemaps() {
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php

    r48093 r48098  
    6060     * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    6161     *
    62      * @return string The sitemap stylesheet url.
     62     * @return string The sitemap stylesheet URL.
    6363     */
    6464    public function get_sitemap_stylesheet_url() {
     
    7474         * Filters the URL for the sitemap stylesheet.
    7575         *
    76          * If a falsy value is returned, no stylesheet will be used and
     76         * If a falsey value is returned, no stylesheet will be used and
    7777         * the "raw" XML of the sitemap will be displayed.
    7878         *
    7979         * @since 5.5.0
    8080         *
    81          * @param string $sitemap_url Full URL for the sitemaps xsl file.
     81         * @param string $sitemap_url Full URL for the sitemaps XSL file.
    8282         */
    8383        return apply_filters( 'wp_sitemaps_stylesheet_url', $sitemap_url );
     
    9191     * @global WP_Rewrite $wp_rewrite WordPress rewrite component.
    9292     *
    93      * @return string The sitemap index stylesheet url.
     93     * @return string The sitemap index stylesheet URL.
    9494     */
    9595    public function get_sitemap_index_stylesheet_url() {
     
    105105         * Filters the URL for the sitemap index stylesheet.
    106106         *
    107          * If a falsy value is returned, no stylesheet will be used and
     107         * If a falsey value is returned, no stylesheet will be used and
    108108         * the "raw" XML of the sitemap index will be displayed.
    109109         *
    110110         * @since 5.5.0
    111111         *
    112          * @param string $sitemap_url Full URL for the sitemaps index xsl file.
     112         * @param string $sitemap_url Full URL for the sitemaps index XSL file.
    113113         */
    114114        return apply_filters( 'wp_sitemaps_stylesheet_index_url', $sitemap_url );
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php

    r48081 r48098  
    1717class WP_Sitemaps_Stylesheet {
    1818    /**
    19      * Renders the xsl stylesheet depending on whether its the sitemap index or not.
     19     * Renders the XSL stylesheet depending on whether it's the sitemap index or not.
    2020     *
    2121     * @param string $type Stylesheet type. Either 'sitemap' or 'index'.
     
    3838
    3939    /**
    40      * Returns the escaped xsl for all sitemaps, except index.
     40     * Returns the escaped XSL for all sitemaps, except index.
    4141     *
    4242     * @since 5.5.0
     
    142142         * @since 5.5.0
    143143         *
    144          * @param string $xsl Full content for the xml stylesheet.
     144         * @param string $xsl_content Full content for the XML stylesheet.
    145145         */
    146146        return apply_filters( 'wp_sitemaps_stylesheet_content', $xsl_content );
     
    148148
    149149    /**
    150      * Returns the escaped xsl for the index sitemaps.
     150     * Returns the escaped XSL for the index sitemaps.
    151151     *
    152152     * @since 5.5.0
     
    236236         * @since 5.5.0
    237237         *
    238          * @param string $xsl Full content for the xml stylesheet.
     238         * @param string $xsl_content Full content for the XML stylesheet.
    239239         */
    240240        return apply_filters( 'wp_sitemaps_stylesheet_index_content', $xsl_content );
     
    278278
    279279        /**
    280          * Filters the css only for the sitemap stylesheet.
     280         * Filters the CSS only for the sitemap stylesheet.
    281281         *
    282282         * @since 5.5.0
    283283         *
    284          * @param string $css CSS to be applied to default xsl file.
     284         * @param string $css CSS to be applied to default XSL file.
    285285         */
    286286        return apply_filters( 'wp_sitemaps_stylesheet_css', $css );
  • trunk/src/wp-includes/sitemaps/class-wp-sitemaps.php

    r48093 r48098  
    8484         *     Array of WP_Sitemaps_Provider objects keyed by their name.
    8585         *
    86          *     @type object $posts      The WP_Sitemaps_Posts object.
    87          *     @type object $taxonomies The WP_Sitemaps_Taxonomies object.
    88          *     @type object $users      The WP_Sitemaps_Users object.
     86         *     @type WP_Sitemaps_Posts      $posts      The WP_Sitemaps_Posts object.
     87         *     @type WP_Sitemaps_Taxonomies $taxonomies The WP_Sitemaps_Taxonomies object.
     88         *     @type WP_Sitemaps_Users      $users      The WP_Sitemaps_Users object.
    8989         * }
    9090         */
  • trunk/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php

    r48072 r48098  
    3232     * @since 5.5.0
    3333     *
    34      * @return array Map of registered post type objects (WP_Post_Type) keyed by their name.
     34     * @return WP_Post_Type[] Array of registered post type objects keyed by their name.
    3535     */
    3636    public function get_object_subtypes() {
     
    4343         * @since 5.5.0
    4444         *
    45          * @param array $post_types Map of registered post type objects (WP_Post_Type) keyed by their name.
     45         * @param WP_Post_Type[] $post_types Array of registered post type objects keyed by their name.
    4646         */
    4747        return apply_filters( 'wp_sitemaps_post_types', $post_types );
     
    5555     * @param int    $page_num  Page of results.
    5656     * @param string $post_type Optional. Post type name. Default empty.
    57      * @return array $url_list Array of URLs for a sitemap.
     57     * @return array Array of URLs for a sitemap.
    5858     */
    5959    public function get_url_list( $page_num, $post_type = '' ) {
     
    160160         * Filters the max number of pages before it is generated.
    161161         *
    162          * Passing a non-null value will effectively short-circuit the generation,
     162         * Passing a non-null value will short-circuit the generation,
    163163         * returning that value instead.
    164164         *
    165165         * @since 5.5.0
    166166         *
    167          * @param int $max_num_pages The maximum number of pages. Default null.
    168          * @param string $post_type Post type name.
     167         * @param null|int $max_num_pages The maximum number of pages. Default null.
     168         * @param string   $post_type    Post type name.
    169169         */
    170170        $max_num_pages = apply_filters( 'wp_sitemaps_posts_pre_max_num_pages', null, $post_type );
     
    189189     *
    190190     * @param string $post_type Post type name.
    191      * @return array $args Array of WP_Query arguments.
     191     * @return array Array of WP_Query arguments.
    192192     */
    193193    protected function get_posts_query_args( $post_type ) {
  • trunk/src/wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php

    r48072 r48098  
    3131     * @since 5.5.0
    3232     *
    33      * @return array Map of registered taxonomy objects keyed by their name.
     33     * @return WP_Taxonomy[] Array of registered taxonomy objects keyed by their name.
    3434     */
    3535    public function get_object_subtypes() {
     
    4141         * @since 5.5.0
    4242         *
    43          * @param array $taxonomies Map of registered taxonomy objects keyed by their name.
     43         * @param WP_Taxonomy[] $taxonomies Array of registered taxonomy objects keyed by their name.
    4444         */
    4545        return apply_filters( 'wp_sitemaps_taxonomies', $taxonomies );
     
    5353     * @param int    $page_num Page of results.
    5454     * @param string $taxonomy Optional. Taxonomy name. Default empty.
    55      * @return array $url_list Array of URLs for a sitemap.
     55     * @return array Array of URLs for a sitemap.
    5656     */
    5757    public function get_url_list( $page_num, $taxonomy = '' ) {
     
    135135         * Filters the max number of pages before it is generated.
    136136         *
    137          * Passing a non-null value will effectively short-circuit the generation,
     137         * Passing a non-null value will short-circuit the generation,
    138138         * returning that value instead.
    139139         *
    140140         * @since 5.5.0
    141141         *
    142          * @param int $max_num_pages The maximum number of pages. Default null.
    143          * @param string $taxonomy Taxonomy name.
     142         * @param int    $max_num_pages The maximum number of pages. Default null.
     143         * @param string $taxonomy      Taxonomy name.
    144144         */
    145145        $max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );
     
    160160     *
    161161     * @param string $taxonomy Taxonomy name.
    162      * @return array $args Array of WP_Term_Query arguments.
     162     * @return array Array of WP_Term_Query arguments.
    163163     */
    164164    protected function get_taxonomies_query_args( $taxonomy ) {
  • trunk/src/wp-includes/sitemaps/providers/class-wp-sitemaps-users.php

    r48072 r48098  
    3535     *                               required for compatibility with the parent
    3636     *                               provider class. Default empty.
    37      * @return array $url_list Array of URLs for a sitemap.
     37     * @return array Array of URLs for a sitemap.
    3838     */
    3939    public function get_url_list( $page_num, $object_subtype = '' ) {
Note: See TracChangeset for help on using the changeset viewer.