Make WordPress Core

Changeset 28999


Ignore:
Timestamp:
07/04/2014 04:16:46 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Add is_customize_preview(), a conditional function to check if the site is being previewed in the Customizer.

props sammybeats, mattwiebe.
fixes #23509.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme.php

    r28563 r28999  
    19391939    <?php
    19401940}
     1941
     1942/**
     1943 * Whether the site is being previewed in the Customizer.
     1944 *
     1945 * @since 4.0.0
     1946 *
     1947 * @return bool True if the site is being previewed in the Customizer, false otherwise.
     1948 */
     1949function is_customize_preview() {
     1950    global $wp_customize;
     1951
     1952    return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
     1953}
Note: See TracChangeset for help on using the changeset viewer.