Making WordPress.org

Changeset 3239


Ignore:
Timestamp:
05/24/2016 09:12:54 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Remove Devhub_Handbooks::is_handbook_post_type() in favor of Handbook plugin's wporg_is_handbook_post_type().

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc
Files:
2 edited

Legend:

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

    r2817 r3239  
    5252                        add_filter( 'syntaxhighlighter_htmlresult', array( __CLASS__, 'syntaxhighlighter_htmlresult' ) );
    5353                }
    54         }
    55 
    56         /**
    57          * Is the current (or specified) post_type one of the DevHub handbook post types?
    58          *
    59          * TOOD: The handbook plugin should probably have this.
    60          *
    61          * @param string $post_type Optional. The post_type to check for being a handbook post type. Default '' (the current post type).
    62          * @return bool
    63          */
    64         public static function is_handbook_post_type( $post_type = '' ) {
    65                 if ( ! $post_type ) {
    66                         $post_type = get_post_type();
    67                 }
    68 
    69                 return in_array( str_replace( '-handbook', '', $post_type ), self::$post_types );
    7054        }
    7155
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php

    r1689 r3239  
    6363        public static function scripts_and_styles() {
    6464                if ( is_singular() ) {
    65                         if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || Devhub_Handbooks::is_handbook_post_type() ) {
     65                        if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || wporg_is_handbook_post_type() ) {
    6666                                wp_enqueue_script( 'wporg-developer-function-reference', get_template_directory_uri() . '/js/function-reference.js', array( 'jquery', 'syntaxhighlighter-core', 'syntaxhighlighter-brush-php' ), '20150319', true );
    6767                                wp_enqueue_style( 'syntaxhighlighter-core' );
Note: See TracChangeset for help on using the changeset viewer.