當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_Customize_Manager::start_previewing_theme方法代碼示例

本文整理匯總了PHP中WP_Customize_Manager::start_previewing_theme方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Customize_Manager::start_previewing_theme方法的具體用法?PHP WP_Customize_Manager::start_previewing_theme怎麽用?PHP WP_Customize_Manager::start_previewing_theme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WP_Customize_Manager的用法示例。


在下文中一共展示了WP_Customize_Manager::start_previewing_theme方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_customize_link

 /**
  * @ticket 30937
  * @covers wp_admin_bar_customize_menu()
  */
 public function test_customize_link()
 {
     global $wp_customize;
     require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
     $uuid = wp_generate_uuid4();
     $this->go_to(home_url("/?customize_changeset_uuid={$uuid}"));
     wp_set_current_user(self::$admin_id);
     $this->factory()->post->create(array('post_type' => 'customize_changeset', 'post_status' => 'auto-draft', 'post_name' => $uuid));
     $wp_customize = new WP_Customize_Manager(array('changeset_uuid' => $uuid));
     $wp_customize->start_previewing_theme();
     set_current_screen('front');
     $wp_admin_bar = $this->get_standard_admin_bar();
     $node = $wp_admin_bar->get_node('customize');
     $this->assertNotEmpty($node);
     $parsed_url = wp_parse_url($node->href);
     $query_params = array();
     wp_parse_str($parsed_url['query'], $query_params);
     $this->assertEquals($uuid, $query_params['changeset_uuid']);
     $this->assertNotContains('changeset_uuid', $query_params['url']);
 }
開發者ID:aaemnnosttv,項目名稱:develop.git.wordpress.org,代碼行數:24,代碼來源:adminbar.php

示例2:

 /**
  * @see WP_Widget::is_preview()
  */
 function test_wp_widget_is_preview()
 {
     global $wp_customize;
     $widget = new WP_Widget('foo', 'Foo');
     $this->assertEmpty($wp_customize);
     $this->assertFalse($widget->is_preview());
     wp_set_current_user($this->factory->user->create(array('role' => 'administrator')));
     require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
     $wp_customize = new WP_Customize_Manager();
     $wp_customize->start_previewing_theme();
     $this->assertTrue($widget->is_preview());
 }
開發者ID:Benrajalu,項目名稱:philRaj,代碼行數:15,代碼來源:widgets.php

示例3: array

 /**
  * @group site_icon
  * @ticket 38377
  */
 function test_customize_preview_wp_site_icon_dirty()
 {
     global $wp_customize;
     wp_set_current_user($this->factory()->user->create(array('role' => 'administrator')));
     require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
     $wp_customize = new WP_Customize_Manager();
     $wp_customize->register_controls();
     $wp_customize->start_previewing_theme();
     $attachment_id = $this->_insert_attachment();
     $wp_customize->set_post_value('site_icon', $attachment_id);
     $wp_customize->get_setting('site_icon')->preview();
     $output = array(sprintf('<link rel="icon" href="%s" sizes="32x32" />', esc_url(wp_get_attachment_image_url($attachment_id, 32))), sprintf('<link rel="icon" href="%s" sizes="192x192" />', esc_url(wp_get_attachment_image_url($attachment_id, 192))), sprintf('<link rel="apple-touch-icon-precomposed" href="%s" />', esc_url(wp_get_attachment_image_url($attachment_id, 180))), sprintf('<meta name="msapplication-TileImage" content="%s" />', esc_url(wp_get_attachment_image_url($attachment_id, 270))), '');
     $output = implode("\n", $output);
     $this->expectOutputString($output);
     wp_site_icon();
 }
開發者ID:aaemnnosttv,項目名稱:develop.git.wordpress.org,代碼行數:20,代碼來源:template.php


注:本文中的WP_Customize_Manager::start_previewing_theme方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。