<!-- это -->
<img src="<?php echo $image; ?>" alt="" />
<!-- заменить на это -->
<img src="<?php echo bfi_thumb( $image, [ 'width' => 400, 'height' => 300 ] ); ?>" alt="" />
/**
* Тут уже прошли все валидации дальше только обертка всего в шаюлон и отправка
*/
add_action( 'wpcf7_before_send_mail', 'my_cf7_change', 100, 1 );
function my_cf7_change( $WPCF7 ) {
// тут объект со всем, что отправляется
$submission = WPCF7_Submission:: get_instance();
if ( $submission ) {
// тут массив с полями
$posted_data = $submission->get_posted_data();
if ( ! empty( $posted_data ) ) {
/**
* тут обрабатываете ваш контент на стороне сервера
*/
$new_val = 'что то делаете';
// устанавливает то , что обработалти
$WPCF7->set_properties( [
'key' => $new_val
]
);
}
}
return $WPCF7;
}
/**
* Fires once an existing post has been updated.
*
* @since 3.0.0
*
* @param int $post_id Post ID.
* @param WP_Post $post_after Post object following the update.
* @param WP_Post $post_before Post object before the update.
*/
do_action( 'post_updated', $post_id, $post_after, $post_before );
foreach( $order->get_items() as $item_id => $item ) :
//$item - это и будет ваш продукт
wp_kses_post($item->get_name());
endforeach;
$category_link_array[] = sprintf( '<div class="col-4 col-sm-2 col-xl-1 mb-4"><a href="%1$s" title=""><img src="/wp-content/themes/freerollpasswords/assets/img/%2$s.png" width="36" height="36" alt="%3$s"><span class="d-block">%4$s</span></a></div>',
get_category_link( $single_cat->term_id ),
$single_cat->slug,
$single_cat->name,
strtoupper( $single_cat->slug )
);
}
$category_link_array[] = sprintf( '<div class="col-4 col-sm-2 col-xl-1 mb-4"><a href="%1$s" title=""><img src="/assets/img/%2$s.png" width="36" height="36" alt="%3$s"><span class="d-block">%3$s</span></a></div>',
get_category_link( $single_cat->term_id ),
$single_cat->slug,
$single_cat->name
);
add_action( 'woocommerce_after_shop_loop_item', 'ruta_custom_product_card_details', 6 );
function ruta_custom_product_card_details() {
global $post;
if ( has_term( [ 'exclusive' ], 'product_cat', $post->ID ) ) {
printf( '<div class="product-card__badges_exclusive">%s</div>', __( 'Exclusive', 'text-domain' ) );
}
}
function wpp_get_post_short() {
if ( empty( $id ) ) {
__return_false();
}
$atts = shortcode_atts( [
'id' => $id
], $atts );
$post = get_post( $atts['id'] );
if ( empty( $post ) ) {
__return_false();
}
$out = "<div class=\"my-post-{$id}\">";
$out .= sprintf( '<h2>%s</h2>', $post->post_title );
$out .= sprintf( '<div>%s</div>', do_shortcode( $post->post_content ) );
$out .= '</div>';
return $out;
}
add_shortcode( 'get_my_post', 'wpp_get_post_short' );
[get_my_post id="5"]
//функция для изменения цен с помощью числа
function wpp_price_plus() {
return 100;
}
add_filter('woocommerce_product_variation_get_regular_price', 'wpp_custom_price', 99, 2 );
add_filter('woocommerce_product_variation_get_price', 'wpp_custom_price', 99, 2 );
function wpp_custom_price( $price, $product ) {
return (float) $price + wpp_price_plus();
}
add_filter('woocommerce_variation_prices_price', 'wpp_custom_variable_price', 99, 3 );
add_filter('woocommerce_variation_prices_regular_price', 'wpp_custom_variable_price', 99, 3 );
function wpp_custom_variable_price( $price, $variation, $product ) {
// Удаление кэшированной цены продукта
wc_delete_product_transients($variation->get_id());
return (float) $price + wpp_price_plus();
}
// Обработка кэширования цен
add_filter( 'woocommerce_get_variation_prices_hash', 'add_price_plus_to_variation_prices_hash', 99, 3 );
function add_price_plus_to_variation_prices_hash( $price_hash, $product, $for_display ) {
$price_hash[] = wpp_price_plus();
return $price_hash;
}
fetch( url, {
method: 'POST',
headers: new Headers({
'Content-Type': 'application/x-www-form-urlencoded',
'Cache-Control': 'no-cache'
}),
credentials: 'same-origin',
body: new URLSearchParams({
action: 'ty_questgo',
}),
}).then(response => response.json())
.then(response => console.log(response))
.catch(err => console.log(err));