preview_theme_ob_filter_callback [ WordPress Function ]
preview_theme_ob_filter_callback ( $matches )
| Access: |
|
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: preview_theme_ob_filter, _preview_theme_template_filter, _preview_theme_stylesheet_filter, preview_theme, _wp_timezone_choice_usort_callback
Manipulates preview theme links in order to control and maintain location.
Callback function for preg_replace_callback() to accept and filter matches.
Source
<?php
function preview_theme_ob_filter_callback( $matches ) {
if ( strpos($matches[4], 'onclick') !== false )
$matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\)\\1#i', '', $matches[4]); //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if its escaped by \ to prevent breaking mid-attribute.
if (
( false !== strpos($matches[3], '/wp-admin/') )
||
( false !== strpos( $matches[3], '://' ) && 0 !== strpos( $matches[3], home_url() ) )
||
( false !== strpos($matches[3], '/feed/') )
||
( false !== strpos($matches[3], '/trackback/') )
)
return $matches[1] . "#$matches[2] onclick=$matches[2]return false;" . $matches[4];
$link = add_query_arg( array( 'preview' => 1, 'template' => $_GET['template'], 'stylesheet' => @$_GET['stylesheet'], 'preview_iframe' => 1 ), $matches[3] );
if ( 0 === strpos($link, 'preview=1') )
$link = "?$link";
return $matches[1] . esc_attr( $link ) . $matches[4];
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/preview theme ob filter callback « WordPress ...
Description. Manipulates preview theme links in order to control and maintain location. Callback function for preg_replace_callback() to accept and filter matches ...
codex.wordpress.org - 常用函数-preview_theme_ob_filter_callback() | WordPress啦!
2009年5月4日 ... 常用函数-preview_theme_ob_filter_callback(). 说明. 处理预览主题链接,以控制并 保持定位。 为preg_replace_callback()回调函数以匹配过滤器。
www.wordpress.la - PHPXRef 0.7 : WordPress : Detail view of theme.php
preview_theme_ob_filter_callback() switch_theme() validate_current_theme() get_theme_mods() get_theme_mod() set_theme_mod() remove_theme_mod() ...
phpxref.ftwr.co.uk - wordpress.vim - Kloppmagic.ca
May 22, 2011... locate_template preview_theme preview_theme_ob_filter preview_theme_ob_filter_callback register_nav_menu register_nav_menus ...
www.kloppmagic.ca