Making WordPress.org


Ignore:
Timestamp:
04/25/2019 09:34:14 PM (8 years ago)
Author:
coffee2code
Message:

Developer: Convert WP REST API handbook importer to inherit from DevHub_Docs_Importer.

File:
1 edited

Legend:

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

    r8684 r8688  
    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 );
    3029                add_action( 'init', array( __CLASS__, 'do_init' ) );
    3130        }
    … …  
    9897        public static function filter_handbook_post_types( $types ) {
    9998                if ( ! self::$post_types ) {
    100                         self::$post_types = apply_filters( 'devhub_handbook_post_types', [ 'plugin', 'rest-api', 'theme' ] );
     99                        self::$post_types = apply_filters( 'devhub_handbook_post_types', [ 'plugin', 'theme' ] );
    101100                }
    102101
    … …  
    188187
    189188        /**
    190          * Overrides the default handbook label used as the base for various handbook
    191          * post type related strings.
    192          *
    193          * @param string $label     The default label, which is merely a santized
    194          *                          version of the handbook name.
    195          * @param string $post_type The handbook post type.
    196          * @return string
    197          */
    198         public static function filter_handbook_label( $label, $post_type ) {
    199                 if ( 'rest-api-handbook' === $post_type ) {
    200                         $label = __( 'REST API Handbook', 'wporg' );
    201                 }
    202 
    203                 return $label;
    204         }
    205 
    206         /**
    207189         * For specific credit pages, link @usernames references to their profiles on
    208190         * profiles.wordpress.org.
Note: See TracChangeset for help on using the changeset viewer.