preview_theme [ WordPress Function ]
preview_theme ( No parameters )
| Defined at: |
|
Benzer Fonksiyonlar: preview_theme_ob_filter, remove_theme_mod, remove_theme_mods, get_theme, delete_theme
Start preview theme output buffer.
Will only preform task if the user has permissions and template and preview query variables exist.
Source
<?php
function preview_theme() {
if ( ! (isset($_GET['template']) && isset($_GET['preview'])) )
return;
if ( !current_user_can( 'switch_themes' ) )
return;
// Admin Thickbox requests
if ( isset( $_GET['preview_iframe'] ) )
show_admin_bar( false );
$_GET['template'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['template']);
if ( validate_file($_GET['template']) )
return;
add_filter( 'template', '_preview_theme_template_filter' );
if ( isset($_GET['stylesheet']) ) {
$_GET['stylesheet'] = preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']);
if ( validate_file($_GET['stylesheet']) )
return;
add_filter( 'stylesheet', '_preview_theme_stylesheet_filter' );
}
// Prevent theme mods to current theme being used on theme being previewed
add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ), '__return_empty_array' );
ob_start( 'preview_theme_ob_filter' );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Preview Theme Plugin « Ryan Boren
Mar 8, 2005 ... The Preview Theme Plugin allows you to take a quick peek at a theme without having to switch to it via the Presentation manager. By default, if ...
ryan.boren.me - Function Reference/preview theme « WordPress Codex
Description. Start preview theme output buffer. Will only preform task if the user has permissions and 'template' and 'preview' query variables exist. Will add ...
codex.wordpress.org - do_action('setup_theme'); and add_action('setup_theme - WordPress
and add_action('setup_theme', 'preview_theme'); ... I ran into this while tracking down a bug in the preview theme functions. I think I finally figured out why ...
wordpress.org - FanFusion.org - FREE Fansite Hosting
Advertisement. Welcome. Welcome to Milla Jovovich Fan. With a gallery of over 60000 images, we are the largest fan site for Milla Jovovich. We also have a ...
fanfusion.org