Changeset 2068200
- Timestamp:
- 04/13/2019 09:48:37 AM (7 years ago)
- Location:
- wp-admin-bar-control/trunk
- Files:
-
- 3 edited
-
includes/admin.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
-
wp-admin-bar-control.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-admin-bar-control/trunk/includes/admin.php
r2068184 r2068200 15 15 // delete_option('yabp'); 16 16 //prr(get_option('yabp')); 17 $yabp_old = array( 18 'hideBar' => 'no' 19 ,'hideBarWPAdmin' => '' 20 ,'remove' => array() 21 ,'barColor' => '#23282d' 22 ,'style' => 'inline' 23 ,'hidePlugins' => array( 24 'yabp' => 'yabp' 25 ) 26 ,'custom' => '' 27 ); 28 //update_option( 'yabp', $yabp_old ); 29 17 30 $yabp_default = array( 18 31 'type' => 'global' … … 33 46 ,'hide' => 0 34 47 ,'css' => '' 48 ,'ver' => YABP_VER 35 49 ); 36 50 if( !get_option('yabp') || !isset($_POST['from']) && isset($_POST['reset']) ) update_option( 'yabp', $yabp_default ); 51 // /* After update */ 52 $yabp = get_option('yabp'); 53 54 if( !isset($yabp['ver']) || isset($yabp['ver']) && $yabp['ver'] != YABP_VER ){ 55 // $yabp_diff = array_intersect($yabp, $yabp_default); 56 // prr($yabp_diff); 57 // $yabp_merge = array_push($yabp, $yabp_diff); 58 $yabp_merge = array_merge($yabp, $yabp_default); 59 update_option( 'yabp', $yabp_merge ); 60 } 61 37 62 global $yabp_default; 38 $yabp = get_option('yabp');39 //prr($yabp);40 63 41 64 add_action('admin_menu', array($this,'settings_init')); 42 65 add_action('init', array($this,'settings_save')); 43 66 44 if( $yabp['type'] == 'peruser' ){67 if( current_user_can('manage_options') && $yabp['type'] == 'peruser' ){ 45 68 add_action( 'show_user_profile', array($this,'add_custom_userprofile_fields') ); 46 69 add_action( 'edit_user_profile', array($this,'add_custom_userprofile_fields') ); … … 112 135 <input type="hidden" name="action" value="update" /> 113 136 <input type="hidden" name="page_options" value="yabp" /> 137 <input type="hidden" name="ver" value="<?php echo YABP_VER ?>" /> 114 138 <p class="submit"> 115 139 <input type="submit" name="submit" class="button-primary yabpsave" value="<?php _e('Save Changes') ?>" /> … … 782 806 //prr($yabp); 783 807 $current_user = wp_get_current_user(); 784 // if( $ yabp['type'] == 'peruser' )808 // if( $current_user->ID != 0 ) //$yabp['type'] == 'peruser' 785 809 $yabp_meta = get_the_author_meta( 'yabp', $current_user->data->ID ); 786 810 -
wp-admin-bar-control/trunk/readme.txt
r2068184 r2068200 8 8 Requires at least: 3.3 9 9 Tested up to: 5.1.1 10 Stable tag: 0.9. 410 Stable tag: 0.9.5 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
wp-admin-bar-control/trunk/wp-admin-bar-control.php
r2068184 r2068200 3 3 Plugin Name: WP Admin Bar Control 4 4 Description: Style Admin Bar. Add Plugins list to your Admin Bar. Activate and Deactivate plugins without page reload and moving to plugins page. 5 Version: 0.9. 45 Version: 0.9.5 6 6 Author: Alex Egorov 7 7 Author URI: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLHFMF373Z9GG&source=url … … 19 19 define('YABP_PATH', plugin_dir_path(__FILE__) ); 20 20 define('YABP_PREF', $wpdb->base_prefix.'n_' ); 21 define('YABP_VER', '0.1' ); 21 22 22 23 // Async load … … 36 37 37 38 require_once( plugin_dir_path( __FILE__ ) . '/includes/admin.php' ); 38 $instance = new yabp_Settings; 39 if( is_user_logged_in() ){ 40 $instance = new yabp_Settings; 41 } 39 42 40 43 // include_once 'includes/shortcodes.php';
Note: See TracChangeset
for help on using the changeset viewer.