<?php
if(!isset($_GET['demo'])) return;
/**
* Change theme
*/
add_filter('option_template', function($value){
return 'new_theme';
});
add_filter('option_stylesheet', function($value){
return 'new_theme';
});
continue;
if( empty($value) ) {
delete_post_meta($post_id, $key); // удаляем поле если значение пустое
continue;
}
$_POST['extra'][$val] = @$_POST['extra'][$val];
set_query_var( 'count', $count );
get_template_part( 'content', get_post_format() );
add_filter('the_content', function($content){
// Тут регулярки
return $content;
});
if (have_posts()) : while (have_posts()) : the_post();
$content = get_the_content();
// Тут тоже регулярки))
if (have_posts()) : while (have_posts()) : the_post();
ob_start();
the_content();
$content = ob_get_clean();
// Тут тоже регулярки))
add_filter( 'media_buttons', function($editor_id){
echo '<a href="#" id="custom-media-button" class="button custom-media" data-editor="content" title="Custom button"><span class="custom-icon"></span> Custom button</a>';
}, 20);
<?php wp_footer(); ?>
+function($){
$(document).ready(function(){
$('.external-reference').replaceWith (function (){return'<a href="'+$(this).data('link')+'" title="'+$(this).text()+'">'+$(this).html()+'</a>';});
});
}(jQuery);
if (data.loggedin == true){
document.location.href = ajax_login_object.redirecturl;
}
/* Restore original Post Data
* NB: Because we are using new WP_Query we aren't stomping on the
* original $wp_query and it does not need to be reset with
* wp_reset_query(). We just need to set the post data back up with
* wp_reset_postdata().
*/
wp_reset_postdata();
add_filter('wp_nav_menu', function($nav_menu){
$result = preg_match_all('#<li(?:.*)><a href="[\#]{1}(.*)">(?:.*)</a></li>#', $nav_menu, $matches);
if($result){
foreach($matches[0] as $match){
$link = $match;
$match = str_replace(array('current-menu-item', 'current-category-ancestor'), '', $match);
$nav_menu = str_replace($link, $match, $nav_menu);
}
}
return $nav_menu;
});
add_filter('term_link', function($termlink){
return str_replace('category/', '', $termlink);
});