[ Index ]

MailPress 7.0.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-content/add-ons/ -> MailPress_wp_cron.php (source)

   1  <?php
   2  if ( class_exists( 'MailPress' ) && !class_exists( 'MailPress_wp_cron' ) )
   3  {
   4  /*
   5  Plugin Name: MailPress_wp_cron
   6  Plugin URI: http://blog.mailpress.org/tutorials/add-ons/wp_cron/
   7  Description: Wp_cron ( view jobs scheduled using WP api in your browser : Tools menu )
   8  Version: 7.0
   9  */
  10  
  11  // 3.
  12  
  13  /** for admin plugin pages */
  14  define ( 'MailPress_page_wp_cron',     'mailpress_wp_cron' );
  15  
  16  /** for admin plugin urls */
  17  $mp_file = 'tools.php';
  18  define ( 'MailPress_wp_cron',        add_query_arg( 'page', MailPress_page_wp_cron,     $mp_file ) );
  19  
  20  class MailPress_wp_cron
  21  {
  22  	function __construct()
  23      {
  24  // for wp admin
  25          if ( is_admin() )
  26          {
  27          // for role & capabilities
  28              add_filter( 'MailPress_capabilities',         array( __CLASS__, 'capabilities' ), 1, 1 );
  29          // for load admin page
  30              add_filter( 'MailPress_load_admin_page',     array( __CLASS__, 'load_admin_page' ), 10, 1 );
  31          }
  32      }
  33  
  34  ////  Admin  ////
  35  
  36  // for role & capabilities
  37  	public static function capabilities( $capabilities )
  38      {
  39          $capabilities['MailPress_manage_wp_cron'] = array(     'name'    => __( 'Wp_cron', 'MailPress' ),
  40                                              'group'    => 'admin',
  41                                              'menu'    => 99,
  42  
  43                                              'parent'    => 'tools.php',
  44                                              'page_title'=> __( 'MailPress wp_cron', 'MailPress' ),
  45                                              'menu_title'=> __( 'Wp_cron', 'MailPress' ),
  46                                              'page'    => MailPress_page_wp_cron,
  47                                              'func'    => array( 'MP_AdminPage', 'body' )
  48                                       );
  49          return $capabilities;
  50      }
  51  
  52  // for load admin page
  53  	public static function load_admin_page( $hub )
  54      {
  55          $hub[MailPress_page_wp_cron] = 'wp_cron';
  56          return $hub;
  57      }
  58  }
  59  new MailPress_wp_cron();
  60  }


Generated: Mon Jan 28 00:07:10 2019 Cross-referenced by PHPXref 0.7.1