WP_Customize_Manager::get_stylesheet PHP Method

get_stylesheet() public method

Retrieve the stylesheet name of the previewed theme.
Since: 3.4.0
public get_stylesheet ( ) : string
return string Stylesheet name.
    public function get_stylesheet()
    {
        return $this->theme()->get_stylesheet();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @ticket 34738
  * @see WP_Customize_Widgets::call_widget_update()
  */
 function test_call_widget_update()
 {
     $widget_number = 2;
     $widget_id = "search-{$widget_number}";
     $setting_id = "widget_search[{$widget_number}]";
     $instance = array('title' => 'Buscar');
     $_POST = wp_slash(array('action' => 'update-widget', 'wp_customize' => 'on', 'nonce' => wp_create_nonce('update-widget'), 'theme' => $this->manager->get_stylesheet(), 'customized' => '{}', 'widget-search' => array(2 => $instance), 'widget-id' => $widget_id, 'id_base' => 'search', 'widget-width' => '250', 'widget-height' => '200', 'widget_number' => strval($widget_number), 'multi_number' => '', 'add_new' => ''));
     $this->do_customize_boot_actions();
     $this->assertArrayNotHasKey($setting_id, $this->manager->unsanitized_post_values());
     $result = $this->manager->widgets->call_widget_update($widget_id);
     $this->assertInternalType('array', $result);
     $this->assertArrayHasKey('instance', $result);
     $this->assertArrayHasKey('form', $result);
     $this->assertEquals($instance, $result['instance']);
     $this->assertContains(sprintf('value="%s"', esc_attr($instance['title'])), $result['form']);
     $post_values = $this->manager->unsanitized_post_values();
     $this->assertArrayHasKey($setting_id, $post_values);
     $post_value = $post_values[$setting_id];
     $this->assertInternalType('array', $post_value);
     $this->assertArrayHasKey('title', $post_value);
     $this->assertArrayHasKey('encoded_serialized_instance', $post_value);
     $this->assertArrayHasKey('instance_hash_key', $post_value);
     $this->assertArrayHasKey('is_widget_customizer_js_value', $post_value);
     $this->assertEquals($post_value, $this->manager->widgets->sanitize_widget_js_instance($instance));
 }
All Usage Examples Of WP_Customize_Manager::get_stylesheet
WP_Customize_Manager