Changeset 1772955
- Timestamp:
- 11/22/2017 10:17:21 AM (8 years ago)
- Location:
- widget-pagination/trunk/admin
- Files:
-
- 2 edited
-
class-widget-pagination-admin.php (modified) (3 diffs)
-
partials/widget-pagination-admin-display.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
widget-pagination/trunk/admin/class-widget-pagination-admin.php
r1772382 r1772955 109 109 //wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/widget-pagination-admin.css', array(), $this->version, 'all' ); 110 110 111 // Enqueue only on our plugin page 111 112 if ( 'settings_page_widget-pagination' == get_current_screen() -> id ) { 112 // wp_register_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/widget-pagination-admin.css' );113 // wp_enqueue_style( $this->plugin_name );114 115 // wp_register_style('wgpag-style',116 // plugins_url('/css/admin.css',__FILE__),117 // '', WGPAG_VERSION );118 119 // wp_register_style('colorpicker',120 // plugins_url('/css/jquery.colorpicker.css',__FILE__));121 // wp_enqueue_style( $this->plugin_name );122 123 113 wp_enqueue_style( 'wp-color-picker' ); 124 114 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/widget-pagination-admin.css', array( 'wp-color-picker' ), $this->version, 'all' ); … … 148 138 //wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/widget-pagination-admin.js', array( 'jquery' ), $this->version, false ); 149 139 150 //if ( 'settings_page_widget-pagination' == get_current_screen() -> id ) { 140 // Enqueue only on our plugin page 141 if ( 'settings_page_widget-pagination' == get_current_screen() -> id ) { 151 142 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/widget-pagination-admin.js', array( 'jquery', 'wp-color-picker' ), $this->version, false ); 152 //} //TODO js condition 143 } 144 153 145 } 154 146 … … 213 205 /* 214 206 * Documentation: https://developer.wordpress.org/reference/functions/register_setting/ 215 */ 216 register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate')); 207 * 208 * string $option_group: A settings group name 209 * string $option_name: The name of an option to sanitize and save 210 * array $sanitize_callback 211 */ 212 register_setting( $this->plugin_name, $this->plugin_short, array($this, 'validate') ); 217 213 218 214 } -
widget-pagination/trunk/admin/partials/widget-pagination-admin-display.php
r1772382 r1772955 16 16 <!-- This file should primarily consist of HTML with a little bit of PHP. --> 17 17 18 <?php19 $options_before_v1 = get_option('wgpag_options');20 ?>21 22 18 <div class="wrap" id="wgpag-options"> 23 19 <div class="icon32" id="icon-themes"></div> 24 20 25 <h2> Widget Paginator <?php _e('Settings')?></h2>21 <h2><?php _e('Settings') ?> › <?php echo esc_html(get_admin_page_title()); ?></h2> 26 22 27 23 <p> … … 45 41 //Grab all options 46 42 $options = get_option($this->plugin_short); 47 // print '<pre>' . print_r ($options, true) . '</pre>'; 43 //print 'options: <pre>' . print_r ($options, true) . '</pre>'; 44 45 $options_before_v1 = get_option('wgpag_options'); 46 //print 'old opt: <pre>' . print_r ($options_before_v1, true) . '</pre>'; 48 47 49 48 // Pagination Options (saved or default value) … … 72 71 $style_options_hovItem_fontSz = isset($options['hover_item_style_font_size']) ? $options['hover_item_style_font_size'] : ''; 73 72 74 $pagStyle_options_bgClr = isset($options['pag_style_background_color']) ? $options['pag ination_style_background_color'] : '';73 $pagStyle_options_bgClr = isset($options['pag_style_background_color']) ? $options['pag_style_background_color'] : ''; 75 74 $pagStyle_options_borderClrTop = isset($options['pag_style_border_color_top']) ? $options['pag_style_border_color_top'] : ''; 76 75 $pagStyle_options_borderClrBottom = isset($options['pag_style_border_color_bottom']) ? $options['pag_style_border_color_bottom'] : ''; 77 76 $pagStyle_options_borderClrLeft = isset($options['pag_style_border_color_left']) ? $options['pag_style_border_color_left'] : ''; 78 77 $pagStyle_options_borderClrRight = isset($options['pag_style_border_color_right']) ? $options['pag_style_border_color_right'] : ''; 79 80 81 settings_fields($this->plugin_short);82 do_settings_sections($this->plugin_short);83 78 ?> 84 79 85 <form method="post" action="#"> 80 <form method="post" name="wgpag_options" action="options.php"> 81 <?php 82 settings_fields( $this->plugin_name ); // $option_group: This must match the group name used in register_setting(), which is the page slug name on which the form is to appear. 83 do_settings_sections( $this->plugin_name ); // $page: The slug name of the page whose settings sections you want to output. This should match the page name used in add_settings_section(). 84 ?> 85 86 86 <div class="metabox-holder" style="float:left; margin-right:3%;"> 87 87 <div class="postbox"> … … 487 487 <input type="text" size="7" maxlength="7" class="color-picker" 488 488 id="<?php echo $this->plugin_short . '-hover_item_style_background_color' ?>" 489 name="<?php echo $this->plugin_short . '[hover_item_style_ba xkground_color]' ?>"489 name="<?php echo $this->plugin_short . '[hover_item_style_background_color]' ?>" 490 490 value="<?php echo $style_options_hovItem_bgClr ?>" /> 491 491 <span class="hint">
Note: See TracChangeset
for help on using the changeset viewer.