当前位置: 首页>>代码示例>>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;未经允许,请勿转载。