WordPress.org

Plugin Directory

Changeset 1767034


Ignore:
Timestamp:
11/15/17 13:37:40 (3 months ago)
Author:
rinkuyadav999
Message:

Check capability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • leverage-browser-caching/trunk/leverage-browser-caching.php

    r1756486 r1767034  
    33 * Plugin Name: Leverage Browser Caching 
    44 * Description: It will fix Leverage Browser Caching issue ( Apache Server Only ). 
    5  * Version:     1.4 
     5 * Version:     1.5 
    66 * Author:      Rinku Yadav 
    77 * Author URI:  http://rinkuyadav.com 
     
    1818    exit; 
    1919} 
     20 
     21// Return if not admin screen. 
     22if ( ! is_admin() ) { 
     23    return; 
     24} 
     25 
     26/** 
     27 * Check capability and run code otherwise just return. 
     28 * @return bool 
     29 */ 
     30function lbrowserc_check_capability() { 
     31    if ( ! current_user_can( 'manage_options' ) ) { 
     32        return; 
     33    } 
     34} 
     35add_action( 'init', 'lbrowserc_check_capability' ); 
    2036 
    2137// Set path to constant. 
Note: See TracChangeset for help on using the changeset viewer.