Changeset 1251026
- Timestamp:
- 09/22/2015 09:23:47 AM (11 years ago)
- Location:
- custom-field-menu/trunk
- Files:
-
- 4 edited
-
classes/admin/PluginAdminPage.php (modified) (3 diffs)
-
custom-field-menu.php (modified) (4 diffs)
-
custom_walker.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-field-menu/trunk/classes/admin/PluginAdminPage.php
r1250429 r1251026 15 15 register_setting('cfm_settings', 'title_box'); 16 16 register_setting('cfm_settings', 'text_button'); 17 register_setting('cfm_settings', 'force_using_walker'); 17 18 } 18 19 … … 32 33 <form method="post" action="options.php"> 33 34 <?php settings_fields('cfm_settings'); ?> 35 <div class="postbox"> 36 <h3><?php echo __('General'); ?></h3> 37 <div class="inside"> 38 <table width="100%" class="form-table cmb_metabox"> 39 <tr> 40 <th width="50%"> 41 <label for="force_using_walker"><?php echo __('Force the use of the custom Walker') ?></label> 42 </th> 43 <td> 44 <input type="checkbox" name="force_using_walker" id="force_using_walker" <?php if(get_option('force_using_walker') == 1){ echo 'checked'; } ?> value="1"> 45 </td> 46 </tr> 47 </table> 48 </div> 49 </div> 34 50 <div class="postbox"> 35 51 <h3><?php echo __('Image field'); ?></h3> … … 51 67 <input type="text" name="text_button" id="text_button" value="<?php echo esc_html(get_option('text_button')) ?>"> 52 68 </td> 53 </tr> 69 </tr> 54 70 </table> 55 71 </div> -
custom-field-menu/trunk/custom-field-menu.php
r1250425 r1251026 4 4 Plugin URL: http://clement-decou.olympe.in 5 5 Description: Add custom fields to menu items 6 Version: 0.2 6 Version: 0.2.5 7 7 Author: Clément Décou 8 8 Author URI: http://clement-decou.olympe.in … … 29 29 // add custom menu fields to menu 30 30 add_filter( 'wp_setup_nav_menu_item', array( $this, 'cfm_add_custom_nav_fields' ) ); 31 32 //Edit the walker if force 33 add_filter( 'wp_nav_menu_args', array($this, 'cfm_modify_nav_menu_args' )); 31 34 32 35 // save menu custom fields … … 56 59 } 57 60 61 /** 62 * Edit the args of wp_nav_menu 63 * 64 * @access public 65 * @since 0.2.5 66 * @return void 67 */ 68 function cfm_modify_nav_menu_args( $args ){ 69 if(get_option('force_using_walker') == 1){ 70 $args['walker'] = new cfm_walker; 71 } 72 return $args; 73 } 74 58 75 59 76 /** … … 69 86 wp_enqueue_media(); 70 87 wp_register_script('cfm-admin-js', WP_PLUGIN_URL.'/custom-field-menu/js/cfm_script.js', array('jquery')); 71 wp_localize_script('cfm-admin-js', 'titleBox', get_option('title_box') ); 72 wp_localize_script('cfm-admin-js', 'textButton', get_option('text_button') ); 88 $titleBox = (get_option('title_box') != '') ? get_option('title_box') : 'Choose an image'; 89 $txtButton = (get_option('text_button') != '') ? get_option('text_button') : 'Choose'; 90 wp_localize_script('cfm-admin-js', 'titleBox', $titleBox ); 91 wp_localize_script('cfm-admin-js', 'textButton', $txtButton ); 73 92 wp_enqueue_script('cfm-admin-js'); 74 93 } -
custom-field-menu/trunk/custom_walker.php
r1247335 r1251026 13 13 { 14 14 15 16 15 public function start_lvl( &$output, $depth = 0, $args = array() ) { 17 16 global $_CURRENT_URL_SUBMENU; -
custom-field-menu/trunk/readme.txt
r1250427 r1251026 3 3 Tags: custom field, CMS, menu, types, field, item, item-menu, custom 4 4 Requires at least: 3.5 5 Stable tag: 0.2 5 Stable tag: 0.2.5 6 6 Tested up to: 4.3 7 7 License: GPLv2 … … 23 23 24 24 == Changelog == 25 26 = 0.2.5 = 27 * Add - You can force the use of the Walker 28 * Fix - Empty button when switch 0.1.1 to 0.2 and superior version. 29 * Fix - Using on and not live 25 30 26 31 = 0.2 = … … 45 50 2. Activate the plugin 46 51 3. See the new field in the menu item in Appareance -> Menu 52 4. Use cfm_walker walker in your wp_nav function or force-it in the plugin menu. 47 53 48 That's it !54 That's it ! 49 55 50 56 == Frequently Asked Questions ==
Note: See TracChangeset
for help on using the changeset viewer.