Making WordPress.org

Changeset 4341


Ignore:
Timestamp:
11/08/2016 07:15:01 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Add handbook for REST API.

Fixes #2201.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/handbooks.php

    r4338 r4341  
    1717         * @access public
    1818         */
    19         public static $post_types = array( 'plugin', 'theme' );
     19        public static $post_types = array( 'plugin', 'rest-api', 'theme' );
    2020
    2121        /**
    … …  
    2727                add_filter( 'handbook_post_type_defaults', array( __CLASS__, 'filter_handbook_post_type_defaults' ), 10, 2 );
    2828                add_filter( 'handbook_post_types', array( __CLASS__, 'filter_handbook_post_types' ) );
     29                add_filter( 'handbook_label', array( __CLASS__, 'filter_handbook_label' ), 10, 2 );
    2930                add_action( 'init', array( __CLASS__, 'do_init' ) );
    3031        }
    … …  
    182183
    183184        /**
     185         * Overrides the default handbook label used as the base for various handbook
     186         * post type related strings.
     187         *
     188         * @param string $label     The default label, which is merely a santized
     189         *                          version of the handbook name.
     190         * @param string $post_type The handbook post type.
     191         * @return string
     192         */
     193        public static function filter_handbook_label( $label, $post_type ) {
     194                if ( 'rest-api-handbook' === $post_type ) {
     195                        $label = 'REST API Handbook';
     196                }
     197
     198                return $label;
     199        }
     200
     201        /**
    184202         * For specific credit pages, link @usernames references to their profiles on
    185203         * profiles.wordpress.org.
Note: See TracChangeset for help on using the changeset viewer.