wp_suspend_cache_addition example


    public function add( $key$data$group = 'default', $expire = 0 ) {
        if ( wp_suspend_cache_addition() ) {
            return false;
        }

        if ( ! $this->is_valid_key( $key ) ) {
            return false;
        }

        if ( empty( $group ) ) {
            $group = 'default';
        }

        

            $instance = apply_filters( 'widget_display_callback', $instance$this$args );

            if ( false === $instance ) {
                return;
            }

            $was_cache_addition_suspended = wp_suspend_cache_addition();
            if ( $this->is_preview() && ! $was_cache_addition_suspended ) {
                wp_suspend_cache_addition( true );
            }

            $this->widget( $args$instance );

            if ( $this->is_preview() ) {
                wp_suspend_cache_addition( $was_cache_addition_suspended );
            }
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.