Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: customize_changeset_save_data

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2881            *     @type string               $uuid          Changeset UUID.
2882            *     @type string               $title         Requested title for the changeset post.
2883            *     @type string               $status        Requested status for the changeset post.
2884            *     @type string               $date_gmt      Requested date for the changeset post in MySQL format and GMT timezone.
2885            *     @type int|false            $post_id       Post ID for the changeset, or false if it doesn't exist yet.
2886            *     @type array                $previous_data Previous data contained in the changeset.
2887            *     @type WP_Customize_Manager $manager       Manager instance.
2888            * }
2889            */
2890           $data = apply_filters( 'customize_changeset_save_data', $data, $filter_context );
2891
2892           // Switch theme if publishing changes now.
2893           if ( 'publish' === $args['status'] && ! $this->is_theme_active() ) {
2894                // Temporarily stop previewing the theme to allow switch_themes() to operate properly.
2895                $this->stop_previewing_theme();
2896                switch_theme( $this->get_stylesheet() );
2897                update_option( 'theme_switched_via_customizer', true );
2898                $this->start_previewing_theme();
2899           }