WP_Customize_Manager::get_document_title_template PHP Method

get_document_title_template() public method

Get the template string for the Customizer pane document title.
Since: 4.4.0
public get_document_title_template ( ) : string
return string The template string for the document title.
    public function get_document_title_template()
    {
        if ($this->is_theme_active()) {
            /* translators: %s: document title from the preview */
            $document_title_tmpl = __('Customize: %s');
        } else {
            /* translators: %s: document title from the preview */
            $document_title_tmpl = __('Live Preview: %s');
        }
        $document_title_tmpl = html_entity_decode($document_title_tmpl, ENT_QUOTES, 'UTF-8');
        // Because exported to JS and assigned to document.title.
        return $document_title_tmpl;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test get_document_title_template() method.
  *
  * @see WP_Customize_Manager::get_document_title_template()
  */
 function test_get_document_title_template()
 {
     $tpl = $this->manager->get_document_title_template();
     $this->assertContains('%s', $tpl);
 }
WP_Customize_Manager