コード例 #1
0
ファイル: class-cc-stats.php プロジェクト: careshub/cc-stats
 /**
  * Return an instance of this class.
  *
  * @since     1.0.0
  *
  * @return    object    A single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
 /**
  * Initialize the plugin by loading admin scripts & styles and adding a
  * settings page and menu.
  *
  * @since     1.0.0
  */
 private function __construct()
 {
     $plugin = CC_Stats::get_instance();
     $this->plugin_slug = $plugin->get_plugin_slug();
     // Load admin style sheet and JavaScript.
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_styles'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
     // Add the options page and menu item.
     add_action('admin_menu', array($this, 'add_plugin_admin_menu'));
     // Add an action link pointing to the options page.
     $plugin_basename = plugin_basename(plugin_dir_path(__DIR__) . $this->plugin_slug . '.php');
     // add_filter( 'plugin_action_links_' . $plugin_basename, array( $this, 'add_action_links' ) );
     // Check for requests that stats be run.
     add_action('admin_init', array($this, 'maybe_run_stats'));
     // Add error notices if needed.
     add_action('admin_init', array($this, 'maybe_add_admin_notice'));
 }
コード例 #3
0
ファイル: admin.php プロジェクト: careshub/cc-stats
/**
 * Represents the view for the administration dashboard.
 *
 * This includes the header, options, and other information that should provide
 * The User Interface to the end user.
 *
 * @package   CC Stats
 * @author    Your Name <*****@*****.**>
 * @license   GPL-2.0+
 * @link      http://example.com
 * @copyright 2014 Your Name or Company Name
 */
global $wpdb;
$bp = buddypress();
$cc_stats = CC_Stats::get_instance();
$plugin_slug = $cc_stats->get_plugin_slug();
$current_user_id = get_current_user_id();
?>

<div class="wrap">

	<h2><?php 
echo esc_html(get_admin_page_title());
?>
</h2>

	<section>
		<h3>Hub Stats</h3>
		<ul>
			<li>