WP_Customize_Manager::is_theme_active PHP Метод

is_theme_active() публичный Метод

Checks if the current theme is active.
С версии: 3.4.0
public is_theme_active ( ) : boolean
Результат boolean
    public function is_theme_active()
    {
        return $this->get_stylesheet() == $this->original_stylesheet;
    }

Usage Example

 /**
  * Export data from PHP to JS.
  *
  * @since 4.3.0
  * @access public
  */
 public function export_preview_data()
 {
     // Why not wp_localize_script? Because we're not localizing, and it forces values into strings.
     $exports = array('renderQueryVar' => self::RENDER_QUERY_VAR, 'renderNonceValue' => wp_create_nonce(self::RENDER_AJAX_ACTION), 'renderNoncePostKey' => self::RENDER_NONCE_POST_KEY, 'requestUri' => '/', 'theme' => array('stylesheet' => $this->manager->get_stylesheet(), 'active' => $this->manager->is_theme_active()), 'previewCustomizeNonce' => wp_create_nonce('preview-customize_' . $this->manager->get_stylesheet()), 'navMenuInstanceArgs' => $this->preview_nav_menu_instance_args);
     if (!empty($_SERVER['REQUEST_URI'])) {
         $exports['requestUri'] = esc_url_raw(home_url(wp_unslash($_SERVER['REQUEST_URI'])));
     }
     printf('<script>var _wpCustomizePreviewNavMenusExports = %s;</script>', wp_json_encode($exports));
 }
All Usage Examples Of WP_Customize_Manager::is_theme_active
WP_Customize_Manager