Changeset 1250425
- Timestamp:
- 09/21/2015 03:11:15 PM (11 years ago)
- Location:
- custom-field-menu/trunk
- Files:
-
- 3 edited
-
custom-field-menu.php (modified) (6 diffs)
-
edit_custom_walker.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-field-menu/trunk/custom-field-menu.php
r1247419 r1250425 3 3 Plugin Name: Custom Field Menu 4 4 Plugin URL: http://clement-decou.olympe.in 5 Description: Add cu tom fields to menu items6 Version: 0. 1.15 Description: Add custom fields to menu items 6 Version: 0.2 7 7 Author: Clément Décou 8 8 Author URI: http://clement-decou.olympe.in … … 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 11 */ 12 12 require_once(plugin_dir_path( __FILE__ ).'/classes/admin/PluginAdminPage.php'); 13 13 class custom_field_menu { 14 14 … … 21 21 */ 22 22 function __construct() { 23 24 register_activation_hook(__FILE__, array($this, 'cfm_init')); 23 25 24 26 // load the plugin translation files … … 34 36 add_filter( 'wp_edit_nav_menu_walker', array( $this, 'cfm_edit_walker'), 10, 2 ); 35 37 36 add_action('admin_enqueue_scripts', array($this, 'cm_load_media')); 38 add_action('admin_enqueue_scripts', array($this, 'cfm_load_media')); 39 40 add_action('admin_menu', array($this, 'cfm_admin_menu')); 41 add_action('admin_init', array($this, 'cfm_register_settings')); 37 42 38 43 39 44 } // end constructor 45 46 /** 47 * Init the plugin (options etc.) 48 * 49 * @access public 50 * @since 0.2 51 * @return void 52 */ 53 54 function cfm_init(){ 55 PluginAdminPage::defaultOption(); 56 } 40 57 41 58 … … 47 64 * @return void 48 65 */ 49 public function c m_load_media(){66 public function cfm_load_media(){ 50 67 global $pagenow; 51 68 if($pagenow == "nav-menus.php"){ 52 69 wp_enqueue_media(); 53 wp_register_script('cm-admin-js', WP_PLUGIN_URL.'/custom-field-menu/js/cm_script.js', array('jquery')); 54 wp_enqueue_script('cm-admin-js'); 70 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') ); 73 wp_enqueue_script('cfm-admin-js'); 55 74 } 56 75 } … … 110 129 } 111 130 131 /** 132 * Add admin menu 133 * 134 * @access public 135 * @since 0.2 136 * @return void 137 */ 138 function cfm_admin_menu(){ 139 new PluginAdminPage(); 140 } 141 142 /** 143 * Register all settings of the plugin 144 * 145 * @access public 146 * @since 0.2 147 * @return void 148 */ 149 function cfm_register_settings(){ 150 PluginAdminPage::setupOption(); 151 } 152 112 153 } 113 154 -
custom-field-menu/trunk/edit_custom_walker.php
r1247419 r1250425 179 179 <?php _e( 'Url' ); ?><br /> 180 180 <input type="text" id="edit-menu-item-urlimg-<?php echo $item_id; ?>" class="widefat code edit-menu-item-custom" name="menu-item-urlimg[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->urlimg ); ?>" /> 181 <input type="button" class="upload_image_button button button-primary" value=" Choose image">181 <input type="button" class="upload_image_button button button-primary" value="<?php echo get_option('title_box') ?>"> 182 182 </label> 183 183 </p> -
custom-field-menu/trunk/readme.txt
r1247422 r1250425 3 3 Tags: custom field, CMS, menu, types, field, item, item-menu, custom 4 4 Requires at least: 3.5 5 Stable tag: 0.1 .15 Stable tag: 0.1 6 6 Tested up to: 4.3 7 7 License: GPLv2 … … 23 23 24 24 == Changelog == 25 26 = 0.2 = 27 * Add menu for the plugin 28 * For an image field you can change the title of the media box and the text button 29 * Change PHP Structure 25 30 26 31 = 0.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.