true ) ) as $type ) { if ( post_type_supports( $type, 'bizznis-layouts' ) ) { add_meta_box( 'bizznis_inpost_layout_box', __( 'Layout Settings', 'bizznis' ), 'bizznis_inpost_layout_box', $type, 'normal', 'core' ); } } } /** * Callback for in-post layout meta box. * * @since 1.0.0 */ function bizznis_inpost_layout_box() { wp_nonce_field( 'bizznis_inpost_layout_save', 'bizznis_inpost_layout_nonce' ); $layout = bizznis_get_custom_field( '_bizznis_layout' ); $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_customize_url() ); ?>
'', '_bizznis_custom_body_class' => '', '_bizznis_post_class' => '', '_bizznis_hide_header' => '', ) ); $data = array_map( 'bizznis_sanitize_html_classes', $data ); bizznis_save_custom_fields( $data, 'bizznis_inpost_layout_save', 'bizznis_inpost_layout_nonce', $post, $post_id ); } /** * Register a new meta box to the post or page edit screen, so that the user can * apply scripts on a per-post or per-page basis. * * @since 1.0.0 */ add_action( 'admin_menu', 'bizznis_add_inpost_scripts_box' ); function bizznis_add_inpost_scripts_box() { # If user doesn't have unfiltered html capability, don't show this box if ( ! current_user_can( 'unfiltered_html' ) ) { return; } foreach ( (array) get_post_types( array( 'public' => true ) ) as $type ) { if ( post_type_supports( $type, 'bizznis-scripts' ) ) { add_meta_box( 'bizznis_inpost_scripts_box', __( 'Scripts', 'bizznis' ), 'bizznis_inpost_scripts_box', $type, 'normal', 'low' ); } } } /** * Callback for in-post Scripts meta box. * * @since 1.0.0 */ function bizznis_inpost_scripts_box() { wp_nonce_field( 'bizznis_inpost_scripts_save', 'bizznis_inpost_scripts_nonce' ); ?> '', ) ); bizznis_save_custom_fields( $data, 'bizznis_inpost_scripts_save', 'bizznis_inpost_scripts_nonce', $post, $post_id ); }