/** * Initialize the plugin by loading admin scripts & styles and adding a * settings page and menu. * * @since 1.0.0 */ private function __construct() { $plugin = Vubpay::get_instance(); $this->plugin_slug = $plugin->get_plugin_slug(); add_action('admin_menu', array($this, 'add_plugin_admin_menu')); // Add a plugin page action link pointing to the settings page. $plugin_basename = plugin_basename(plugin_dir_path(realpath(dirname(__FILE__))) . $this->plugin_slug . '.php'); add_filter('plugin_action_links_' . $plugin_basename, array($this, 'add_action_links')); // Change listing add_filter('manage_' . $this->plugin_slug . '_posts_columns', array($this, 'listing_head')); add_action('manage_' . $this->plugin_slug . '_posts_custom_column', array($this, 'listing_content'), 10, 2); }
/** * 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; }