MPSUM_Admin.php
7 years ago
MPSUM_Admin_Advanced.php
7 years ago
MPSUM_Admin_Advanced_Preview.php
7 years ago
MPSUM_Admin_Ajax.php
7 years ago
MPSUM_Admin_Bar.php
7 years ago
MPSUM_Admin_Core.php
7 years ago
MPSUM_Admin_Dashboard.php
7 years ago
MPSUM_Admin_Help.php
7 years ago
MPSUM_Admin_Logs.php
7 years ago
MPSUM_Admin_Plugins.php
7 years ago
MPSUM_Admin_Screen_Options.php
7 years ago
MPSUM_Admin_Themes.php
7 years ago
MPSUM_Advanced_Premium.php
7 years ago
MPSUM_Check_Plugin_Install_Status.php
7 years ago
MPSUM_Check_Theme_Install_Status.php
7 years ago
MPSUM_Commands.php
7 years ago
MPSUM_Disable_Updates.php
7 years ago
MPSUM_Disable_Updates_All.php
7 years ago
MPSUM_Disable_Updates_Plugins.php
7 years ago
MPSUM_Disable_Updates_Themes.php
7 years ago
MPSUM_Disable_Updates_Translations.php
7 years ago
MPSUM_Disable_Updates_WordPress.php
7 years ago
MPSUM_Exclude_Users.php
7 years ago
MPSUM_Force_Updates.php
7 years ago
MPSUM_List_Table.php
7 years ago
MPSUM_Logs.php
7 years ago
MPSUM_Logs_List_Table.php
7 years ago
MPSUM_Plugins_List_Table.php
7 years ago
MPSUM_Reset_Options.php
7 years ago
MPSUM_Themes_List_Table.php
7 years ago
MPSUM_UpdraftCentral.php
7 years ago
MPSUM_UpdraftCentral_EUM_Commands.php
7 years ago
MPSUM_Utils.php
7 years ago
easy-updates-manager-notices.php
7 years ago
updraft-notices.php
7 years ago
MPSUM_Admin_Themes.php
107 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) die('No direct access.'); |
| 3 | /** |
| 4 | * Controls the themes tab and handles the saving of its options. |
| 5 | * |
| 6 | * @package WordPress |
| 7 | * @since 5.0.0 |
| 8 | */ |
| 9 | class MPSUM_Admin_Themes { |
| 10 | |
| 11 | /** |
| 12 | * Holds the slug to the admin panel page |
| 13 | * |
| 14 | * @since 5.0.0 |
| 15 | * @access private |
| 16 | * @var string $slug |
| 17 | */ |
| 18 | private $slug = ''; |
| 19 | |
| 20 | /** |
| 21 | * Holds the tab name |
| 22 | * |
| 23 | * @since 5.0.0 |
| 24 | * @access private |
| 25 | * @var string $tab |
| 26 | */ |
| 27 | private $tab = 'themes'; |
| 28 | |
| 29 | /** |
| 30 | * Class constructor. |
| 31 | * |
| 32 | * Initialize the class |
| 33 | * |
| 34 | * @since 5.0.0 |
| 35 | * @access public |
| 36 | * |
| 37 | * @param string $slug Slug to the admin panel page |
| 38 | */ |
| 39 | public function __construct( $slug = '' ) { |
| 40 | $this->slug = $slug; |
| 41 | |
| 42 | // Admin Tab Actions |
| 43 | add_action('mpsum_admin_tab_themes', array( $this, 'tab_output' )); |
| 44 | add_filter('mpsum_theme_action_links', array( $this, 'theme_action_links' ), 11, 2); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Determine whether the themes can be updated or not. |
| 49 | * |
| 50 | * Determine whether the themes can be updated or not. |
| 51 | * |
| 52 | * @since 5.0.0 |
| 53 | * |
| 54 | * @return bool True if the themes can be updated, false if not. |
| 55 | */ |
| 56 | public static function can_update_themes() { |
| 57 | $core_options = MPSUM_Updates_Manager::get_options('core'); |
| 58 | if (isset($core_options['all_updates']) && 'off' == $core_options['all_updates']) { |
| 59 | return false; |
| 60 | } |
| 61 | if (isset($core_options['theme_updates']) && 'off' == $core_options['theme_updates']) { |
| 62 | return false; |
| 63 | } |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Output the HTML interface for the themes tab. |
| 69 | * |
| 70 | * Output the HTML interface for the themes tab. |
| 71 | * |
| 72 | * @since 5.0.0 |
| 73 | * @access public |
| 74 | * @see __construct |
| 75 | * @internal Uses the mpsum_admin_tab_themes action |
| 76 | */ |
| 77 | public function tab_output() { |
| 78 | $params = array( |
| 79 | 'can_update' => self::can_update_themes(), |
| 80 | 'slug' => $this->slug, |
| 81 | 'tab' => $this->tab, |
| 82 | 'paged' => '1', |
| 83 | 'view' => 'all' |
| 84 | ); |
| 85 | Easy_Updates_Manager()->include_template('admin-tab-themes.php', false, $params); |
| 86 | } //end tab_output_plugins |
| 87 | |
| 88 | /** |
| 89 | * Outputs the theme action links beneath each theme row. |
| 90 | * |
| 91 | * Outputs the theme action links beneath each theme row. |
| 92 | * |
| 93 | * @since 5.0.0 |
| 94 | * @access public |
| 95 | * @see __construct |
| 96 | * @internal uses mpsum_theme_action_links filter |
| 97 | * |
| 98 | * @param array $settings Array of settings to output. |
| 99 | * @param WP_Theme $theme The theme object to take action on. |
| 100 | * |
| 101 | * @return array Array of settings to output |
| 102 | */ |
| 103 | public function theme_action_links( $settings, $theme ) { |
| 104 | return $settings; |
| 105 | } |
| 106 | } |
| 107 |