Правильно ли я понял, что он ищет по совпадение названия ссылок страниц, если вводишь слово например developer и есть такое слово например на 8 страниц в ссылках то он и выводит на страницу результат, но почему тогда только 5 выводит, а ещё 3 нет?
<img src="<?php echo bfi_thumb($image_array['url'], [ 'width' => 400, 'height' => 300, 'crop' => true ]); ?>" alt="<?php echo esc_attr($image_array['alt']); ?>" /> Отзыв должен записываться в определённый тип записи.
(например, если у нас на странице разных 40 параметров, то при стандартном решении это будет - 40 запросов в базу, нужно максимально сократить данное значение).
foreach(WC()->cart->get_cart() as $cart_item ){
$sale = get_post_meta( $cart_item['product_id'], '_sale_price', true );
if(! isset($sale) ) :
$product_price = get_post_meta( $cart_item['product_id'], 'woo_second_price', true );
$products_total += $product_price * $cart_item['quantity'];
endif:
} function display_exif_fields ( $form_fields, $post ){
$type = get_post_mime_type( $post->ID );
$attachment_path = get_attached_file( $post->ID );
$metadata = wp_read_image_metadata_exif( $attachment_path );
$city = get_post_meta( $post->ID, 'city', true );
$locationname = get_post_meta( $post->ID, 'locationname', true );
$form_fields['city'] = array(
'label' => 'City',
'input' => 'text',
'value' => !empty($city) ? $city : $metadata['city'],
'helps' => '',
);
$form_fields['locationname'] = array(
'label' => 'Location name',
'input' => 'text',
'value' => !empty($locationname) ? $locationname : $metadata['locationname'],
'helps' => '',
);
return $form_fields;
}
add_filter( 'attachment_fields_to_edit', 'display_exif_fields', 10, 2 );
function save_exif_fields( $post, $attachment ) {
$array = [ 'city', 'locationname' ];
foreach ( $array as $one ) {
if ( ! empty( $attachment[ $one ] ) ) {
update_post_meta( $post[ 'ID' ], $one, $attachment[ $one ] );
} else {
delete_post_meta( $post[ 'ID' ], $one );
}
}
return $post;
}
add_filter( 'attachment_fields_to_save', 'save_exif_fields', 10, 2 ); add_action( 'woocommerce_cart_calculate_fees', 'wpp_custom_surcharge' );
function wpp_custom_surcharge() {
global $woocommerce;
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
return;
}
$percentage = 0.15;
$time = date( 'H' );
if ( 11 <= (int) $time && 12 > (int) $time ) :
$surcharge = ( $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total ) * $percentage;
$woocommerce->cart->add_fee( 'Счастливый час', - $surcharge, true, '' );
endif;
}