本文整理匯總了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);
}