/** * Whether the current request is in post type pages * * @param mixed $post_types * @return bool True if inside post type pages */ function theme_is_post_type($post_types = '') { if (theme_is_post_type_list($post_types) || theme_is_post_type_new($post_types) || theme_is_post_type_edit($post_types) || theme_is_post_type_post($post_types) || theme_is_post_type_taxonomy($post_types)) { return true; } else { return false; } }
function add_script() { if (theme_is_post_type_new($this->config['pages']) || theme_is_post_type_post($this->config['pages'])) { wp_enqueue_script('shortcode', THEME_ADMIN_ASSETS_URI . '/js/shortcode.js', array('jquery')); } }