true ) ) as $type ) { if ( post_type_supports( $type, 'genesis-simple-sidebars' ) || $type == 'post' || $type == 'page' ) { add_meta_box( 'ss_inpost_metabox', __( 'Sidebar Selection', 'ss' ), 'ss_inpost_metabox', $type, 'side', 'low' ); } } } function ss_inpost_metabox() { $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); global $wp_registered_sidebars; ?>
ID; //* don't try to save the data under autosave, ajax, or future post. if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return; if ( defined('DOING_AJAX') && DOING_AJAX ) return; if ( defined('DOING_CRON') && DOING_CRON ) return; //* is the user allowed to edit the post or page? if ( ( 'page' == $_POST['post_type'] && ! current_user_can( 'edit_page', $post->ID ) ) || ! current_user_can( 'edit_post', $post->ID ) ) return $post->ID; $_sidebars = array( '_ss_sidebar' => $_POST['_ss_sidebar'], '_ss_sidebar_alt' => $_POST['_ss_sidebar_alt'], ); //* store the custom fields foreach ( $_sidebars as $key => $value ) { //* don't try to store data during revision save if ( 'revision' === $post->post_type ) return; if ( $value ) { update_post_meta($post->ID, $key, $value); } else { delete_post_meta($post->ID, $key); } } }