PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
plugins
/
admin-site-enhancements
/
classes
<?php namespace ASENHA\Classes; /** * Class for Disable Dashboard Widgets module * * @since 6.9.5 */ class Disable_Dashboard_Widgets { /** * Disable dashboard widgets * * @since 4.2.0 */ public function disable_dashboard_widgets() { global $wp_meta_boxes; // Get list of disabled widgets $options = get_option( ASENHA_SLUG_U, array() ); $disabled_dashboard_widgets = isset( $options['disabled_dashboard_widgets'] ) ? $options['disabled_dashboard_widgets'] : array(); // Store default widgets in extra options. This will be referenced from settings field. $dashboard_widgets = $this->get_dashboard_widgets(); $options_extra = get_option( ASENHA_SLUG_U . '_extra', array() ); $options_extra['dashboard_widgets'] = $dashboard_widgets; update_option( ASENHA_SLUG_U . '_extra', $options_extra, true ); // Disable widgets if ( is_array( $disabled_dashboard_widgets ) || is_object( $disabled_dashboard_widgets ) ) { if ( ! empty( $disabled_dashboard_widgets ) ) { foreach( $disabled_dashboard_widgets as $disabled_widget_id_context_priority => $is_disabled ) { // e.g. dashboard_activity__normal__core => true/false if ( $is_disabled ) { $disabled_widget = explode('__', $disabled_widget_id_context_priority); $widget_id = $disabled_widget[0]; $widget_context = $disabled_widget[1]; $widget_priority = $disabled_widget[2]; // remove_meta_box( $widget_id, get_current_screen()->base, $widget_context ); unset( $wp_meta_boxes['dashboard'][$widget_context][$widget_priority][$widget_id] ); } } } } } /** * Get dashboard widgets * * @since 4.2.0 */ public function get_dashboard_widgets() { global $wp_meta_boxes; $dashboard_widgets = array(); if ( ! isset( $wp_meta_boxes['dashboard'] ) ) { $options_extra = get_option( ASENHA_SLUG_U . '_extra', array() ); if ( ! array_key_exists( 'dashboard_widgets', $options_extra ) ) { require_once ABSPATH . '/wp-admin/includes/dashboard.php'; set_current_screen( 'dashboard' ); wp_dashboard_setup(); } } if ( isset( $wp_meta_boxes['dashboard'] ) ) { foreach( $wp_meta_boxes['dashboard'] as $context => $priorities ) { foreach ( $priorities as $priority => $widgets ) { foreach( $widgets as $widget_id => $data ) { $widget_title = ( isset( $data['title'] ) ) ? wp_strip_all_tags( preg_replace( '/ <span.*span>/im', '', $data['title'] ) ) : 'Undetectable'; $dashboard_widgets[$widget_id] = array( 'id' => $widget_id, 'title' => $widget_title, 'context' => $context, // 'normal' or 'side' 'priority' => $priority, // 'core' ); } } } } $dashboard_widgets = wp_list_sort( $dashboard_widgets, 'title', 'ASC', true ); return $dashboard_widgets; } /** * Maybe remove welcome panel from dashboard * * @since 6.9.10 */ public function maybe_remove_welcome_panel() { $options = get_option( ASENHA_SLUG_U, array() ); $disable_welcome_panel = isset( $options['disable_welcome_panel_in_dashboard'] ) ? $options['disable_welcome_panel_in_dashboard'] : false; if ( $disable_welcome_panel ) { remove_action( 'welcome_panel', 'wp_welcome_panel' ); } } }
[-] class-hide-admin-bar.php
[edit]
[-] class-svg-upload.php
[edit]
[-] class-disable-gutenberg.php
[edit]
[-] class-cleanup-admin-bar.php
[edit]
[-] class-disable-rest-api.php
[edit]
[-] class-multiple-user-roles.php
[edit]
[-] class-disable-updates.php
[edit]
[-] class-image-upload-control.php
[edit]
[-] class-hide-admin-notices.php
[edit]
[-] class-content-duplication.php
[edit]
[-] class-insert-head-body-footer-code.php
[edit]
[-] class-media-replacement.php
[edit]
[-] class-password-protection.php
[edit]
[-] class-heartbeat-control.php
[edit]
[-] class-email-address-obfuscator.php
[edit]
[-] class-settings-sanitization.php
[edit]
[-] class-wp-config-transformer.php
[edit]
[-] class-content-order.php
[edit]
[-] class-custom-css.php
[edit]
[-] class-enhance-list-tables.php
[edit]
[-] class-login-logout-menu.php
[edit]
[-] class-search-engines-visibility.php
[edit]
[-] class-limit-login-attempts.php
[edit]
[-] class-disable-xml-rpc.php
[edit]
[-] class-common-methods.php
[edit]
[-] class-email-delivery.php
[edit]
[-] class-obfuscate-author-slugs.php
[edit]
[-] class-external-permalinks.php
[edit]
[-] class-wider-admin-menu.php
[edit]
[-] class-display-system-summary.php
[edit]
[-] class-admin-menu-organizer.php
[edit]
[-] class-redirect-fourofour.php
[edit]
[-] class-manage-robots-txt.php
[edit]
[-] class-site-identity-on-login-page.php
[edit]
[-] class-avif-upload.php
[edit]
[-] class-disable-comments.php
[edit]
[-] class-manage-ads-appads-txt.php
[edit]
[-] class-various-admin-ui-enhancements.php
[edit]
[-] class-admin-menu-svg-icon-mask.php
[edit]
[-] class-deactivation.php
[edit]
[-] class-activation.php
[edit]
[-] class-view-admin-as-role.php
[edit]
[-] class-maintenance-mode.php
[edit]
[-] class-custom-body-class.php
[edit]
[-] class-disable-dashboard-widgets.php
[edit]
[-] class-login-id-type.php
[edit]
[-] class-image-sizes-panel.php
[edit]
[-] class-redirect-after-login.php
[edit]
[-] class-settings-sections-fields.php
[edit]
[-] class-auto-publish-posts-with-missed-schedule.php
[edit]
[-] class-revisions-control.php
[edit]
[+]
..
[-] class-registration-date-column.php
[edit]
[-] class-disable-embeds.php
[edit]
[-] class-show-custom-taxonomy-filters.php
[edit]
[-] class-custom-nav-menu-items-in-new-tab.php
[edit]
[-] class-disable-feeds.php
[edit]
[-] class-captcha-protection.php
[edit]
[-] class-custom-admin-footer-text.php
[edit]
[-] class-change-login-url.php
[edit]
[-] class-last-login-column.php
[edit]
[-] class-settings-fields-render.php
[edit]
[-] class-disable-smaller-components.php
[edit]
[-] class-disable-author-archives.php
[edit]
[-] class-redirect-after-logout.php
[edit]
[-] class-open-external-links-in-new-tab.php
[edit]