Plugin Directory

Changeset 1353748


Ignore:
Timestamp:
02/18/2016 09:19:22 PM (10 years ago)
Author:
nuagelab
Message:

Version 1.1.26:

  • Removed Flipbooks menu for users not having the edit_pages capability.
Location:
ezflippr/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ezflippr/trunk/ezflippr.php

    r1353735 r1353748  
    44* Plugin URI: http://www.nuagelab.com/wordpress-plugins/ezflippr
    55* Description: Adds rich flipbooks made from PDF through ezFlippr.com
    6 * Version: 1.1.25
     6* Version: 1.1.26
    77* Author: NuageLab <wordpress-plugins@nuagelab.com>
    88* Author URI: http://www.nuagelab.com/wordpress-plugins
     
    106106    public function ezflippr_add_menu()
    107107    {
    108         global $submenu;
     108        global $menu, $submenu;
    109109        //unset($submenu['edit.php?post_type=ezflippr_flipbook'][10]); // Removes 'Add New'
    110110        $loc = function_exists('get_locale') ? substr(get_locale(),0,2) : defined(WPLANG) ? WPLANG : 'en';
     
    112112        $loc = ($loc == 'en' ? '' : '/'.$loc);
    113113        $submenu['edit.php?post_type=ezflippr_flipbook'][10][2] = 'https://ezflippr.com'.$loc;
    114        
    115         add_menu_page(__EZFLIPPR_PLUGIN_NAME__, __EZFLIPPR_PLUGIN_NAME__, 'manage_options', __EZFLIPPR_PLUGIN_SLUG__, array($this, 'ezflippr_settings'), __EZFLIPPR_IMAGES__ . 'favicon.png');
     114
     115        if(!current_user_can('edit_pages'))
     116        {
     117            $restricted = array(
     118                __('Flipbooks', __EZFLIPPR_PLUGIN_SLUG__),
     119            );
     120            end ($menu);
     121            while (prev($menu)){
     122                $value = explode(' ',$menu[key($menu)][0]);
     123                if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
     124            }// end while
     125
     126        } else {
     127            add_menu_page(__EZFLIPPR_PLUGIN_NAME__, __EZFLIPPR_PLUGIN_NAME__, 'manage_options', __EZFLIPPR_PLUGIN_SLUG__, array($this, 'ezflippr_settings'), __EZFLIPPR_IMAGES__ . 'favicon.png');
     128        }
    116129    }
    117130
  • ezflippr/trunk/readme.txt

    r1353735 r1353748  
    177177
    178178== Upgrade Notice ==
     179= 1.1.26 =
     180* Removed Flipbooks menu for users not having the edit_pages capability.
     181
    179182= 1.1.25 =
    180183* Fixed bug with installation of flipbooks containing spaces
Note: See TracChangeset for help on using the changeset viewer.