diff --git a/includes/admin.php b/includes/admin.php index 01cf047..d55d0bb 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -34,14 +34,14 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { ) ); - /** Empty, as we'll be building the page manually */ + //* Empty, as we'll be building the page manually $page_ops = array(); $settings_field = SS_SETTINGS_FIELD; $this->create( $page_id, $menu_ops, $page_ops, $settings_field ); - /** Simpe Sidebar actions (create, edit, or delete) */ + //* Simpe Sidebar actions (create, edit, or delete) add_action( 'admin_init', array( $this, 'actions' ) ); } @@ -123,7 +123,7 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { * Action handler. * * Depending on what action was intended by the user, this method calls the appropriate action method. - * + * * @since 1.0.0 * */ @@ -201,10 +201,10 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { exit; } - // nonce verification + //* nonce verification check_admin_referer( 'simple-sidebars-action_create-sidebar' ); - // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user + //* WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user if ( is_numeric( $args['id'] ) ) $args['id'] = sanitize_title_with_dashes( $args['name'] ); @@ -242,10 +242,10 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { exit; } - // nonce verification + //* nonce verification check_admin_referer( 'simple-sidebars-action_edit-sidebar' ); - // WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user + //* WP changes a numeric sidebar id to sidebar-id which makes it inaccessible to the user if ( is_numeric( $args['id'] ) ) $args['id'] = sanitize_title_with_dashes( $args['name'] ); @@ -283,7 +283,7 @@ class Genesis_Simple_Sidebars_Admin extends Genesis_Admin_Basic { exit; } - // nonce verification + //* nonce verification check_admin_referer( 'simple-sidebars-action_delete-sidebar' ); $_sidebars = (array) get_option( SS_SETTINGS_FIELD ); @@ -346,4 +346,4 @@ function simplesidebars_settings_menu() { new Genesis_Simple_Sidebars_Admin; -} \ No newline at end of file +} diff --git a/includes/inpost.php b/includes/inpost.php index 4012419..e639cff 100644 --- a/includes/inpost.php +++ b/includes/inpost.php @@ -1,15 +1,15 @@ true ) ) as $type ) { + foreach ( (array) get_post_types( array( 'public' => 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'); + add_meta_box( 'ss_inpost_metabox', __( 'Sidebar Selection', 'ss' ), 'ss_inpost_metabox', $type, 'side', 'low' ); } } @@ -22,31 +22,31 @@ function ss_inpost_metabox() { ?> - +
- +
- + @@ -55,43 +55,43 @@ function ss_inpost_metabox() { ID; - // don't try to save the data under autosave, ajax, or future post. + //* 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 ) ) + //* 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'] + '_ss_sidebar' => $_POST['_ss_sidebar'], + '_ss_sidebar_alt' => $_POST['_ss_sidebar_alt'], ); - // store the custom fields + //* store the custom fields foreach ( $_sidebars as $key => $value ) { - if ( $post->post_type == 'revision' ) return; // don't try to store data during revision save + //* don't try to store data during revision save + if ( 'revision' === $post->post_type ) + return; if ( $value ) { - // save/update update_post_meta($post->ID, $key, $value); } else { - // delete if blank delete_post_meta($post->ID, $key); } } -} \ No newline at end of file +} diff --git a/includes/term.php b/includes/term.php index abbc6b4..c4a2c0f 100644 --- a/includes/term.php +++ b/includes/term.php @@ -27,16 +27,16 @@ function ss_term_sidebar($tag, $taxonomy) { ?> -
+| + |
|---|
| - | - | + | + | + | |
|---|---|---|---|---|---|
| - | - | + | + | + |