Plugin Directory

Changeset 2068200


Ignore:
Timestamp:
04/13/2019 09:48:37 AM (7 years ago)
Author:
evilex
Message:

Version: 0.9.5

Location:
wp-admin-bar-control/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-admin-bar-control/trunk/includes/admin.php

    r2068184 r2068200  
    1515    // delete_option('yabp');
    1616    //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
    1730    $yabp_default = array(
    1831       'type' => 'global'
     
    3346      ,'hide' => 0
    3447      ,'css' => ''
     48      ,'ver' => YABP_VER
    3549    );
    3650    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
    3762    global $yabp_default;
    38     $yabp = get_option('yabp');
    39     //prr($yabp);
    4063
    4164        add_action('admin_menu', array($this,'settings_init'));
    4265    add_action('init', array($this,'settings_save'));
    4366
    44     if( $yabp['type'] == 'peruser' ){
     67    if( current_user_can('manage_options') && $yabp['type'] == 'peruser' ){
    4568      add_action( 'show_user_profile', array($this,'add_custom_userprofile_fields') );
    4669      add_action( 'edit_user_profile', array($this,'add_custom_userprofile_fields') );
     
    112135        <input type="hidden" name="action" value="update" />
    113136        <input type="hidden" name="page_options" value="yabp" />
     137        <input type="hidden" name="ver" value="<?php echo YABP_VER ?>" />
    114138        <p class="submit">
    115139          <input type="submit" name="submit" class="button-primary yabpsave" value="<?php _e('Save Changes') ?>" />
     
    782806    //prr($yabp);
    783807    $current_user = wp_get_current_user();
    784     // if( $yabp['type'] == 'peruser' )
     808    // if( $current_user->ID != 0 ) //$yabp['type'] == 'peruser'
    785809      $yabp_meta = get_the_author_meta( 'yabp', $current_user->data->ID );
    786810
  • wp-admin-bar-control/trunk/readme.txt

    r2068184 r2068200  
    88Requires at least: 3.3
    99Tested up to: 5.1.1
    10 Stable tag: 0.9.4
     10Stable tag: 0.9.5
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • wp-admin-bar-control/trunk/wp-admin-bar-control.php

    r2068184 r2068200  
    33  Plugin Name: WP Admin Bar Control
    44  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.4
     5    Version: 0.9.5
    66  Author: Alex Egorov
    77    Author URI: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SLHFMF373Z9GG&source=url
     
    1919define('YABP_PATH', plugin_dir_path(__FILE__) );
    2020define('YABP_PREF', $wpdb->base_prefix.'n_' );
     21define('YABP_VER', '0.1' );
    2122
    2223// Async load
     
    3637
    3738require_once( plugin_dir_path( __FILE__ ) . '/includes/admin.php' );
    38 $instance = new yabp_Settings;
     39if( is_user_logged_in() ){
     40  $instance = new yabp_Settings;
     41}
    3942
    4043// include_once 'includes/shortcodes.php';
Note: See TracChangeset for help on using the changeset viewer.