Making WordPress.org


Ignore:
Timestamp:
12/23/2014 07:43:48 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Add get_parsed_post_types() and is_parsed_post_type() and use them rather than explicitly defining the post types all over the place

File:
1 edited

Legend:

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

    r1057 r1063  
    3434     */
    3535    public function __construct() {
    36         $this->post_types = array( 'wp-parser-function', 'wp-parser-class', 'wp-parser-hook', 'wp-parser-method' );
     36        $this->post_types = DevHub\get_parsed_post_types();
    3737
    3838        // Setup.
     
    239239    public function admin_enqueue_scripts() {
    240240
    241         if ( in_array( get_current_screen()->id, array(
    242                 'wp-parser-function', 'wp-parser-class', 'wp-parser-hook', 'wp-parser-method',
    243                 'wporg_explanations', 'edit-wporg_explanations',
     241        if ( in_array( get_current_screen()->id, array_merge(
     242                DevHub\get_parsed_post_types(),
     243                array( 'wporg_explanations', 'edit-wporg_explanations' )
    244244        ) ) ) {
    245245            wp_enqueue_style( 'wporg-admin', get_template_directory_uri() . '/stylesheets/admin.css', array(), '20141218' );
Note: See TracChangeset for help on using the changeset viewer.