Last active
          October 3, 2016 10:02 
        
      - 
      
- 
        Save max-kk/f6e4dc9bfe1abc9f3bd0bfdbf42cddeb to your computer and use it in GitHub Desktop. 
    Add moderation count + link to admin menu ZIP: https://yadi.sk/d/ZLu5-zRBw7y8r
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| /* | |
| Plugin Name: WP Foto Vote - moderation count + link to admin menu | |
| Plugin URI: http://wp-vote.net/ | |
| Description: Add moderation count + link to admin menu | |
| Author: Maxim Kaminsky | |
| Author URI: http://www.maxim-kaminsky.com/ | |
| Plugin support EMAIL: [email protected] | |
| Version: 0.1 | |
| */ | |
| add_action('admin_bar_menu', 'fv_add_toolbar_moderation_link', 100); | |
| // settings link to wp header admin bar | |
| function fv_add_toolbar_moderation_link($admin_bar) { | |
| if(!current_user_can('edit_pages')) { return; } | |
| $title = __('FV Moderation', 'fv'); | |
| $on_moderation_count = ModelCompetitors::query()->where('status', ST_MODERATION)->find(true); | |
| $on_moderation_count_text = '<span class="on_moderation_count"><span>' . $on_moderation_count . '</span></span>'; | |
| $admin_bar->add_menu( array( | |
| 'id' => 'fv_settings_link', | |
| 'title' => $title . $on_moderation_count_text, | |
| 'href' => admin_url('admin.php?page=fv-moderation'), | |
| 'meta' => array( | |
| 'title' => $title, | |
| ), | |
| )); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment