' . __('Settings','agg-advanced-settings') . '', ); return array_merge( $mylink, $links ); } // Prevent cloning public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'agg-advanced-settings' ) ); } // Prevent unserializing instances of this class public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'agg-advanced-settings' ) ); } // Ensure that only one instance of this class is loaded and can be loaded public static function instance() { if( is_null( self::$_instance ) ) { self::$_instance = new self(); } return self::$_instance; } // Show admin notices public function admin_notice() { global $current_screen; if ( $current_screen->parent_base == 'options-general' ) { echo '

' . __("Missing options? Please send suggestions to",'agg-advanced-settings') . ' ' . __("Plugin Author",'agg-advanced-settings') . '.

'; } } // Font awesome icons CSS public function custom_fa_css() { wp_enqueue_style( 'custom-fa', 'https://use.fontawesome.com/releases/v5.0.6/css/all.css' ); } // Admin CSS public function register_admin_styles() { wp_enqueue_style( 'agg-as-admin' , plugins_url( 'aggregator-advanced-settings/agg-as-admin.css' ) ); } // Dashboard help panel public function custom_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', __('Aggregator Advanced Settings Support','agg-advanced-settings') , array( $this, 'custom_dashboard_help' ) ); } // Dashboard help html public function custom_dashboard_help() { echo '

' . __('Welcome to Aggregator Advanced Settings. Need help? Contact the developer','agg-advanced-settings') . ' ' . __('here','agg-advanced-settings') . '.

'; } // Hide "Powered by WordPress" public function register_plugin_styles() { wp_register_style( 'agg-advanced-settings', plugins_url( 'aggregator-advanced-settings/agg-advanced-settings.css' ) ); wp_enqueue_style( 'agg-advanced-settings' ); } // Hide "Thank you for creating with WordPress" public function remove_footer_admin() { echo ''; } // Remove WordPress version number public function remove_version() { return ''; } // Redirect non-admin users public function no_admin_init() { // Is this the admin interface if ( // Look for the presence of /wp-admin/ in the url stripos($_SERVER['REQUEST_URI'],'/wp-admin') !== false && // Allow calls to async-upload.php stripos($_SERVER['REQUEST_URI'],'async-upload.php') == false && // Allow calls to admin-ajax.php stripos($_SERVER['REQUEST_URI'],'admin-ajax.php') == false ) { // Does the current user fail the required capability level if (!current_user_can('activate_plugins')) { // Send a temporary redirect wp_redirect(get_option('home'),302); } } } // Hide admin bar public function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } } // Show all settings public function show_all_settings() { if (current_user_can('manage_options')) { global $submenu; $permalink = get_site_url() . '/wp-admin/options.php'; $submenu['options-general.php'][] = array( __("All Settings", 'agg-advanced-settings' ), 'manage_options', $permalink); } } // Disable search feature public function filter_query( $query, $error = true ) { if ( is_search() ) { $query->is_search = false; $query->query_vars['s'] = false; $query->query['s'] = false; // to error if ( $error == true ) $query->is_404 = true; } } // Disable search form public function filter_search() { return null; } // Disable search widget public function remove_search_widget() { unregister_widget('WP_Widget_Search'); } // Disable RSS feeds public function disable_feed() { wp_redirect( home_url() ); } // Custom login errors message public function custom_login_errors() { return get_option('agg_custom_errors_message'); } // Set login style public function set_login_stylesheet() { wp_enqueue_style( 'custom-login', wp_get_theme(get_option( 'agg_set_login_style' ))->get_theme_root_uri() . '/' . wp_get_theme(get_option( 'agg_set_login_style' ))->get_stylesheet() . '/style.css' ); } // Show custom logo in login public function custom_login_logo() { if ( has_custom_logo() ) { $image = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ); ?>