the_content
и the_title
function include_tags_in_search( WP_Query $query ): void{
$search_terms = $query->get( 's' );
if ( $query->is_search() ) {
global $the_original_paged;
$the_original_paged = $query->get( 'paged' ) ? $query->get( 'paged' ) : 1;
if ( ! $search_terms ) {
add_action( 'wp', function () use ( $query ) {
$query->set_404();
status_header( 404 );
nocache_headers();
} );
}
$query->set( 'paged', null );
$query->set( 'post_type', array( 'post', 'product' ) );
$query->set( 'posts_per_page', SEARCH_GRID_COUNT_ITEMS );
}
}
add_action( 'pre_get_posts', 'include_tags_in_search' );
function add_posts_by_tags( $posts, WP_Query $query ): array {
if ( $query->is_search() ) {
global $the_original_paged;
remove_filter( 'the_posts', 'add_posts_by_tags' );
$posts_product_cat = new WP_Query( array(
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'product_tag',
'field' => 'name',
'terms' => explode( ' ', esc_attr( $query->get( 's' ) ) )
)
)
) );
$merged = array_unique( array_merge( $posts, $posts_product_cat->get_posts() ), SORT_REGULAR );
$posts = array_slice( $merged, ( SEARCH_GRID_COUNT_ITEMS * ( $the_original_paged - 1 ) ), SEARCH_GRID_COUNT_ITEMS );
$query->found_posts = $posts;
$query->set( 'paged', $the_original_paged );
$query->post_count = count( $posts );
$query->max_num_pages = ceil( count( $merged ) / SEARCH_GRID_COUNT_ITEMS );
unset( $the_original_paged );
return $posts;
}
return $posts;
}
add_filter( 'the_posts', 'add_posts_by_tags', 10, 2 );
add_filter('xmlrpc_enabled', '__return_false');
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
UPDATE wp_options SET option_value = replace(option_value, 'https://vashdomen-1.com', 'https://vashdomen-2.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = REPLACE (post_content, 'https://vashdomen-1.com', 'https://vashdomen-2.com');
UPDATE wp_comments SET comment_content = REPLACE (comment_content, 'https://vashdomen-1.com', 'https://vashdomen-2.com');
UPDATE wp_comments SET comment_author_url = REPLACE (comment_author_url, 'https://vashdomen-1.com', 'https://vashdomen-2.com');
invisible reCAPTCHA позволяет совершать пользователям на сайте какие-либо действия сразу (без ввода капчи). По умолчанию только самые подозрительные действия пользователей не позволят им пройти дальше. В этом случае invisible reCAPTCHA предложит им решить капчу
This plugin effectively works with the Premmerce User Roles plugin that allows you to easily create additional users’ roles directly from the dashboard.
MAJOR FEATURES IN “PREMMERCE WHOLESALE PRICING FOR WOOCOMMERCE”
adding wholesale prices
adding custom prices
/**
* Add 'Unread' post status.
*/
function wpdocs_custom_post_status(){
register_post_status( 'unread', array(
'label' => _x( 'Unread', 'post' ),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop( 'Unread <span class="count">(%s)</span>', 'Unread <span class="count">(%s)</span>' ),
) );
}
add_action( 'init', 'wpdocs_custom_post_status' );