From 33940b3bce41777da7bcfb087d7b6941581af9cc Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:04:58 -0400 Subject: [PATCH 01/13] Purge develop branch. --- README.md | 4 - includes/admin.php | 349 ---------------------------------------- includes/inpost.php | 97 ----------- includes/term.php | 69 -------- includes/views/edit.php | 39 ----- includes/views/main.php | 70 -------- languages/ss-de_DE.mo | Bin 4651 -> 0 bytes languages/ss-de_DE.po | 226 -------------------------- languages/ss.po | 148 ----------------- plugin.php | 245 ---------------------------- readme.txt | 64 -------- 11 files changed, 1311 deletions(-) delete mode 100644 README.md delete mode 100644 includes/admin.php delete mode 100644 includes/inpost.php delete mode 100644 includes/term.php delete mode 100644 includes/views/edit.php delete mode 100644 includes/views/main.php delete mode 100644 languages/ss-de_DE.mo delete mode 100644 languages/ss-de_DE.po delete mode 100644 languages/ss.po delete mode 100644 plugin.php delete mode 100644 readme.txt diff --git a/README.md b/README.md deleted file mode 100644 index 0eed121..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -genesis-simple-sidebars -======================= - -Plugin: Genesis Simple Sidebars diff --git a/includes/admin.php b/includes/admin.php deleted file mode 100644 index 01cf047..0000000 --- a/includes/admin.php +++ /dev/null @@ -1,349 +0,0 @@ - array( - 'parent_slug' => 'genesis', - 'page_title' => __( 'Genesis - Simple Sidebars', 'ss' ), - 'menu_title' => __( 'Simple Sidebars', 'ss' ) - ) - ); - - /** 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) */ - add_action( 'admin_init', array( $this, 'actions' ) ); - - } - - /** - * Callback for displaying the Simple Sidebars admin page. - * - * Echoes out HTML. - * - * @since 1.0.0 - * - */ - public function admin() { - - $_sidebars = get_option( $this->settings_field ); - - echo '
'; - - if ( isset( $_REQUEST['action'] ) && 'edit' == $_REQUEST['action'] ) - require_once( SS_PLUGIN_DIR . '/includes/views/edit.php' ); - else - require_once( SS_PLUGIN_DIR . '/includes/views/main.php' ); - - echo '
'; - - } - - /** - * Display sidebar table rows. - * - * Displays table rows of sidebars for viewing and editing on the main admin page. - * - * @since 1.0.0 - * - */ - public function table_rows() { - - global $wp_registered_sidebars; - - $_sidebars = $wp_registered_sidebars; - - $alt = true; - - foreach ( (array) $_sidebars as $id => $info ) : - - $is_editable = isset( $info['editable'] ) && $info['editable'] ? true : false; - - ?> - - > - - %s', admin_url('admin.php?page=simple-sidebars&action=edit&id=' . esc_html( $id ) ), esc_html( $info['name'] ), esc_html( $info['name'] ) ); - } else { - printf( '%s', esc_html( $info['name'] ) ); - } - ?> - - -
-
- | - -
- - - - - - - - create_sidebar( $_POST['new_sidebar'] ); - } - - /** - * This section will handle the data if a sidebar is deleted - */ - if ( isset( $_REQUEST['action'] ) && 'delete' == $_REQUEST['action'] && isset( $_REQUEST['id'] ) ) { - $this->delete_sidebar( $_REQUEST['id'] ); - } - - /** - * This section will handle the data if a sidebar is to be modified - */ - if ( isset( $_REQUEST['action'] ) && 'edit' == $_REQUEST['action'] && ! isset( $_REQUEST['id'] ) ) { - $this->edit_sidebar( $_POST['edit_sidebar'] ); - } - - } - - /** - * Add custom notices that display when you successfully create, edit, or delete a sidebar. - * - * @since 1.0.0 - * - * @return null Returns null if not on the correct admin page. - */ - public function notices() { - - if ( ! genesis_is_menu_page( 'simple-sidebars' ) ) - return; - - $pattern = '

%s

'; - - if ( isset( $_REQUEST['created'] ) && 'true' === $_REQUEST['created'] ) { - printf( $pattern, __( 'New sidebar successfully created!', 'ss' ) ); - return; - } - - if ( isset( $_REQUEST['edited'] ) && 'true' === $_REQUEST['edited'] ) { - printf( $pattern, __( 'Sidebar successfully edited!', 'ss' ) ); - return; - } - - if ( isset( $_REQUEST['deleted'] ) && 'true' === $_REQUEST['deleted'] ) { - printf( $pattern, __( 'Sidebar successfully deleted.', 'ss' ) ); - return; - } - - return; - - } - - /** - * Create a sidebar. - * - * @since 1.0.0 - * - */ - protected function create_sidebar( $args = array() ) { - - if ( empty( $args['name'] ) || empty( $args['id'] ) ) { - wp_die( $this->error( 1 ) ); - exit; - } - - // 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 - if ( is_numeric( $args['id'] ) ) - $args['id'] = sanitize_title_with_dashes( $args['name'] ); - - $db = (array) get_option( SS_SETTINGS_FIELD ); - $new = array( - sanitize_title_with_dashes( $args['id'] ) => array( - 'name' => esc_html( $args['name'] ), - 'description' => esc_html( $args['description'] ) - ) - ); - - if ( array_key_exists( $args['id'], $db ) ) { - wp_die( $this->error( 2 ) ); - exit; - } - - $_sidebars = wp_parse_args( $new, $db ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url( 'admin.php?page=simple-sidebars&created=true' ) ); - exit; - - } - - /** - * Edit a sidebar. - * - * @since 1.0.0 - * - */ - protected function edit_sidebar( $args = array() ) { - - if ( empty( $args['name'] ) || empty( $args['id'] ) ) { - wp_die( $this->error( 3 ) ); - exit; - } - - // 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 - if ( is_numeric( $args['id'] ) ) - $args['id'] = sanitize_title_with_dashes( $args['name'] ); - - $db = (array) get_option( SS_SETTINGS_FIELD ); - $new = array( - sanitize_title_with_dashes( $args['id'] ) => array( - 'name' => esc_html( $args['name'] ), - 'description' => esc_html( $args['description'] ) - ) - ); - - if ( ! array_key_exists( $args['id'], $db ) ) { - wp_die( $this->error( 3 ) ); - exit; - } - - $_sidebars = wp_parse_args( $new, $db ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url( 'admin.php?page=simple-sidebars&edited=true' ) ); - exit; - - } - - /** - * Delete a sidebar. - * - * @since 1.0.0 - * - */ - protected function delete_sidebar( $id = '' ) { - - if ( empty( $id ) ) { - wp_die( $this->error( 4 ) ); - exit; - } - - // nonce verification - check_admin_referer( 'simple-sidebars-action_delete-sidebar' ); - - $_sidebars = (array) get_option( SS_SETTINGS_FIELD ); - - if ( ! isset( $_sidebars[$id] ) ) { - wp_die( $this->error( 4 ) ); - exit; - } - - unset( $_sidebars[$id] ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url( 'admin.php?page=simple-sidebars&deleted=true' ) ); - exit; - - } - - /** - * Returns an error message by ID. - * - * @since 1.0.0 - * - * @return string Returns an error string based on an error ID. - */ - protected function error( $error = false ) { - - if ( ! $error ) - return false; - - switch( (int) $error ) { - - case 1: - return __( 'Oops! Please choose a valid Name and ID for this sidebar', 'ss' ); - break; - case 2: - return __( 'Oops! That sidebar ID already exists', 'ss' ); - break; - case 3: - return __( 'Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss' ); - break; - case 4: - return __( 'Oops! You are trying to delete a sidebar that does not exist, or cannot be deleted', 'ss' ); - break; - default: - return __( 'Oops! Something went wrong. Try again.', 'ss' ); - - } - - } - -} - -add_action( 'genesis_admin_menu', 'simplesidebars_settings_menu' ); -/** - * Instantiate the class to create the menu. - * - * @since 1.0.0 - */ -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 deleted file mode 100644 index 4012419..0000000 --- a/includes/inpost.php +++ /dev/null @@ -1,97 +0,0 @@ - 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 ) ); - -?> - - - -

- - -

- -

- - -

- -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 ) { - - if ( $post->post_type == 'revision' ) return; // don't try to store data during revision save - - 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 deleted file mode 100644 index abbc6b4..0000000 --- a/includes/term.php +++ /dev/null @@ -1,69 +0,0 @@ -meta = wp_parse_args( $tag->meta, array( '_ss_sidebar' => '', '_ss_sidebar_alt' => '' ) ); - - // Pull custom sidebars - $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); - -?> - -

- - - - - - - - - - - - -
- -
- -
- - -

- -
- - - - - - - - - - - - - - - - - - - -
-

- - -

- -

- -
\ No newline at end of file diff --git a/includes/views/main.php b/includes/views/main.php deleted file mode 100644 index d3e3501..0000000 --- a/includes/views/main.php +++ /dev/null @@ -1,70 +0,0 @@ - -

- -
- -
-
- -

- - - - - - - - - - - - - - - - - - - - table_rows(); ?> - - -
- -
-
- -
-
- - -
-

- -
- - -
- - -

-
- -
- - -

-
- -
- - -
- -

-
- -
-
- -
\ No newline at end of file diff --git a/languages/ss-de_DE.mo b/languages/ss-de_DE.mo deleted file mode 100644 index ed6369b9047d5dc84f7b69d98f7d7ad81ab3f316..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4651 zcmd6q%Wot{9mfj@B$$vucn1>78+NgUd&aglXm@O{){og;E4J6MXIWwaR!w(JPvM@b zp{m+r8;}qZ5)zMFPACVYfKU_;T%sVBlMfLH#0iN*;D9(F{sIn>;QOoYp0SO|12|C9 z%%`X8^?TK?e)FeC?t7M@UBu@T_^iB*u_wXo?f62w{tm|82`++{!JFX2;Mc(Sf!_u1 z2cHAq1^x(p5BMT@ANVr(Aoxr0W8kmBkAQyx?|`p?wAB^{)A&31qWL@EIM@N#z;A zV)85C{TPHT*zZ8H(;q>y)89daR_OZ>NVcc;VSH#`(wX$3Ms~*VU>C9>wGS3x5M$U# zZfYd&yYV6WQ-doQ!YbH{Y(tG~M(rX#Bp2yKargmz$nF#q)F|et!F)k~dM3Y7tWkRc zA5ITdo3350&9X&qWo%Ndjzl|?T#KIM9b@^S$t~A%z@18DTUb6&Nh&=TRtmP5BzyyX z+eIH+&aIW&SHB%wksXm|9?YbdfQzl_du23hCd!AeYBakkwRFny2yc3Q2vIKUhCOfc zJr`MK299Ls-f$_L$_{x9iM`}PCp>r1@O+(IjjgV*4XBSV-xZo~sTj{EM!P(YrE{G; z8?Ks+vkeU6-X2czzOY_PTjNW)=UBoIZI>A7^rt;xU(Qs#$J+v5Bo!uekqV`2 z?6&E1Qj-(scrc`c*Um%GHP#!pmVGo$+w|H9OAHgbIPlQib-ua z{!}kXE8+69;ka!q`JciLs>9C$TkKQN?~Zk=q_9< zPr!U#Tw|vfBejRC4V3R1#MXIp`9(+5$^2;uc*|N{5oqhsau&($0M!h~53~D-@FpHB@)6&;Zb~&FX%JePF zR*Oxq-p}$BR;#;^8lp1v974c+8J>(*ljw8OI%JjxuM)`_|L}>;u*l@tmh2nrqji_6 zBwET-7qv`-SArRv6#E*R*1bqwJuNa5cBQ;D+u;_Z5kE{zTI7uBXPNnd}Lbk&Uj6t-;c{NM+QLqKC=N<)@lkcbiLZJac_@y*V=AOl^8>*=UdC z5w#BcP|M2$4<8^o%^@EN>!e?})4CB|8I2>UJJLo?9h(HHqQS4Ul^=u6t;nJq#`au; zYxogA-NNh~FCG^(A79`zb7P;6HVvJusM3NQX?sGCdX`PDk%!RH+*)7UcxKeIjcY2F z%Y|eOp8F0&8?N}2JRHEQZVlny;JdqXyK-)K7g6a+ug1*O?A)#{FnqhKjp>(NC!XV} zT^% z5r?oHf$5`#tG>6;!za!h-AOKOCh|6J7so~3;j-Fh(Rw7egx{4aTG8eHEBH1%yQMUwLDCKWaVRJ03Ju2M^Rjm>7<0ak zCoc9-s04=<7M|9!l5O z&#{zNibBd_T_lpi+_V~nWf`)F`s3#*e^+5tBYBI|6ArQHp-x6}!UX)`+Cu`-ZDawI ziEXK;a2PS!d6Y^>trP1?=Wa4&iyedxWv{oOO%;i!?~4BuJ?LV>-y9cgd9on\n" -"Language-Team: DECKERWEB \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-Language: German\n" -"X-Poedit-Country: GERMANY\n" -"X-Poedit-SourceCharset: utf-8\n" -"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n" -"X-Textdomain-Support: yes\n" -"X-Poedit-SearchPath-0: .\n" - -#@ ss -#: admin.php:17 -msgid "Simple Sidebars" -msgstr "Einfache Sidebars" - -#@ ss -#: admin.php:66 -msgid "Nice try, partner. But that sidebar doesn't exist. Click back and try again." -msgstr "Netter Versuch, doch leider existiert diese Sidebar nicht. Gehen Sie zurück und versuchen Sie es erneut." - -#@ ss -#: admin.php:72 -msgid "Edit Sidebar" -msgstr "Sidebar bearbeiten" - -#@ ss -#: admin.php:79 -#: admin.php:117 -#: admin.php:125 -#: admin.php:152 -msgid "Name" -msgstr "Name" - -#@ ss -#: admin.php:81 -#: admin.php:154 -msgid "A recognizable name for your new sidebar widget area" -msgstr "Ein passender Name für Ihren neuen Sidebar-Widget-Bereich" - -#@ ss -#: admin.php:85 -#: admin.php:118 -#: admin.php:126 -#: admin.php:158 -msgid "ID" -msgstr "ID" - -#@ ss -#: admin.php:89 -msgid "The unique ID is used to register the sidebar widget area (cannot be changed)" -msgstr "Die einzigartige ID wird verwendet, um den Sidebar-Widget-Bereich zu registrieren. Diese ID kann nicht verändert werden. Verwenden Sie am besten nur kleinbuchstaben, Bindestriche (Minus) und Zahlen." - -#@ ss -#: admin.php:93 -#: admin.php:119 -#: admin.php:127 -#: admin.php:164 -msgid "Description" -msgstr "Beschreibung" - -#@ ss -#: admin.php:99 -msgid "Update" -msgstr "Aktualisieren" - -#@ ss -#: admin.php:106 -msgid "Genesis - Simple Sidebars" -msgstr "Genesis - Einfache Sidebars" - -#@ ss -#: admin.php:113 -msgid "Current Sidebars" -msgstr "Aktuelle Sidebars" - -#@ ss -#: admin.php:146 -#: admin.php:168 -msgid "Add New Sidebar" -msgstr "Neue Sidebar hinzufügen" - -#@ ss -#: admin.php:160 -msgid "The unique ID is used to register the sidebar widget area" -msgstr "Die einzigartige ID wird verwendet, um den neuen Sidebar-Widget-Bereich zu registrieren. Diese ID kann nicht verändert werden. Verwenden Sie am besten nur kleinbuchstaben, Bindestriche (Minus) und Zahlen." - -#@ ss -#: functions.php:28 -msgid "Edit" -msgstr "Bearbeiten" - -#@ ss -#: functions.php:29 -msgid "Delete" -msgstr "Löschen" - -#@ ss -#: functions.php:145 -msgid "Oops! Please choose a valid Name and ID for this sidebar" -msgstr "Oops! Bitte wählen Sie einen gültigen Namen und eine gültige ID für diese Sidebar" - -#@ ss -#: functions.php:148 -msgid "Oops! That sidebar ID already exists" -msgstr "Oops! Diese Sidebar-ID existiert bereits" - -#@ ss -#: functions.php:151 -msgid "Oops! You are trying to edit a sidebar that does not exist, or is not editable" -msgstr "Oops! Sie versuchen eine Sidebar zu bearbeiten, die nicht existiert, oder nicht bearbeitet werden kann" - -#@ ss -#: functions.php:154 -msgid "Oops! You are trying to delete a sidebar that does not exist, or cannot be deleted" -msgstr "Oops! Sie versuchen eine Sidebar zu löschen, die nicht existiert oder nicht gelöscht werden kann/ darf" - -#@ ss -#: functions.php:157 -msgid "Oops! Something went wrong. Try again." -msgstr "Oops! Etwas ging schief. Bitte versuchen Sie es noch einmal." - -#@ ss -#: functions.php:173 -msgid "New sidebar successfully created!" -msgstr "Neue Sidebar erfolgreich erstellt!" - -#@ ss -#: functions.php:178 -msgid "Sidebar successfully edited!" -msgstr "Sidebar erfolgreich bearbeitet!" - -#@ ss -#: functions.php:183 -msgid "Sidebar successfully deleted." -msgstr "Sidebar erfolgreich gelöscht." - -#@ ss -#: inpost.php:10 -msgid "Sidebar Selection" -msgstr "Sidebar-Auswahl" - -#@ ss -#: inpost.php:22 -#: term.php:29 -msgid "Primary Sidebar" -msgstr "Haupt-Sidebar (Primary)" - -#@ ss -#: inpost.php:24 -#: inpost.php:43 -#: term.php:32 -#: term.php:46 -msgid "Default" -msgstr "Standard" - -#@ ss -#: inpost.php:41 -#: term.php:43 -msgid "Secondary Sidebar" -msgstr "Zweit-Sidebar (Secondary)" - -#@ ss -#: plugin.php:24 -#, php-format -msgid "Sorry, you can't activate unless you have installed Genesis" -msgstr "Hinweis: Dieses Plugin kann nicht aktiviert werden, solange das Genesis Framework nicht installiert ist." - -#@ ss -#: plugin.php:29 -#, php-format -msgid "Sorry, you cannot activate without Genesis %s or greater" -msgstr "Hinweis: Dieses Plugin kann nicht aktiviert werden, außer das Genesis Framework Version %s oder höher ist installiert." - -#@ ss -#: term.php:25 -msgid "Sidebar Options" -msgstr "Sidebar-Optionen" - -#@ ss -#. translators: plugin header field 'Name' -#: plugin.php:0 -msgid "Genesis Simple Sidebars" -msgstr "Genesis Einfache Sidebars" - -#@ ss -#. translators: plugin header field 'PluginURI' -#: plugin.php:0 -msgid "http://www.studiopress.com/plugins/simple-sidebars" -msgstr "http://www.studiopress.com/plugins/simple-sidebars" - -#@ ss -#. translators: plugin header field 'Description' -#: plugin.php:0 -msgid "Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas." -msgstr "Genesis Einfache Sidebars (Simple Sidebars) erlaubt es auf einfache Art und Weise neue Sidebar-Widget-Bereiche zu erstellen und zu verwenden." - -#@ ss -#. translators: plugin header field 'Author' -#: plugin.php:0 -msgid "Nathan Rice" -msgstr "Nathan Rice" - -#@ ss -#. translators: plugin header field 'AuthorURI' -#: plugin.php:0 -msgid "http://www.nathanrice.net/" -msgstr "http://www.nathanrice.net/" - -#@ ss -#. translators: plugin header field 'Version' -#: plugin.php:0 -msgid "0.9.2" -msgstr "0.9.2" - diff --git a/languages/ss.po b/languages/ss.po deleted file mode 100644 index 55a6470..0000000 --- a/languages/ss.po +++ /dev/null @@ -1,148 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-08-06 21:23-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: admin.php:17 -msgid "Simple Sidebars" -msgstr "" - -#: admin.php:66 -msgid "" -"Nice try, partner. But that sidebar doesn't exist. Click back and try again." -msgstr "" - -#: admin.php:72 -msgid "Edit Sidebar" -msgstr "" - -#: admin.php:79 admin.php:117 admin.php:125 admin.php:152 -msgid "Name" -msgstr "" - -#: admin.php:81 admin.php:154 -msgid "A recognizable name for your new sidebar widget area" -msgstr "" - -#: admin.php:85 admin.php:118 admin.php:126 admin.php:158 -msgid "ID" -msgstr "" - -#: admin.php:89 -msgid "" -"The unique ID is used to register the sidebar widget area (cannot be changed)" -msgstr "" - -#: admin.php:93 admin.php:119 admin.php:127 admin.php:164 -msgid "Description" -msgstr "" - -#: admin.php:99 -msgid "Update" -msgstr "" - -#: admin.php:106 -msgid "Genesis - Simple Sidebars" -msgstr "" - -#: admin.php:113 -msgid "Current Sidebars" -msgstr "" - -#: admin.php:146 admin.php:168 -msgid "Add New Sidebar" -msgstr "" - -#: admin.php:160 -msgid "The unique ID is used to register the sidebar widget area" -msgstr "" - -#: functions.php:28 -msgid "Edit" -msgstr "" - -#: functions.php:29 -msgid "Delete" -msgstr "" - -#: functions.php:137 -msgid "Oops! Please choose a valid Name and ID for this sidebar" -msgstr "" - -#: functions.php:140 -msgid "Oops! That sidebar ID already exists" -msgstr "" - -#: functions.php:143 -msgid "" -"Oops! You are trying to edit a sidebar that does not exist, or is not " -"editable" -msgstr "" - -#: functions.php:146 -msgid "" -"Oops! You are trying to delete a sidebar that does not exist, or cannot be " -"deleted" -msgstr "" - -#: functions.php:149 -msgid "Oops! Something went wrong. Try again." -msgstr "" - -#: functions.php:165 -msgid "New sidebar successfully created!" -msgstr "" - -#: functions.php:170 -msgid "Sidebar successfully edited!" -msgstr "" - -#: functions.php:175 -msgid "Sidebar successfully deleted." -msgstr "" - -#: inpost.php:10 -msgid "Sidebar Selection" -msgstr "" - -#: inpost.php:22 term.php:29 -msgid "Primary Sidebar" -msgstr "" - -#: inpost.php:24 inpost.php:36 term.php:32 term.php:46 -msgid "Default" -msgstr "" - -#: inpost.php:34 term.php:43 -msgid "Secondary Sidebar" -msgstr "" - -#: plugin.php:21 -#, php-format -msgid "" -"Sorry, you can't activate unless you have installed Genesis" -msgstr "" - -#: plugin.php:26 -#, php-format -msgid "" -"Sorry, you cannot activate without Genesis %s or greater" -msgstr "" - -#: term.php:25 -msgid "Sidebar Options" -msgstr "" diff --git a/plugin.php b/plugin.php deleted file mode 100644 index 13be297..0000000 --- a/plugin.php +++ /dev/null @@ -1,245 +0,0 @@ -Genesis %s, or greater.', 'ss' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) ); - -} - -add_action( 'genesis_init', 'ss_genesis_init', 12 ); -/** - * Plugin initialization. - * - * Initialize the plugin, set the constants, hook callbacks to actions, and include the plugin library. - * - * @since 0.9.0 - */ -function ss_genesis_init() { - - /** Deactivate if not running Genesis 1.8.0 or greater */ - if ( ! class_exists( 'Genesis_Admin_Boxes' ) ) - add_action( 'admin_init', 'ss_deactivate', 10, 0 ); - - /** Load translations */ - load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' ); - - /** required hooks */ - add_action( 'get_header', 'ss_sidebars_init' ); - add_action( 'widgets_init', 'ss_register_sidebars' ); - - /** The rest is admin stuff, so load only if we're in the admin area */ - if ( ! is_admin() ) - return; - - /** Include admin files */ - require_once( SS_PLUGIN_DIR . '/includes/admin.php' ); - require_once( SS_PLUGIN_DIR . '/includes/inpost.php' ); - require_once( SS_PLUGIN_DIR . '/includes/term.php' ); - - /** let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit */ - add_action( 'init', 'ss_term_edit_init' ); - -} -/** - * Register widget areas. - * - * This function registers the created sidebars as widget areas - * - * @since 0.9.0 - */ -function ss_register_sidebars() { - - $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); - - /** If no sidebars have been created, do nothing */ - if ( ! $_sidebars ) - return; - - /** Cycle through created sidebars, register them as widget areas */ - foreach ( (array) $_sidebars as $id => $info ) { - - register_sidebar( array( - 'name' => esc_html( $info['name'] ), - 'id' => $id, - 'description' => esc_html( $info['description'] ), - 'editable' => 1, - - 'before_widget' => '
', - 'after_widget' => "
\n", - 'before_title' => '

', - 'after_title' => "

\n" - ) ); - - } - -} - -/** - * Use custom sidebars. - * - * Remove the default sidebars, run some conditional logic, - * use alternate sidebars if necessary, else fallback on default sidebars. - * - * @since 0.9.0 - */ -function ss_sidebars_init() { - - remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); - remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' ); - add_action( 'genesis_sidebar', 'ss_do_sidebar' ); - add_action( 'genesis_sidebar_alt', 'ss_do_sidebar_alt' ); - -} - -/** - * Display primary sidebar. - * - * Display custom sidebar if one exists, else display default primary sidebar. - * - * @since 0.9.0 - */ -function ss_do_sidebar() { - - if ( ! ss_do_one_sidebar( '_ss_sidebar' ) ) - genesis_do_sidebar(); - -} - -/** - * Display secondary sidebar. - * - * Display custom sidebar if one exists, else display default secondary sidebar. - * - * @since 0.9.0 - */ -function ss_do_sidebar_alt() { - - if ( ! ss_do_one_sidebar( '_ss_sidebar_alt' ) ) - genesis_do_sidebar_alt(); - -} - -/** - * Sidebar widget area output. - * - * Helper function to show widgets in a particular sidebar. - * - * @param string $sidebar_key sidebar id you wish to output. - * - * @since 0.9.0 - * - */ -function ss_do_one_sidebar( $sidebar_key = '_ss_sidebar' ) { - - static $taxonomies = null; - - if ( is_singular() && $sidebar_key = genesis_get_custom_field( $sidebar_key ) ) { - if ( dynamic_sidebar( $sidebar_key ) ) return true; - } - - if ( is_category() ) { - $term = get_term( get_query_var( 'cat' ), 'category' ); - if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; - } - - if ( is_tag() ) { - $term = get_term( get_query_var( 'tag_id' ), 'post_tag' ); - if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; - } - - if ( is_tax() ) { - if ( null === $taxonomies ) - $taxonomies = ss_get_taxonomies(); - - foreach ( $taxonomies as $tax ) { - if ( 'post_tag' == $tax || 'category' == $tax ) - continue; - - if ( is_tax( $tax ) ) { - $obj = get_queried_object(); - $term = get_term( $obj->term_id, $tax ); - if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; - break; - } - } - } - - return false; - -} - -/** - * Return taxonomy ids. - * - * Helper function to return the array keys from a taxonomy query. - * - * @since 0.9.0 - */ -function ss_get_taxonomies() { - - $taxonomies = get_taxonomies( array( 'show_ui' => true, 'public' => true ) ); - return apply_filters( 'genesis_simple_sidebars_taxonomies', array_keys( $taxonomies ) ); - -} - -/** - * Does this Genesis install have the 3 column layouts deactivated? - * - * This function checks to see if the Genesis install still has active 3 column layouts. Since - * child themes and plugins can deregister layouts, we need to know if they have deregistered the 3 column layouts. - * - * @since 0.9.2 - */ -function ss_has_3_column_layouts() { - - $_layouts = (array) genesis_get_layouts(); - $_layouts = array_keys( $_layouts ); - $_3_column = array_intersect( $_layouts, array( 'content-sidebar-sidebar', 'sidebar-content-sidebar', 'sidebar-sidebar-content' ) ); - - return ! empty( $_3_column ); - -} diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 08bb20a..0000000 --- a/readme.txt +++ /dev/null @@ -1,64 +0,0 @@ -=== Plugin Name === -Contributors: nathanrice, wpmuguru -Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 -Tags: hooks, genesis, genesiswp, studiopress -Requires at least: 3.3 -Tested up to: 3.4.1 -Stable tag: 1.0.0 - -This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. - -== Description == - -This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. - -Creating widget areas programmatically, then using conditional logic to properly assign them to sidebar locations can be a complex task for a beginner. This plugin allows you to do all this from a simple administration menu, and assign widget areas to sidebar locations with simple drop-down menus within the post/page edit screens, or when editing a tag or category. - -== Installation == - -1. Upload the entire `genesis-simple-sidebars` folder to the `/wp-content/plugins/` directory -1. DO NOT change the name of the `genesis-simple-sidebars` folder -1. Activate the plugin through the 'Plugins' menu in WordPress -1. Navigate to the `Genesis > Simple Sidebars` menu -1. Create as many new sidebar widget areas as you need -1. Choose the widget area you want to display by choosing it from the drop-down menu in the post/page or category/tag edit screen. - -== Frequently Asked Questions == - -= Can I assign widget areas to locations other than the sidebars? = - -No. You can only assign them to the primary and secondary sidebars, using the plugin. - -However, once a widget area has been created, you can use hooks to programmatically display those widget areas throughout the theme. But if you're going to do that, it's very unlikely that you would want to use the plugin to create the widget areas. You might as well just create the widget areas programmatically too. - -= Does this plugin give me the option of creating an entirely NEW sidebar? = - -Not in the way you're probably thinking. The markup surrounding the widget area never changes. The only thing that changes is the dynamic content that displays within the pre-existing sidebar locations. - -== Changelog == - -= 0.1 = -* Initial Alpha Release - -= 0.9 = -* Fixed "is not array" errors reported by users -* Added nonce verification for security purposes -* Added error and success messages -* Bump to pre-release 0.9 branch - -= 0.9.1 = -* Added support for custom post types - -= 0.9.2 = -* Added support for custom taxonomies -* Added translation support -* bug fix to prevent invalid sidebar creation - -= 0.9.2.1 = -* Restore default tag/category support -* Default custom taxonomy support to on for public taxonomies -* Remove secondary selection when no 3 column layouts are enabled - -= 1.0.0 = -* Increase requirement to WordPress 3.3 and Genesis 1.8.0 -* Switch to Genesis Admin class to build admin menu. \ No newline at end of file From 4e6fc0b8934b3358445143c32922b675ae15235a Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:05:55 -0400 Subject: [PATCH 02/13] Tagging 0.9.0. --- admin.php | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ functions.php | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++ inpost.php | 84 +++++++++++++++++++++++ plugin.php | 118 ++++++++++++++++++++++++++++++++ readme.txt | 47 +++++++++++++ term.php | 53 +++++++++++++++ 6 files changed, 664 insertions(+) create mode 100644 admin.php create mode 100644 functions.php create mode 100644 inpost.php create mode 100644 plugin.php create mode 100644 readme.txt create mode 100644 term.php diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..0225cbd --- /dev/null +++ b/admin.php @@ -0,0 +1,181 @@ + + +
+ + + + +

+ +
+ + + + + + + + + + + + + + + + + + +
+

+ + +

+ +

+ +
+ + + + +

+ +
+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+ + +
+

+ +
+ + +
+ + +

+
+ +
+ + +

+
+ +
+ + +
+ +

+
+ +
+
+ +
+ + + +
+ + $info ) { ?> + + + + > + + %s', admin_url('admin.php?page=simple-sidebars&action=edit&id=' . esc_html( $id ) ), esc_html( $info['name'] ), esc_html( $info['name'] ) ); + } else { + printf( '%s', esc_html( $info['name'] ) ); + } + ?> + + +
+
+ | + +
+ + + + + + + + array( + 'name' => esc_html( $args['name'] ), + 'description' => esc_html( $args['description'] ) + ) + ); + + if ( array_key_exists( $args['id'], $db ) ) { + wp_die( ss_error_message(2) ); + exit; + } + + $_sidebars = wp_parse_args( $new, $db ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url('admin.php?page=simple-sidebars&created=true') ); + exit; + +} + +function ss_edit_sidebar( $args = array() ) { + + if ( empty( $args['name'] ) || empty( $args['id'] ) ) { + wp_die( ss_error_message(3) ); + exit; + } + + // nonce verification + check_admin_referer('simple-sidebars-action_edit-sidebar'); + + $db = (array)get_option(SS_SETTINGS_FIELD); + $new = array( + sanitize_title_with_dashes( $args['id'] ) => array( + 'name' => esc_html( $args['name'] ), + 'description' => esc_html( $args['description'] ) + ) + ); + + if ( !array_key_exists( $args['id'], $db ) ) { + wp_die( ss_error_message(3) ); + exit; + } + + $_sidebars = wp_parse_args( $new, $db ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url('admin.php?page=simple-sidebars&edited=true') ); + exit; + +} + +function ss_delete_sidebar( $id = '' ) { + + if ( empty( $id ) ) { + wp_die( ss_error_message(4) ); + exit; + } + + // nonce verification + check_admin_referer('simple-sidebars-action_delete-sidebar'); + + $_sidebars = (array)get_option( SS_SETTINGS_FIELD ); + + if ( !isset( $_sidebars[$id] ) ) { + wp_die( ss_error_message(4) ); + exit; + } + + unset( $_sidebars[$id] ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url('admin.php?page=simple-sidebars&deleted=true') ); + exit; + +} + +function ss_error_message( $error = false ) { + + if ( !$error ) return false; + + switch( (int)$error ) { + + case 1: + return __('Oops! Please choose a valid Name and ID for this sidebar', 'ss'); + break; + case 2: + return __('Oops! That sidebar ID already exists'); + break; + case 3: + return __('Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss'); + break; + case 4: + return __('Oops! You are trying to delete a sidebar that does not exist, or cannot be deleted', 'ss'); + break; + default: + return __('Oops! Something went wrong. Try again.', 'ss'); + + } + +} + +add_action('admin_notices', 'ss_success_message'); +function ss_success_message() { + + if ( !isset( $_REQUEST['page'] ) || $_REQUEST['page'] != 'simple-sidebars' ) { + return; + } + + $format = '

%s

'; + + if ( isset( $_REQUEST['created'] ) && $_REQUEST['created'] === 'true' ) { + printf( $format, __('New sidebar successfully created!', 'ss') ); + return; + } + + if ( isset( $_REQUEST['edited'] ) && $_REQUEST['edited'] === 'true' ) { + printf( $format, __('Sidebar successfully edited!', 'ss') ); + return; + } + + if ( isset( $_REQUEST['deleted'] ) && $_REQUEST['deleted'] === 'true' ) { + printf( $format, __('Sidebar successfully deleted.', 'ss') ); + return; + } + + return; + +} \ No newline at end of file diff --git a/inpost.php b/inpost.php new file mode 100644 index 0000000..c3bc3c7 --- /dev/null +++ b/inpost.php @@ -0,0 +1,84 @@ + + + + +

+ + +

+ +

+ + +

+ +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 ) { + + if ( $post->post_type == 'revision' ) return; // don't try to store data during revision save + + 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/plugin.php b/plugin.php new file mode 100644 index 0000000..9676111 --- /dev/null +++ b/plugin.php @@ -0,0 +1,118 @@ +Genesis', 'ss'), 'http://www.studiopress.com/themes/genesis' ) ); + } + + if( version_compare( $theme_info['Version'], $latest, '<' ) ) { + deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself + wp_die( sprintf( __('Sorry, you cannot activate without Genesis %s or greater', 'ss'), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) ); + } + +} + +// Define our constants +define('SS_SETTINGS_FIELD', 'ss-settings'); +define('SS_PLUGIN_DIR', dirname(__FILE__)); + +// Include files +require_once(SS_PLUGIN_DIR . '/admin.php'); +require_once(SS_PLUGIN_DIR . '/functions.php'); +require_once(SS_PLUGIN_DIR . '/inpost.php'); +require_once(SS_PLUGIN_DIR . '/term.php'); + +/** + * This function registers the created sidebars + */ +add_action('widgets_init', 'ss_register_sidebars'); +function ss_register_sidebars() { + + $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); + if ( !$_sidebars ) return; + + foreach ( (array)$_sidebars as $id => $info ) { + + register_sidebar(array( + 'name' => esc_html( $info['name'] ), + 'id' => $id, + 'description' => esc_html( $info['description'] ), + 'editable' => 1, + + 'before_widget' => '
', + 'after_widget' => "
\n", + 'before_title' => '

', + 'after_title' => "

\n" + )); + + } + +} + + +/** + * Remove the default sidebars, run some conditional logic, + * use alternate sidebars if necessary, else fallback on default sidebars. + */ +add_action('get_header', 'ss_sidebars_init'); +function ss_sidebars_init() { + remove_action('genesis_sidebar', 'genesis_do_sidebar'); + remove_action('genesis_sidebar_alt', 'genesis_do_sidebar_alt'); + add_action('genesis_sidebar', 'ss_do_sidebar'); + add_action('genesis_sidebar_alt', 'ss_do_sidebar_alt'); +} + +function ss_do_sidebar() { + + if ( is_singular() && $_sidebar = genesis_get_custom_field('_ss_sidebar') ) { + if ( dynamic_sidebar($_sidebar) ) return; + } + + if ( is_category() ) { + $term = get_term( get_query_var('cat'), 'category' ); + if( isset( $term->meta['_ss_sidebar'] ) && dynamic_sidebar( $term->meta['_ss_sidebar'] ) ) return; + } + + if ( is_tag() ) { + $term = get_term( get_query_var('tag_id'), 'post_tag' ); + if( isset( $term->meta['_ss_sidebar'] ) && dynamic_sidebar( $term->meta['_ss_sidebar'] ) ) return; + } + + genesis_do_sidebar(); + +} +function ss_do_sidebar_alt() { + + if ( is_singular() && $_sidebar_alt = genesis_get_custom_field('_ss_sidebar_alt') ) { + if ( dynamic_sidebar($_sidebar_alt) ) return; + } + + if ( is_category() ) { + $term = get_term( get_query_var('cat'), 'category' ); + if( isset( $term->meta['_ss_sidebar_alt'] ) && dynamic_sidebar( $term->meta['_ss_sidebar_alt'] ) ) return; + } + + if ( is_tag() ) { + $term = get_term( get_query_var('tag_id'), 'post_tag' ); + if( isset( $term->meta['_ss_sidebar_alt'] ) && dynamic_sidebar( $term->meta['_ss_sidebar_alt'] ) ) return; + } + + genesis_do_sidebar_alt(); + +} \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..986db2b --- /dev/null +++ b/readme.txt @@ -0,0 +1,47 @@ +=== Plugin Name === +Contributors: nathanrice +Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 +Tags: hooks, genesis, genesiswp, studiopress +Requires at least: 2.9 +Tested up to: 3.0 +Stable tag: 0.9 + +This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. + +== Description == + +This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. + +Creating widget areas programmatically, then using conditional logic to properly assign them to sidebar locations can be a complex task for a beginner. This plugin allows you to do all this from a simple administration menu, and assign widget areas to sidebar locations with simple drop-down menus within the post/page edit screens, or when editing a tag or category. + +== Installation == + +1. Upload the entire `genesis-simple-sidebars` folder to the `/wp-content/plugins/` directory +1. DO NOT change the name of the `genesis-simple-sidebars` folder +1. Activate the plugin through the 'Plugins' menu in WordPress +1. Navigate to the `Genesis > Simple Sidebars` menu +1. Create as many new sidebar widget areas as you need +1. Choose the widget area you want to display by choosing it from the drop-down menu in the post/page or category/tag edit screen. + +== Frequently Asked Questions == + += Can I assign widget areas to locations other than the sidebars? = + +No. You can only assign them to the primary and secondary sidebars, using the plugin. + +However, once a widget area has been created, you can use hooks to programmatically display those widget areas throughout the theme. But if you're going to do that, it's very unlikely that you would want to use the plugin to create the widget areas. You might as well just create the widget areas programmatically too. + += Does this plugin give me the option of creating an entirely NEW sidebar? = + +Not in the way you're probably thinking. The markup surrounding the widget area never changes. The only thing that changes is the dynamic content that displays within the pre-existing sidebar locations. + +== Changelog == + += 0.1 = +* Initial Alpha Release + += 0.9 = +* Fixed "is not array" errors reported by users +* Added nonce verification for security purposes +* Added error and success messages +* Bump to pre-release 0.9 branch \ No newline at end of file diff --git a/term.php b/term.php new file mode 100644 index 0000000..8c79ed8 --- /dev/null +++ b/term.php @@ -0,0 +1,53 @@ +meta = wp_parse_args( $tag->meta, array( '_ss_sidebar' => '', '_ss_sidebar_alt' => '' ) ); + + // Pull custom sidebars + $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); + +?> + +

+ + + + + + + + + + + + +
+ +
+ +
+ + Date: Fri, 9 Aug 2013 13:06:39 -0400 Subject: [PATCH 03/13] Tagging 0.9.1. --- inpost.php | 9 ++++++--- plugin.php | 2 +- readme.txt | 11 +++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/inpost.php b/inpost.php index c3bc3c7..b8317a2 100644 --- a/inpost.php +++ b/inpost.php @@ -4,9 +4,12 @@ * so that users can choose what sidebar to use. */ add_action('admin_menu', 'ss_add_inpost_metabox'); -function ss_add_inpost_metabox() { - add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'genesis'), 'ss_inpost_metabox', 'post', 'side', 'low'); - add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'genesis'), 'ss_inpost_metabox', 'page', 'side', 'low'); +function ss_add_inpost_metabox() { + 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', 'genesis'), 'ss_inpost_metabox', $type, 'side', 'low'); + } + } } function ss_inpost_metabox() { diff --git a/plugin.php b/plugin.php index 9676111..816b6c0 100644 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ Plugin Name: Genesis Simple Sidebars Plugin URI: http://www.studiopress.com/plugins/simple-sidebars Description: Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas. -Version: 0.9 +Version: 0.9.1 Author: Nathan Rice Author URI: http://www.nathanrice.net/ */ diff --git a/readme.txt b/readme.txt index 986db2b..ef74bb9 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: nathanrice Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 Tags: hooks, genesis, genesiswp, studiopress -Requires at least: 2.9 -Tested up to: 3.0 -Stable tag: 0.9 +Requires at least: 3.0 +Tested up to: 3.0.1 +Stable tag: 0.9.1 This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. @@ -44,4 +44,7 @@ Not in the way you're probably thinking. The markup surrounding the widget area * Fixed "is not array" errors reported by users * Added nonce verification for security purposes * Added error and success messages -* Bump to pre-release 0.9 branch \ No newline at end of file +* Bump to pre-release 0.9 branch + += 0.9.1 = +* Added support for custom post types \ No newline at end of file From 78faae2bbd638832f9ffc546020fd0a88fc826fc Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:07:35 -0400 Subject: [PATCH 04/13] Tagging 0.9.2. --- admin.php | 4 +- functions.php | 10 +- inpost.php | 11 +- languages/ss-de_DE.mo | Bin 0 -> 4651 bytes languages/ss-de_DE.po | 226 ++++++++++++++++++++++++++++++++++++++++++ languages/ss.po | 148 +++++++++++++++++++++++++++ plugin.php | 99 +++++++++++------- readme.txt | 13 ++- term.php | 10 +- 9 files changed, 474 insertions(+), 47 deletions(-) create mode 100644 languages/ss-de_DE.mo create mode 100644 languages/ss-de_DE.po create mode 100644 languages/ss.po diff --git a/admin.php b/admin.php index 0225cbd..b10cd86 100644 --- a/admin.php +++ b/admin.php @@ -5,7 +5,7 @@ add_action('admin_init', 'register_ss_settings'); function register_ss_settings() { register_setting(SS_SETTINGS_FIELD, SS_SETTINGS_FIELD); - add_option(SS_SETTINGS_FIELD, '__return_empty_array', '', 'yes'); + add_option(SS_SETTINGS_FIELD, array(), '', 'yes'); } /** @@ -96,7 +96,7 @@ function ss_settings_admin() { ?> -

+

diff --git a/functions.php b/functions.php index c12f5bc..ede9528 100644 --- a/functions.php +++ b/functions.php @@ -50,6 +50,10 @@ function ss_create_sidebar( $args = array() ) { // 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 + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + $db = (array)get_option(SS_SETTINGS_FIELD); $new = array( sanitize_title_with_dashes( $args['id'] ) => array( @@ -81,6 +85,10 @@ function ss_edit_sidebar( $args = array() ) { // 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 + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + $db = (array)get_option(SS_SETTINGS_FIELD); $new = array( sanitize_title_with_dashes( $args['id'] ) => array( @@ -137,7 +145,7 @@ function ss_error_message( $error = false ) { return __('Oops! Please choose a valid Name and ID for this sidebar', 'ss'); break; case 2: - return __('Oops! That sidebar ID already exists'); + return __('Oops! That sidebar ID already exists', 'ss'); break; case 3: return __('Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss'); diff --git a/inpost.php b/inpost.php index b8317a2..78a65ad 100644 --- a/inpost.php +++ b/inpost.php @@ -7,7 +7,7 @@ add_action('admin_menu', 'ss_add_inpost_metabox'); function ss_add_inpost_metabox() { 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', 'genesis'), 'ss_inpost_metabox', $type, 'side', 'low'); + add_meta_box('ss_inpost_metabox', __('Sidebar Selection', 'ss'), 'ss_inpost_metabox', $type, 'side', 'low'); } } } @@ -29,7 +29,14 @@ function ss_inpost_metabox() { ?>

- +

- + @@ -52,7 +55,9 @@ function ss_term_sidebar($tag, $taxonomy) { - + Date: Fri, 9 Aug 2013 13:11:17 -0400 Subject: [PATCH 06/13] Tagging 1.0.0. --- admin.php | 181 ---------------- functions.php | 189 ---------------- includes/admin.php | 349 ++++++++++++++++++++++++++++++ inpost.php => includes/inpost.php | 36 +-- term.php => includes/term.php | 17 +- includes/views/edit.php | 39 ++++ includes/views/main.php | 70 ++++++ plugin.php | 222 +++++++++++++------ 8 files changed, 643 insertions(+), 460 deletions(-) delete mode 100644 admin.php delete mode 100644 functions.php create mode 100644 includes/admin.php rename inpost.php => includes/inpost.php (95%) rename term.php => includes/term.php (95%) create mode 100644 includes/views/edit.php create mode 100644 includes/views/main.php diff --git a/admin.php b/admin.php deleted file mode 100644 index b10cd86..0000000 --- a/admin.php +++ /dev/null @@ -1,181 +0,0 @@ - - -

- - - - -

- -
- - - - - - - - - - - - - - - - - - -
-

- - -

- -

- -
- - - - -

- -
- -
-
- -

- - - - - - - - - - - - - - - - - - - - - - -
- -
-
- -
-
- - -
-

- -
- - -
- - -

-
- -
- - -

-
- -
- - -
- -

-
- -
-
- -
- - - -
- - $info ) { ?> - - - - > - - %s', admin_url('admin.php?page=simple-sidebars&action=edit&id=' . esc_html( $id ) ), esc_html( $info['name'] ), esc_html( $info['name'] ) ); - } else { - printf( '%s', esc_html( $info['name'] ) ); - } - ?> - - -
-
- | - -
- - - - - - - - array( - 'name' => esc_html( $args['name'] ), - 'description' => esc_html( $args['description'] ) - ) - ); - - if ( array_key_exists( $args['id'], $db ) ) { - wp_die( ss_error_message(2) ); - exit; - } - - $_sidebars = wp_parse_args( $new, $db ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url('admin.php?page=simple-sidebars&created=true') ); - exit; - -} - -function ss_edit_sidebar( $args = array() ) { - - if ( empty( $args['name'] ) || empty( $args['id'] ) ) { - wp_die( ss_error_message(3) ); - exit; - } - - // 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 - if ( is_numeric( $args['id'] ) ) - $args['id'] = sanitize_title_with_dashes( $args['name'] ); - - $db = (array)get_option(SS_SETTINGS_FIELD); - $new = array( - sanitize_title_with_dashes( $args['id'] ) => array( - 'name' => esc_html( $args['name'] ), - 'description' => esc_html( $args['description'] ) - ) - ); - - if ( !array_key_exists( $args['id'], $db ) ) { - wp_die( ss_error_message(3) ); - exit; - } - - $_sidebars = wp_parse_args( $new, $db ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url('admin.php?page=simple-sidebars&edited=true') ); - exit; - -} - -function ss_delete_sidebar( $id = '' ) { - - if ( empty( $id ) ) { - wp_die( ss_error_message(4) ); - exit; - } - - // nonce verification - check_admin_referer('simple-sidebars-action_delete-sidebar'); - - $_sidebars = (array)get_option( SS_SETTINGS_FIELD ); - - if ( !isset( $_sidebars[$id] ) ) { - wp_die( ss_error_message(4) ); - exit; - } - - unset( $_sidebars[$id] ); - - update_option( SS_SETTINGS_FIELD, $_sidebars ); - wp_redirect( admin_url('admin.php?page=simple-sidebars&deleted=true') ); - exit; - -} - -function ss_error_message( $error = false ) { - - if ( !$error ) return false; - - switch( (int)$error ) { - - case 1: - return __('Oops! Please choose a valid Name and ID for this sidebar', 'ss'); - break; - case 2: - return __('Oops! That sidebar ID already exists', 'ss'); - break; - case 3: - return __('Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss'); - break; - case 4: - return __('Oops! You are trying to delete a sidebar that does not exist, or cannot be deleted', 'ss'); - break; - default: - return __('Oops! Something went wrong. Try again.', 'ss'); - - } - -} - -add_action('admin_notices', 'ss_success_message'); -function ss_success_message() { - - if ( !isset( $_REQUEST['page'] ) || $_REQUEST['page'] != 'simple-sidebars' ) { - return; - } - - $format = '

%s

'; - - if ( isset( $_REQUEST['created'] ) && $_REQUEST['created'] === 'true' ) { - printf( $format, __('New sidebar successfully created!', 'ss') ); - return; - } - - if ( isset( $_REQUEST['edited'] ) && $_REQUEST['edited'] === 'true' ) { - printf( $format, __('Sidebar successfully edited!', 'ss') ); - return; - } - - if ( isset( $_REQUEST['deleted'] ) && $_REQUEST['deleted'] === 'true' ) { - printf( $format, __('Sidebar successfully deleted.', 'ss') ); - return; - } - - return; - -} \ No newline at end of file diff --git a/includes/admin.php b/includes/admin.php new file mode 100644 index 0000000..01cf047 --- /dev/null +++ b/includes/admin.php @@ -0,0 +1,349 @@ + array( + 'parent_slug' => 'genesis', + 'page_title' => __( 'Genesis - Simple Sidebars', 'ss' ), + 'menu_title' => __( 'Simple Sidebars', 'ss' ) + ) + ); + + /** 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) */ + add_action( 'admin_init', array( $this, 'actions' ) ); + + } + + /** + * Callback for displaying the Simple Sidebars admin page. + * + * Echoes out HTML. + * + * @since 1.0.0 + * + */ + public function admin() { + + $_sidebars = get_option( $this->settings_field ); + + echo '
'; + + if ( isset( $_REQUEST['action'] ) && 'edit' == $_REQUEST['action'] ) + require_once( SS_PLUGIN_DIR . '/includes/views/edit.php' ); + else + require_once( SS_PLUGIN_DIR . '/includes/views/main.php' ); + + echo '
'; + + } + + /** + * Display sidebar table rows. + * + * Displays table rows of sidebars for viewing and editing on the main admin page. + * + * @since 1.0.0 + * + */ + public function table_rows() { + + global $wp_registered_sidebars; + + $_sidebars = $wp_registered_sidebars; + + $alt = true; + + foreach ( (array) $_sidebars as $id => $info ) : + + $is_editable = isset( $info['editable'] ) && $info['editable'] ? true : false; + + ?> + + > + + %s', admin_url('admin.php?page=simple-sidebars&action=edit&id=' . esc_html( $id ) ), esc_html( $info['name'] ), esc_html( $info['name'] ) ); + } else { + printf( '%s', esc_html( $info['name'] ) ); + } + ?> + + +
+
+ | + +
+ + + + + + + + create_sidebar( $_POST['new_sidebar'] ); + } + + /** + * This section will handle the data if a sidebar is deleted + */ + if ( isset( $_REQUEST['action'] ) && 'delete' == $_REQUEST['action'] && isset( $_REQUEST['id'] ) ) { + $this->delete_sidebar( $_REQUEST['id'] ); + } + + /** + * This section will handle the data if a sidebar is to be modified + */ + if ( isset( $_REQUEST['action'] ) && 'edit' == $_REQUEST['action'] && ! isset( $_REQUEST['id'] ) ) { + $this->edit_sidebar( $_POST['edit_sidebar'] ); + } + + } + + /** + * Add custom notices that display when you successfully create, edit, or delete a sidebar. + * + * @since 1.0.0 + * + * @return null Returns null if not on the correct admin page. + */ + public function notices() { + + if ( ! genesis_is_menu_page( 'simple-sidebars' ) ) + return; + + $pattern = '

%s

'; + + if ( isset( $_REQUEST['created'] ) && 'true' === $_REQUEST['created'] ) { + printf( $pattern, __( 'New sidebar successfully created!', 'ss' ) ); + return; + } + + if ( isset( $_REQUEST['edited'] ) && 'true' === $_REQUEST['edited'] ) { + printf( $pattern, __( 'Sidebar successfully edited!', 'ss' ) ); + return; + } + + if ( isset( $_REQUEST['deleted'] ) && 'true' === $_REQUEST['deleted'] ) { + printf( $pattern, __( 'Sidebar successfully deleted.', 'ss' ) ); + return; + } + + return; + + } + + /** + * Create a sidebar. + * + * @since 1.0.0 + * + */ + protected function create_sidebar( $args = array() ) { + + if ( empty( $args['name'] ) || empty( $args['id'] ) ) { + wp_die( $this->error( 1 ) ); + exit; + } + + // 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 + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + + $db = (array) get_option( SS_SETTINGS_FIELD ); + $new = array( + sanitize_title_with_dashes( $args['id'] ) => array( + 'name' => esc_html( $args['name'] ), + 'description' => esc_html( $args['description'] ) + ) + ); + + if ( array_key_exists( $args['id'], $db ) ) { + wp_die( $this->error( 2 ) ); + exit; + } + + $_sidebars = wp_parse_args( $new, $db ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url( 'admin.php?page=simple-sidebars&created=true' ) ); + exit; + + } + + /** + * Edit a sidebar. + * + * @since 1.0.0 + * + */ + protected function edit_sidebar( $args = array() ) { + + if ( empty( $args['name'] ) || empty( $args['id'] ) ) { + wp_die( $this->error( 3 ) ); + exit; + } + + // 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 + if ( is_numeric( $args['id'] ) ) + $args['id'] = sanitize_title_with_dashes( $args['name'] ); + + $db = (array) get_option( SS_SETTINGS_FIELD ); + $new = array( + sanitize_title_with_dashes( $args['id'] ) => array( + 'name' => esc_html( $args['name'] ), + 'description' => esc_html( $args['description'] ) + ) + ); + + if ( ! array_key_exists( $args['id'], $db ) ) { + wp_die( $this->error( 3 ) ); + exit; + } + + $_sidebars = wp_parse_args( $new, $db ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url( 'admin.php?page=simple-sidebars&edited=true' ) ); + exit; + + } + + /** + * Delete a sidebar. + * + * @since 1.0.0 + * + */ + protected function delete_sidebar( $id = '' ) { + + if ( empty( $id ) ) { + wp_die( $this->error( 4 ) ); + exit; + } + + // nonce verification + check_admin_referer( 'simple-sidebars-action_delete-sidebar' ); + + $_sidebars = (array) get_option( SS_SETTINGS_FIELD ); + + if ( ! isset( $_sidebars[$id] ) ) { + wp_die( $this->error( 4 ) ); + exit; + } + + unset( $_sidebars[$id] ); + + update_option( SS_SETTINGS_FIELD, $_sidebars ); + wp_redirect( admin_url( 'admin.php?page=simple-sidebars&deleted=true' ) ); + exit; + + } + + /** + * Returns an error message by ID. + * + * @since 1.0.0 + * + * @return string Returns an error string based on an error ID. + */ + protected function error( $error = false ) { + + if ( ! $error ) + return false; + + switch( (int) $error ) { + + case 1: + return __( 'Oops! Please choose a valid Name and ID for this sidebar', 'ss' ); + break; + case 2: + return __( 'Oops! That sidebar ID already exists', 'ss' ); + break; + case 3: + return __( 'Oops! You are trying to edit a sidebar that does not exist, or is not editable', 'ss' ); + break; + case 4: + return __( 'Oops! You are trying to delete a sidebar that does not exist, or cannot be deleted', 'ss' ); + break; + default: + return __( 'Oops! Something went wrong. Try again.', 'ss' ); + + } + + } + +} + +add_action( 'genesis_admin_menu', 'simplesidebars_settings_menu' ); +/** + * Instantiate the class to create the menu. + * + * @since 1.0.0 + */ +function simplesidebars_settings_menu() { + + new Genesis_Simple_Sidebars_Admin; + +} \ No newline at end of file diff --git a/inpost.php b/includes/inpost.php similarity index 95% rename from inpost.php rename to includes/inpost.php index 735b68f..4012419 100644 --- a/inpost.php +++ b/includes/inpost.php @@ -4,20 +4,26 @@ * so that users can choose what sidebar to use. */ add_action('admin_menu', 'ss_add_inpost_metabox'); -function ss_add_inpost_metabox() { +function ss_add_inpost_metabox() { + 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'); - } + } + } + } -function ss_inpost_metabox() { +function ss_inpost_metabox() { + $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); + ?> - + - +

- -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; @@ -67,17 +73,17 @@ function ss_inpost_metabox_save( $post_id, $post ) { // 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 ) { - + if ( $post->post_type == 'revision' ) return; // don't try to store data during revision save - + if ( $value ) { // save/update update_post_meta($post->ID, $key, $value); @@ -87,5 +93,5 @@ function ss_inpost_metabox_save( $post_id, $post ) { } } - + } \ No newline at end of file diff --git a/term.php b/includes/term.php similarity index 95% rename from term.php rename to includes/term.php index 924a6f3..abbc6b4 100644 --- a/term.php +++ b/includes/term.php @@ -5,26 +5,31 @@ * are passed via the hook so that we can use them. */ function ss_term_edit_init() { + $taxonomies = ss_get_taxonomies(); - if( !empty( $taxonomies ) && is_admin() && is_array( $taxonomies ) ) { + + if ( ! empty( $taxonomies ) && is_admin() && is_array( $taxonomies ) ) { + foreach( $taxonomies as $tax ) add_action( "{$tax}_edit_form", 'ss_term_sidebar', 9, 2 ); + } + } function ss_term_sidebar($tag, $taxonomy) { - + // Merge Defaults to prevent notices $tag->meta = wp_parse_args( $tag->meta, array( '_ss_sidebar' => '', '_ss_sidebar_alt' => '' ) ); // Pull custom sidebars $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); - + ?>

- +
@@ -41,7 +46,7 @@ function ss_term_sidebar($tag, $taxonomy) { +?>
@@ -59,6 +64,6 @@ function ss_term_sidebar($tag, $taxonomy) { } ?>
- + +

+ +
+ + + + + + + + + + + + + + + + + + + +
+

+ + +

+ +

+ +
\ No newline at end of file diff --git a/includes/views/main.php b/includes/views/main.php new file mode 100644 index 0000000..d3e3501 --- /dev/null +++ b/includes/views/main.php @@ -0,0 +1,70 @@ + +

+ +
+ +
+
+ +

+ + + + + + + + + + + + + + + + + + + + table_rows(); ?> + + +
+ +
+
+ +
+
+ + +
+

+ +
+ + +
+ + +

+
+ +
+ + +

+
+ +
+ + +
+ +

+
+ +
+
+ +
\ No newline at end of file diff --git a/plugin.php b/plugin.php index bea01c0..13be297 100644 --- a/plugin.php +++ b/plugin.php @@ -3,102 +3,159 @@ Plugin Name: Genesis Simple Sidebars Plugin URI: http://www.studiopress.com/plugins/simple-sidebars Description: Genesis Simple Sidebars allows you to easily create and use new sidebar widget areas. -Version: 0.9.2.1 Author: Nathan Rice Author URI: http://www.nathanrice.net/ + Text Domain: ss Domain Path: /languages/ + +Version: 1.0.0 + +License: GNU General Public License v2.0 (or later) +License URI: http://www.opensource.org/licenses/gpl-license.php */ -// require Genesis 1.2 upon activation -register_activation_hook(__FILE__, 'ss_activation_check'); +/** Define our constants */ +define( 'SS_SETTINGS_FIELD', 'ss-settings' ); +define( 'SS_PLUGIN_DIR', dirname( __FILE__ ) ); + +register_activation_hook( __FILE__, 'ss_activation_check' ); +/** + * Activation hook callback. + * + * This functions runs when the plugin is activated. It checks to make sure the user is running + * a minimum Genesis version, so there are no conflicts or fatal errors. + * + * @since 0.9.0 + */ function ss_activation_check() { - $latest = '1.2'; - - $theme_info = get_theme_data(TEMPLATEPATH.'/style.css'); - - if( basename(TEMPLATEPATH) != 'genesis' ) { - load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' ); - deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself - wp_die( sprintf( __('Sorry, you can\'t activate unless you have installed Genesis', 'ss'), 'http://www.studiopress.com/themes/genesis' ) ); - } - - if( version_compare( $theme_info['Version'], $latest, '<' ) ) { - deactivate_plugins(plugin_basename(__FILE__)); // Deactivate ourself - wp_die( sprintf( __('Sorry, you cannot activate without Genesis %s or greater', 'ss'), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) ); - } + if ( 'genesis' != basename( TEMPLATEPATH ) ) { + ss_deactivate( '1.8.0', '3.3' ); + } } /** - * Hook into Genesis + * Deactivate Simple Sidebars. + * + * This function deactivates Simple Sidebars. + * + * @since 1.0.0 */ -add_action( 'genesis_init', 'ss_genesis_init', 12 ); -function ss_genesis_init() { - // Define our constants - define( 'SS_SETTINGS_FIELD', 'ss-settings' ); - define( 'SS_PLUGIN_DIR', dirname( __FILE__ ) ); +function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) { - // required hooks + deactivate_plugins( plugin_basename( __FILE__ ) ); + wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and Genesis %s, or greater.', 'ss' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) ); + +} + +add_action( 'genesis_init', 'ss_genesis_init', 12 ); +/** + * Plugin initialization. + * + * Initialize the plugin, set the constants, hook callbacks to actions, and include the plugin library. + * + * @since 0.9.0 + */ +function ss_genesis_init() { + + /** Deactivate if not running Genesis 1.8.0 or greater */ + if ( ! class_exists( 'Genesis_Admin_Boxes' ) ) + add_action( 'admin_init', 'ss_deactivate', 10, 0 ); + + /** Load translations */ + load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' ); + + /** required hooks */ add_action( 'get_header', 'ss_sidebars_init' ); add_action( 'widgets_init', 'ss_register_sidebars' ); - if ( !is_admin() ) + + /** The rest is admin stuff, so load only if we're in the admin area */ + if ( ! is_admin() ) return; - // Include admin files - load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' ); - require_once( SS_PLUGIN_DIR . '/admin.php' ); - require_once( SS_PLUGIN_DIR . '/functions.php' ); - require_once( SS_PLUGIN_DIR . '/inpost.php' ); - require_once( SS_PLUGIN_DIR . '/term.php' ); - // let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit + /** Include admin files */ + require_once( SS_PLUGIN_DIR . '/includes/admin.php' ); + require_once( SS_PLUGIN_DIR . '/includes/inpost.php' ); + require_once( SS_PLUGIN_DIR . '/includes/term.php' ); + + /** let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit */ add_action( 'init', 'ss_term_edit_init' ); + } /** - * This function registers the created sidebars + * Register widget areas. + * + * This function registers the created sidebars as widget areas + * + * @since 0.9.0 */ function ss_register_sidebars() { - + $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); - if ( !$_sidebars ) return; - - foreach ( (array)$_sidebars as $id => $info ) { - - register_sidebar(array( + + /** If no sidebars have been created, do nothing */ + if ( ! $_sidebars ) + return; + + /** Cycle through created sidebars, register them as widget areas */ + foreach ( (array) $_sidebars as $id => $info ) { + + register_sidebar( array( 'name' => esc_html( $info['name'] ), 'id' => $id, 'description' => esc_html( $info['description'] ), 'editable' => 1, - + 'before_widget' => '
', 'after_widget' => "
\n", 'before_title' => '

', 'after_title' => "

\n" - )); - - } - -} + ) ); + } + +} /** + * Use custom sidebars. + * * Remove the default sidebars, run some conditional logic, * use alternate sidebars if necessary, else fallback on default sidebars. + * + * @since 0.9.0 */ function ss_sidebars_init() { - remove_action('genesis_sidebar', 'genesis_do_sidebar'); - remove_action('genesis_sidebar_alt', 'genesis_do_sidebar_alt'); - add_action('genesis_sidebar', 'ss_do_sidebar'); - add_action('genesis_sidebar_alt', 'ss_do_sidebar_alt'); + + remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); + remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' ); + add_action( 'genesis_sidebar', 'ss_do_sidebar' ); + add_action( 'genesis_sidebar_alt', 'ss_do_sidebar_alt' ); + } +/** + * Display primary sidebar. + * + * Display custom sidebar if one exists, else display default primary sidebar. + * + * @since 0.9.0 + */ function ss_do_sidebar() { if ( ! ss_do_one_sidebar( '_ss_sidebar' ) ) genesis_do_sidebar(); } + +/** + * Display secondary sidebar. + * + * Display custom sidebar if one exists, else display default secondary sidebar. + * + * @since 0.9.0 + */ function ss_do_sidebar_alt() { if ( ! ss_do_one_sidebar( '_ss_sidebar_alt' ) ) @@ -106,44 +163,62 @@ function ss_do_sidebar_alt() { } -function ss_do_one_sidebar( $bar = '_ss_sidebar' ) { +/** + * Sidebar widget area output. + * + * Helper function to show widgets in a particular sidebar. + * + * @param string $sidebar_key sidebar id you wish to output. + * + * @since 0.9.0 + * + */ +function ss_do_one_sidebar( $sidebar_key = '_ss_sidebar' ) { + static $taxonomies = null; - - if ( is_singular() && $_bar = genesis_get_custom_field( $bar ) ) { - if ( dynamic_sidebar( $_bar ) ) return true; + + if ( is_singular() && $sidebar_key = genesis_get_custom_field( $sidebar_key ) ) { + if ( dynamic_sidebar( $sidebar_key ) ) return true; } - + if ( is_category() ) { - $term = get_term( get_query_var('cat'), 'category' ); - if( isset( $term->meta[$bar] ) && dynamic_sidebar( $term->meta[$bar] ) ) return true; + $term = get_term( get_query_var( 'cat' ), 'category' ); + if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; } - + if ( is_tag() ) { - $term = get_term( get_query_var('tag_id'), 'post_tag' ); - if( isset( $term->meta[$bar] ) && dynamic_sidebar( $term->meta[$bar] ) ) return true; + $term = get_term( get_query_var( 'tag_id' ), 'post_tag' ); + if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; } - + if ( is_tax() ) { - if( $taxonomies === null ) + if ( null === $taxonomies ) $taxonomies = ss_get_taxonomies(); - - foreach( $taxonomies as $tax ) { - if( $tax == 'post_tag' || $tax == 'category' ) + + foreach ( $taxonomies as $tax ) { + if ( 'post_tag' == $tax || 'category' == $tax ) continue; - - if( is_tax( $tax ) ) { + + if ( is_tax( $tax ) ) { $obj = get_queried_object(); $term = get_term( $obj->term_id, $tax ); - if( isset( $term->meta[$bar] ) && dynamic_sidebar( $term->meta[$bar] ) ) return true; + if ( isset( $term->meta[$sidebar_key] ) && dynamic_sidebar( $term->meta[$sidebar_key] ) ) return true; break; } } } - + return false; - + } +/** + * Return taxonomy ids. + * + * Helper function to return the array keys from a taxonomy query. + * + * @since 0.9.0 + */ function ss_get_taxonomies() { $taxonomies = get_taxonomies( array( 'show_ui' => true, 'public' => true ) ); @@ -151,11 +226,20 @@ function ss_get_taxonomies() { } +/** + * Does this Genesis install have the 3 column layouts deactivated? + * + * This function checks to see if the Genesis install still has active 3 column layouts. Since + * child themes and plugins can deregister layouts, we need to know if they have deregistered the 3 column layouts. + * + * @since 0.9.2 + */ function ss_has_3_column_layouts() { $_layouts = (array) genesis_get_layouts(); $_layouts = array_keys( $_layouts ); $_3_column = array_intersect( $_layouts, array( 'content-sidebar-sidebar', 'sidebar-content-sidebar', 'sidebar-sidebar-content' ) ); + return ! empty( $_3_column ); } From 718dfd9a556ca87189951508457bde6c97eac649 Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:35:43 -0400 Subject: [PATCH 07/13] Genesis 2.0 compatibility, standards. --- includes/admin.php | 18 +++++++-------- includes/inpost.php | 50 ++++++++++++++++++++--------------------- includes/term.php | 16 ++++++------- includes/views/edit.php | 20 ++++++++--------- includes/views/main.php | 34 ++++++++++++++-------------- plugin.php | 31 +++++++++++-------------- readme.txt | 6 ++--- 7 files changed, 85 insertions(+), 90 deletions(-) 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) { ?> -

+

- + - +
-

+screen_icon( 'themes' ); ?> +

- + - + +

- + +

- +
-

-

-

+

-
\ No newline at end of file + diff --git a/includes/views/main.php b/includes/views/main.php index d3e3501..721676e 100644 --- a/includes/views/main.php +++ b/includes/views/main.php @@ -1,26 +1,26 @@ - -

+ +

-

+

- - - + + + - - - + + + @@ -39,29 +39,29 @@
-

+

- +
- + -

+

- + -

+

- +
-

+

diff --git a/plugin.php b/plugin.php index 13be297..15a4e5e 100644 --- a/plugin.php +++ b/plugin.php @@ -9,7 +9,7 @@ Author URI: http://www.nathanrice.net/ Text Domain: ss Domain Path: /languages/ -Version: 1.0.0 +Version: 2.0.0-dev License: GNU General Public License v2.0 (or later) License URI: http://www.opensource.org/licenses/gpl-license.php @@ -60,27 +60,27 @@ add_action( 'genesis_init', 'ss_genesis_init', 12 ); */ function ss_genesis_init() { - /** Deactivate if not running Genesis 1.8.0 or greater */ + //* Deactivate if not running Genesis 1.8.0 or greater if ( ! class_exists( 'Genesis_Admin_Boxes' ) ) add_action( 'admin_init', 'ss_deactivate', 10, 0 ); - /** Load translations */ + //* Load translations load_plugin_textdomain( 'ss', false, 'genesis-simple-sidebars/languages' ); - /** required hooks */ + //* required hooks add_action( 'get_header', 'ss_sidebars_init' ); add_action( 'widgets_init', 'ss_register_sidebars' ); - /** The rest is admin stuff, so load only if we're in the admin area */ + //* The rest is admin stuff, so load only if we're in the admin area if ( ! is_admin() ) return; - /** Include admin files */ + //* Include admin files require_once( SS_PLUGIN_DIR . '/includes/admin.php' ); require_once( SS_PLUGIN_DIR . '/includes/inpost.php' ); require_once( SS_PLUGIN_DIR . '/includes/term.php' ); - /** let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit */ + //* let the child theme hook the genesis_simple_sidebars_taxonomies filter before hooking term edit add_action( 'init', 'ss_term_edit_init' ); } @@ -95,23 +95,18 @@ function ss_register_sidebars() { $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); - /** If no sidebars have been created, do nothing */ + //* If no sidebars have been created, do nothing if ( ! $_sidebars ) return; - /** Cycle through created sidebars, register them as widget areas */ + //* Cycle through created sidebars, register them as widget areas foreach ( (array) $_sidebars as $id => $info ) { - register_sidebar( array( - 'name' => esc_html( $info['name'] ), - 'id' => $id, + genesis_register_sidebar( array( + 'name' => esc_html( $info['name'] ), + 'id' => $id, 'description' => esc_html( $info['description'] ), - 'editable' => 1, - - 'before_widget' => '
', - 'after_widget' => "
\n", - 'before_title' => '

', - 'after_title' => "

\n" + 'editable' => 1, ) ); } diff --git a/readme.txt b/readme.txt index 7a4ccf2..52100d1 100644 --- a/readme.txt +++ b/readme.txt @@ -4,13 +4,13 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: hooks, genesis, genesiswp, studiopress Requires at least: 3.0 Tested up to: 3.3 -Stable tag: 0.9.2.1 +Stable tag: 1.0.0 -This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. +This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. == Description == -This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Theme Framework on a per post, per page, or per tag/category archive basis. +This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. Creating widget areas programmatically, then using conditional logic to properly assign them to sidebar locations can be a complex task for a beginner. This plugin allows you to do all this from a simple administration menu, and assign widget areas to sidebar locations with simple drop-down menus within the post/page edit screens, or when editing a tag or category. From 39f21130f4f08173343523f68a3d607bf0669576 Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:38:26 -0400 Subject: [PATCH 08/13] Better Genesis version detection. --- plugin.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin.php b/plugin.php index 15a4e5e..3cafa00 100644 --- a/plugin.php +++ b/plugin.php @@ -30,9 +30,8 @@ register_activation_hook( __FILE__, 'ss_activation_check' ); */ function ss_activation_check() { - if ( 'genesis' != basename( TEMPLATEPATH ) ) { - ss_deactivate( '1.8.0', '3.3' ); - } + if ( ! defined( 'PARENT_THEME_VERSION' ) || ! version_compare( PARENT_THEME_VERSION, '2.0.0', '>=' ) ) + ss_deactivate( '2.0.0', '3.6' ); } @@ -46,7 +45,7 @@ function ss_activation_check() { function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) { deactivate_plugins( plugin_basename( __FILE__ ) ); - wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and Genesis %s, or greater.', 'ss' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) ); + wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and Genesis %s, or greater.', 'simplehooks' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) ); } From c47dd22e9272808596a1e08ddc225d0f73647c44 Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Fri, 9 Aug 2013 13:43:39 -0400 Subject: [PATCH 09/13] Tagging 2.0.0. --- plugin.php | 2 +- readme.txt | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugin.php b/plugin.php index 3cafa00..290877f 100644 --- a/plugin.php +++ b/plugin.php @@ -9,7 +9,7 @@ Author URI: http://www.nathanrice.net/ Text Domain: ss Domain Path: /languages/ -Version: 2.0.0-dev +Version: 2.0.0 License: GNU General Public License v2.0 (or later) License URI: http://www.opensource.org/licenses/gpl-license.php diff --git a/readme.txt b/readme.txt index 52100d1..99f8a1e 100644 --- a/readme.txt +++ b/readme.txt @@ -2,9 +2,9 @@ Contributors: nathanrice, wpmuguru Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5553118 Tags: hooks, genesis, genesiswp, studiopress -Requires at least: 3.0 -Tested up to: 3.3 -Stable tag: 1.0.0 +Requires at least: 3.6 +Tested up to: 3.6 +Stable tag: 2.0.0 This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. @@ -59,3 +59,10 @@ Not in the way you're probably thinking. The markup surrounding the widget area * Default custom taxonomy support to on for public taxonomies * Remove secondary selection when no 3 column layouts are enabled += 1.0.0 = +* Reorganize theme files +* Standards + += 2.0.0 = +* Compatibility with Genesis 2.0 +* Standards \ No newline at end of file From f84db05c75c5c574bb5e30bed4e3a19941ab8223 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 9 Aug 2013 18:44:30 -0500 Subject: [PATCH 10/13] use sidebar name rather than hardcoded labels --- includes/inpost.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/includes/inpost.php b/includes/inpost.php index e639cff..c1fb2ce 100644 --- a/includes/inpost.php +++ b/includes/inpost.php @@ -19,13 +19,18 @@ function ss_add_inpost_metabox() { function ss_inpost_metabox() { $_sidebars = stripslashes_deep( get_option( SS_SETTINGS_FIELD ) ); + global $wp_registered_sidebars; ?> + +

- + Date: Tue, 20 Aug 2013 03:40:55 +0100 Subject: [PATCH 11/13] Fix incorrect text domain --- plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.php b/plugin.php index 290877f..bb75b0e 100644 --- a/plugin.php +++ b/plugin.php @@ -45,7 +45,7 @@ function ss_activation_check() { function ss_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) { deactivate_plugins( plugin_basename( __FILE__ ) ); - wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and Genesis %s, or greater.', 'simplehooks' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) ); + wp_die( sprintf( __( 'Sorry, you cannot run Simple Sidebars without WordPress %s and Genesis %s, or greater.', 'ss' ), $wp_version, 'http://my.studiopress.com/?download_id=91046d629e74d525b3f2978e404e7ffa', $genesis_version ) ); } From eedd494ae53673170b62753adf3b606b5175d13b Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Mon, 26 Aug 2013 15:02:02 -0400 Subject: [PATCH 12/13] Use proper key for Genesis 2.0.1 compatibility. --- includes/term.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/term.php b/includes/term.php index c4a2c0f..c11332e 100644 --- a/includes/term.php +++ b/includes/term.php @@ -31,9 +31,9 @@ function ss_term_sidebar($tag, $taxonomy) {

- + - +
- $info ) { @@ -48,9 +48,9 @@ function ss_term_sidebar($tag, $taxonomy) { if ( ss_has_3_column_layouts() ) { ?>
- $info ) { From f021c01b2544f8a81fe5ca189d2e7c9853bffeb1 Mon Sep 17 00:00:00 2001 From: Nathan Rice Date: Mon, 26 Aug 2013 15:04:07 -0400 Subject: [PATCH 13/13] Tagging 2.0.1. --- plugin.php | 2 +- readme.txt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/plugin.php b/plugin.php index bb75b0e..e06e240 100644 --- a/plugin.php +++ b/plugin.php @@ -9,7 +9,7 @@ Author URI: http://www.nathanrice.net/ Text Domain: ss Domain Path: /languages/ -Version: 2.0.0 +Version: 2.0.1 License: GNU General Public License v2.0 (or later) License URI: http://www.opensource.org/licenses/gpl-license.php diff --git a/readme.txt b/readme.txt index 99f8a1e..4cb17d4 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: hooks, genesis, genesiswp, studiopress Requires at least: 3.6 Tested up to: 3.6 -Stable tag: 2.0.0 +Stable tag: 2.0.1 This plugin allows you to create multiple, dynamic widget areas, and assign those widget areas to sidebar locations within the Genesis Framework on a per post, per page, or per tag/category archive basis. @@ -65,4 +65,9 @@ Not in the way you're probably thinking. The markup surrounding the widget area = 2.0.0 = * Compatibility with Genesis 2.0 -* Standards \ No newline at end of file +* Standards + += 2.0.1 = +* Genesis 2.0.1 compatibility with term meta keys +* Use actual sidebar name, instead of hard coded names +* Fix incorrect textdomain \ No newline at end of file