/** * Returns and/or create the single instance of this class. * * @return Charitable_Admin * @access public * @since 1.2.0 */ public static function get_instance() { if (is_null(self::$instance)) { self::$instance = new Charitable_Admin(); } return self::$instance; }
add_filter('media_buttons_context', array(Charitable_Admin::get_instance(), 'remove_jquery_ui_styles_nf'), 20); /** * Add action links to the Charitable plugin block. * * @see Charitable_Admin::add_plugin_action_links() */ add_filter('plugin_action_links_' . plugin_basename(charitable()->get_path()), array(Charitable_Admin::get_instance(), 'add_plugin_action_links')); /** * Add a link to the settings page from the Charitable plugin block. * * @see Charitable_Admin::add_plugin_row_meta() */ add_filter('plugin_row_meta', array(Charitable_Admin::get_instance(), 'add_plugin_row_meta'), 10, 2); /** * Export donations. * * @see Charitable_Admin::export_donations() */ add_action('charitable_export_donations', array(Charitable_Admin::get_instance(), 'export_donations')); /** * Add Charitable menu. * * @see Charitable_Admin_Pages::add_menu() */ add_action('admin_menu', array(Charitable_Admin_Pages::get_instance(), 'add_menu'), 5); /** * Redirect to welcome page after install. * * @see Charitable_Admin_Pages::redirect_to_welcome() */ add_action('charitable_install', array(Charitable_Admin_Pages::get_instance(), 'setup_welcome_redirect'), 100);
/** * Checks whether we're in the admin area and if so, loads the admin-only functionality. * * @return void * @access private * @since 1.0.0 */ private function maybe_start_admin() { if (!is_admin()) { return; } require_once $this->get_path('admin') . 'class-charitable-admin.php'; require_once $this->get_path('admin') . 'charitable-admin-hooks.php'; /** * We are registering this object only for backwards compatibility. It * will be removed in or after Charitable 1.3. * * @deprecated */ $this->register_object(Charitable_Admin::get_instance()); }