mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-18 22:13:20 +09:00
add class for cpt featured image setting
This commit is contained in:
@@ -16,9 +16,10 @@
|
||||
*/
|
||||
class Display_Featured_Image_Genesis {
|
||||
|
||||
function __construct( $admin, $common, $description, $output, $rss, $settings, $taxonomies ) {
|
||||
function __construct( $admin, $common, $cpt, $description, $output, $rss, $settings, $taxonomies ) {
|
||||
$this->admin = $admin;
|
||||
$this->common = $common;
|
||||
$this->cpt = $cpt;
|
||||
$this->archive = $description;
|
||||
$this->output = $output;
|
||||
$this->rss = $rss;
|
||||
@@ -40,6 +41,7 @@ class Display_Featured_Image_Genesis {
|
||||
add_action( 'admin_init', array( $this->admin, 'set_up_post_type_columns' ) );
|
||||
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
|
||||
add_action( 'admin_menu', array( $this->settings, 'do_submenu_page' ) );
|
||||
add_action( 'admin_menu', array( $this->cpt, 'set_up_cpts' ) );
|
||||
add_action( 'get_header', array( $this->output, 'manage_output' ) );
|
||||
add_action( 'template_redirect', array( $this->rss, 'maybe_do_feed' ) );
|
||||
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
||||
@@ -162,13 +164,13 @@ class Display_Featured_Image_Genesis {
|
||||
|
||||
wp_register_script( 'displayfeaturedimage-upload', plugins_url( '/includes/js/settings-upload.js', dirname( __FILE__ ) ), array( 'jquery', 'media-upload', 'thickbox' ), $version );
|
||||
|
||||
if ( 'appearance_page_displayfeaturedimagegenesis' === get_current_screen()->id || ! empty( get_current_screen()->taxonomy ) ) {
|
||||
// if ( 'appearance_page_displayfeaturedimagegenesis' === get_current_screen()->id || ! empty( get_current_screen()->taxonomy ) ) {
|
||||
wp_enqueue_media();
|
||||
wp_enqueue_script( 'displayfeaturedimage-upload' );
|
||||
wp_localize_script( 'displayfeaturedimage-upload', 'objectL10n', array(
|
||||
'text' => __( 'Choose Image', 'display-featured-image-genesis' ),
|
||||
) );
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user