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'] ); }
/** * 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(); }
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); }
/** * 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); }