コード例 #1
0
 public static function get()
 {
     if (self::$instance === null) {
         self::$instance = new self();
     }
     return self::$instance;
 }
コード例 #2
0
 /**
  * Initialize the plugin
  */
 public function init()
 {
     // Load plugin textdomain
     load_plugin_textdomain('post-connector', false, dirname(plugin_basename(Post_Connector::get_plugin_file())) . '/languages/');
     // Setup autoloader
     require_once self::get_core_dir() . '/classes/class-autoloader.php';
     $autoloader = new SP_Autoloader(self::get_core_dir());
     spl_autoload_register(array($autoloader, 'load'));
     // Filters
     $manager_filter = new SP_Manager_Filter(plugin_dir_path(__FILE__) . 'filters/');
     $manager_filter->load_filters();
     // Hooks
     $manager_hook = new SP_Manager_Hook(plugin_dir_path(__FILE__) . 'hooks/');
     $manager_hook->load_hooks();
     // Shortcodes
     $manager_shortcode = new SP_Manager_Shortcode();
     $manager_shortcode->load_shortcodes();
     // Widgets
     $manager_widget = new SP_Manager_Widget(plugin_dir_path(__FILE__) . 'widgets/');
     $manager_widget->load();
     // Menu init
     SP_Admin_Menu::get();
     // Plugin upgrader
     if (is_admin()) {
         $plugin_updater = new SP_Upgrade_Manager();
         $plugin_updater->check_update();
     }
 }
コード例 #3
0
    /**
     * Output the screen
     */
    public function output_screen()
    {
        ?>
		<div class="wrap">
			<h2>Post Connector - <?php 
        _e('License settings', 'post-connector');
        ?>
</h2>
			<?php 
        settings_errors();
        ?>
			<div class="pc-content">
				<?php 
        $license_manager = new Yoast_Plugin_License_Manager(new SP_Product_Post_Connector());
        $license_manager->show_license_form(false);
        ?>
			</div>
			<?php 
        SP_Admin_Menu::get()->sidebar();
        ?>
		</div>
	<?php 
    }
コード例 #4
0
 public function run()
 {
     SP_Admin_Menu::get()->do_menu();
 }