本文整理汇总了PHP中WP_Customize_Manager::theme方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_Customize_Manager::theme方法的具体用法?PHP WP_Customize_Manager::theme怎么用?PHP WP_Customize_Manager::theme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_Customize_Manager
的用法示例。
在下文中一共展示了WP_Customize_Manager::theme方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function do_customize_boot_actions() {
$_SERVER['REQUEST_METHOD'] = 'POST';
do_action( 'setup_theme' );
$_REQUEST['nonce'] = wp_create_nonce( 'preview-customize_' . $this->manager->theme()->get_stylesheet() );
do_action( 'after_setup_theme' );
do_action( 'init' );
do_action( 'wp_loaded' );
do_action( 'wp', $GLOBALS['wp'] );
}
示例2:
/**
* Set the current user to be an admin, add the preview nonce, and set the query var.
*/
function setup_valid_render_partials_request_environment()
{
wp_set_current_user(self::factory()->user->create(array('role' => 'administrator')));
$_REQUEST['nonce'] = wp_create_nonce('preview-customize_' . $this->wp_customize->theme()->get_stylesheet());
$_POST[WP_Customize_Selective_Refresh::RENDER_QUERY_VAR] = '1';
$this->do_customize_boot_actions();
}
示例3: hooks_theme_customizer_modified
public function hooks_theme_customizer_modified(WP_Customize_Manager $obj)
{
$aal_args = array('action' => 'updated', 'object_type' => 'Theme', 'object_subtype' => $obj->theme()->display('Name'), 'object_id' => 0, 'object_name' => 'Theme Customizer');
if ('customize_preview_init' === current_filter()) {
$aal_args['action'] = 'accessed';
}
aal_insert_log($aal_args);
}
示例4: theme_customizer_modified
/**
* Theme modified
*
* @since 0.1.0
*
* @param WP_Customize_Manager $obj
*/
public function theme_customizer_modified(WP_Customize_Manager $obj)
{
$args = array('object_type' => $this->object_type, 'object_subtype' => $obj->theme()->display('Name'), 'object_name' => esc_html__('Theme Customizer', 'wp-user-activity'), 'object_id' => 0, 'action' => 'customize');
// Accessed the customizer
if ('customize_preview_init' === current_filter()) {
$args['action'] = 'read';
}
wp_insert_user_activity($args);
}