Changeset 1684652
- Timestamp:
- 06/24/2017 09:23:14 AM (9 years ago)
- Location:
- primary-category/trunk
- Files:
-
- 4 edited
-
README.txt (modified) (3 diffs)
-
classes/pri-cat-box.php (modified) (1 diff)
-
classes/pri-cat-shortcode.php (modified) (1 diff)
-
primary-category.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
primary-category/trunk/README.txt
r1669453 r1684652 14 14 == Description == 15 15 16 This plugin adds radiobuttons near every category (even if you add a new category) so you can choose the primary category of your post **. Selecting a primary category and updating the post saves this data into a custom field with a meta key of primary_category.16 This plugin adds radiobuttons near every category (even if you add a new category) so you can choose the primary category of your post **. Selecting a primary category and updating the post saves this data into a custom field with a meta key of "primary_category". 17 17 18 To display a list of all posts with a particular primary category, use the shortcode [primary-category name= CATEGORY NAME post_type=POST TYPE] where CATEGORY NAME is the name of the primary category you wish to display and POST TYPE is the custom post type name. If a name is not specified, the shortcode will default to all posts with uncategorizedset as the primary category. images or post.18 To display a list of all posts with a particular primary category, use the shortcode [primary-category name="CATEGORY NAME" post_type="POST TYPE"] where CATEGORY NAME is the name of the primary category you wish to display and POST TYPE is the custom post type name. If a name is not specified, the shortcode will default to all posts with "uncategorized" set as the primary category. images or post. 19 19 20 20 == Installation == … … 22 22 23 23 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly. 24 2. Activate the plugin through the 'Plugins'screen in WordPress24 2. Activate the plugin through the `Plugins` screen in WordPress 25 25 3. See the categories tab in your post or custom post edit page. Set the radiobutton near your preferred category. 26 26 … … 30 30 = How can I access the primary category data? = 31 31 32 A post s primary category is stored in the post meta under the key primary_category.32 A post's primary category is stored in the post meta under the key 'primary_category'. 33 33 34 34 = What shortcode can I use to display posts with a particular primary category? = 35 35 36 [primary-category name=CATEGORY NAME post_type=POST TYPE] 36 `[primary-category name="CATEGORY NAME" post_type="POST TYPE"]` 37 37 38 38 == Screenshots == -
primary-category/trunk/classes/pri-cat-box.php
r1669453 r1684652 73 73 } 74 74 });'; 75 $msg=sprintf('<br>%s<strong>%s</strong><br>',__('Please, use the radio button for ','primary-category'), __('primary category','primary-category')); 75 76 76 $html .= '$("#'.$taxonomy_name.'-adder a").before(\' <br>Please, use the radio button for <strong>primary category</strong><br>\')';77 $html .= '$("#'.$taxonomy_name.'-adder a").before(\''.$msg.'\')'; 77 78 78 79 $html .= '});</script>'; -
primary-category/trunk/classes/pri-cat-shortcode.php
r1669453 r1684652 61 61 } else { 62 62 63 $ret .= "Sorry, there are no posts or custom posts with that primary category.";63 $ret .= __("Sorry, there are no posts or custom posts with that primary category.",'primary-category'); 64 64 65 65 } -
primary-category/trunk/primary-category.php
r1669453 r1684652 5 5 * Plugin URI: http://www.roberto-bruno.me 6 6 * Author: Roberto Bruno 7 * Version: 1.0. 07 * Version: 1.0.1 8 8 * Author URI: http://www.roberto-bruno.me 9 * Text Domain: primary-category 9 10 * License: GPL2 10 11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.