cache_delete example


    public function theme_info( $theme = null ) {
        if ( empty( $theme ) ) {
            if ( ! empty( $this->result['destination_name'] ) ) {
                $theme = $this->result['destination_name'];
            } else {
                return false;
            }
        }

        $theme = wp_get_theme( $theme );
        $theme->cache_delete();

        return $theme;
    }

}

function wp_clean_themes_cache( $clear_update_cache = true ) {
    if ( $clear_update_cache ) {
        delete_site_transient( 'update_themes' );
    }
    search_theme_directories( true );
    foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) {
        $theme->cache_delete();
    }
}

/** * Whether a child theme is in use. * * @since 3.0.0 * * @return bool True if a child theme is in use, false otherwise. */
function is_child_theme() {
    
$message = __( 'Something went wrong.' );
            } else {
                $message = $result['message'];
                unset( $result['message'] );
            }

            return new WP_Error( 'php_error', $message$result );
        }
    }

    if ( $theme instanceof WP_Theme ) {
        $theme->cache_delete();
    }

    return true;
}


/** * Returns a filename of a temporary unique file. * * Please note that the calling function must unlink() this itself. * * The filename is based off the passed parameter or defaults to the current unix timestamp, * while the directory can either be passed as well, or by leaving it blank, default to a writable * temporary directory. * * @since 2.6.0 * * @param string $filename Optional. Filename to base the Unique file off. Default empty. * @param string $dir Optional. Directory to store the file in. Default empty. * @return string A writable filename. */
Home | Imprint | This part of the site doesn't use cookies.