__( 'Featured images are not available for this page while using the current page template.', 'bgbn' ), 'pageNow' => esc_js( $pagenow ), ) ); } endif; add_action( 'admin_enqueue_scripts', 'bgbn_edit_page_script' ); /** * Add a bgbn Plus metabox to each qualified post type edit screen * * @since 1.0.6. * * @return void */ function bgbn_add_plus_metabox() { if ( bgbn_is_plus() || ! is_super_admin() ) { return; } // Post types $post_types = get_post_types( array( 'public' => true, '_builtin' => false ) ); $post_types[] = 'post'; $post_types[] = 'page'; // Add the metabox for each type foreach ( $post_types as $type ) { add_meta_box( 'bgbn-plus-metabox', __( 'Layout Settings', 'bgbn' ), 'bgbn_render_plus_metabox', $type, 'side', 'default' ); } } add_action( 'add_meta_boxes', 'bgbn_add_plus_metabox' ); /** * Render the bgbn Plus metabox. * * @since 1.0.6. * * @param object $post The current post object. * @return void */ function bgbn_render_plus_metabox( $post ) { // Get the post type label $post_type = get_post_type_object( $post->post_type ); $label = ( isset( $post_type->labels->singular_name ) ) ? $post_type->labels->singular_name : __( 'Post' ); echo '
'; printf( __( 'Looking to unlock Visual button %1$s? %2$s.', 'bgbn' ), esc_html( strtolower( $label ) ), sprintf( '%2$s', esc_url( bgbn_get_plus_link( 'layout-settings' ) ), sprintf( __( 'Upgrade to %s', 'bgbn' ), 'BigBusiness Plus' ) ) ); echo '
'; }