Changeset 851163
- Timestamp:
- 02/04/2014 10:37:40 AM (12 years ago)
- Location:
- page-specific-menu-items
- Files:
-
- 2 added
- 1 edited
- 1 moved
-
assets/banner-1544x500.png (added)
-
assets/banner-722x250.png (added)
-
trunk/page-specific-menu-items.php (moved) (moved from page-specific-menu-items/trunk/page_specific_menu_items.php) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
page-specific-menu-items/trunk/page-specific-menu-items.php
r850425 r851163 4 4 * Plugin URI: http://www.wordpress.org/plugins 5 5 * Description: This plugin allows you to select menu items page wise. 6 * Version: 1. 3.26 * Version: 1.4 7 7 * Author: Dharma Poudel (@rogercomred) 8 8 * Author URI: https://www.twitter.com/rogercomred 9 * Text Domain: p smi-menu-items9 * Text Domain: page-specific-menu-items 10 10 * Domain Path: /l10n 11 11 */ 12 12 13 13 //define some constants 14 if (!defined('PSMI_TEXTDOMAIN')) define('PSMI_TEXTDOMAIN', 'p smi-menu-items');14 if (!defined('PSMI_TEXTDOMAIN')) define('PSMI_TEXTDOMAIN', 'page-specific-menu-items'); 15 15 16 16 if(!class_exists('Page_Specific_Menu_Items')) { … … 48 48 add_action( 'admin_init', array( $this, 'psmi_init' )); 49 49 add_action( 'admin_init', array( $this, 'psmi_page_init' )); 50 add_action( 'ad min_init', array( $this, 'psmi_add_meta_box' ));50 add_action( 'add_meta_boxes', array( $this, 'psmi_add_meta_box' )); 51 51 add_action( 'admin_menu', array( $this, 'psmi_add_page' ) ); 52 52 add_action( 'save_post', array( $this, 'psmi_save_menuitems') ); … … 67 67 **/ 68 68 public static function psmi_install() { 69 // do nothing 69 // do nothing for now 70 70 } 71 71 … … 76 76 **/ 77 77 public static function psmi_uninstall() { 78 delete_option('psmi_defaults'); 78 // do nothing for now 79 //delete_option('psmi_defaults'); 79 80 } 80 81 … … 165 166 add_settings_field( 166 167 'psmi-posttype-checkbox', // ID 167 ' ', // Title168 __('Select Post Type', PSMI_TEXTDOMAIN), // Title 168 169 array( $this, 'psmi_posttype_checkbox_cb' ), // Callback 169 170 'psmi-setting-admin', // Page … … 177 178 **/ 178 179 public function psmi_posttype_checkbox_cb() { 179 if($this->psmi_defaults['post_type'] ){ 180 foreach($this->psmi_defaults['post_type'] as $post_types) 181 echo "<input type='hidden' name='psmi_defaults[post_type][]' value='$post_types' />"; 182 } 180 $args = array( 'public' => true, '_builtin' => false ); 181 $custom_post_types = array_merge(array('post', 'page'), array_values(get_post_types($args, 'names'))); 182 echo '<ul>'; 183 foreach($custom_post_types as $cpt => $name){ 184 $checked = (!empty($this->psmi_defaults['post_type']) && $this->psmi_defaults['post_type'][0]!='' && in_array($name, $this->psmi_defaults['post_type'])) ? 'checked="checked"' : ''; 185 186 echo '<li><input type="checkbox" style="margin:1px 5px 0;" '.$checked.' name="psmi_defaults[post_type][]" value="'.$name.'" />'. $name .'</li>'; 187 } 188 echo '</ul>'; 183 189 } 184 190 … … 189 195 **/ 190 196 public function psmi_print_section_text() { 191 echo __('Select which menu you want to use :', PSMI_TEXTDOMAIN);197 //echo __('Select which menu you want to use :', PSMI_TEXTDOMAIN); 192 198 } 193 199 … … 200 206 $all_menus = wp_get_nav_menus(); 201 207 if($all_menus){ 202 echo "<select id='psmi_select_menu' name='psmi_defaults[menu_id]' >";208 echo "<select style='min-width:120px;' id='psmi_select_menu' name='psmi_defaults[menu_id]' >"; 203 209 $selected = ('' == $this->psmi_defaults['menu_id'])? 'selected="selected"' : '' ; 204 210 echo "<option value='' {$selected} >".__('Select Menu', PSMI_TEXTDOMAIN)."</options>"; … … 248 254 if ($menu_items) { 249 255 250 _e("<p>Select menu items to hide in this page. </p>", PSMI_TEXTDOMAIN);256 _e("<p>Select menu items to hide in this page. Top level menu items are marked bold.</p>", PSMI_TEXTDOMAIN); 251 257 252 258 $currentpage_items =get_post_meta($post->ID, PSMI_TEXTDOMAIN.'_currentpage_items', true); -
page-specific-menu-items/trunk/readme.txt
r850425 r851163 3 3 Requires at least: 3.5 4 4 Tested up to: 3.8 5 Stable tag: 1. 3.25 Stable tag: 1.4 6 6 License: GPLv3 7 7 Contributors: dharmapoudel … … 42 42 == Changelog == 43 43 44 = 1.4 (2014-2-4) = 45 * Added support for custom post types 46 44 47 = 1.3 (2014-2-3) = 45 48 * Fixed the warning on plugin install
Note: See TracChangeset
for help on using the changeset viewer.