Bypass wp_safe_remote_get()?
This is the fix I found. function turn_off_reject_unsafe_urls($args) { $args[‘reject_unsafe_urls’] = false; return $args; } add_filter( ‘http_request_args’, ‘turn_off_reject_unsafe_urls’);
This is the fix I found. function turn_off_reject_unsafe_urls($args) { $args[‘reject_unsafe_urls’] = false; return $args; } add_filter( ‘http_request_args’, ‘turn_off_reject_unsafe_urls’);
This would work: <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 8, ‘orderby’ => ‘date’, ); $loop = new WP_Query( $args ); if ( $loop->have_posts() ) { $i=1; echo ‘<ul>’; while ( $loop->have_posts() ) : $loop->the_post(); //wc_get_template_part( ‘content’, ‘product’ ); ?> <li class=”col-md-3″> <div class=”gridproduto”> <a href=”https://wordpress.stackexchange.com/questions/266104/<?php the_permalink(); ?>”> <?php global $post, $product; ?> … Read more
You use upload_mimes filter to restrict the image type as : add_filter(‘upload_mimes’,’restict_image_type’); function restict_image_type($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } For upload limit you can set in .htaccess one of the following; LimitRequestBody 1048576 //( 1MB) php_value upload_max_filesize 1M php_value post_max_size 1M
Looking at the code of the function generating the SQL for the term part of queries https://developer.wordpress.org/reference/classes/wp_tax_query/get_sql_for_clause/, it seems like a 0 = 1 is a symptom of bad parameters given in the query, so while you think you are passing the right parameters, apparently you don’t. Only way to move forward is probably to … Read more
Allan, thanks for clarifying the question. You can’t add PHP in the wp-admin menu manager. Instead, here is a way to keep the menu dynamic and managed in wp-admin, while still allowing you to add your PHP at the end: <?php $args = array( ‘menu’ => ‘your-menu-name’, ‘container’ => ”, ‘items_wrap’ => ‘%3$s’ ); ?> … Read more
It turns out to override the default functionality add_action is the correct method. I added the required attribute part of the get_item_data(), which I needed, before I did my additions and this did the trick.
You don’t need to add class to those elements. You can apply CSS style to those elements by using following selectors respectively. .post-type-archive-product ul.products li.product .post-type-archive-product ul.products li img .post-type-archive-product ul.products li .button .post-type-archive-product ul.products li .woocommerce-loop-product__title .post-type-archive-product ul.products li span.woocommerce-Price-amount.amount
Try WC AFOUR, I had a similar requirement where I needed to add name & address fields to the WooCommerce registration form and it did exactly what I needed.
here is product set in display in cart in cart.php $_product = apply_filters( ‘woocommerce_cart_item_product’, $cart_item[‘data’], $cart_item, $cart_item_key ); $product_id = apply_filters( ‘woocommerce_cart_item_product_id’, $cart_item[‘product_id’], $cart_item, $cart_item_key ); $thumbnail = apply_filters( ‘woocommerce_cart_item_thumbnail’, $_product->get_image(), $cart_item, $cart_item_key ); if ( ! $_product->is_visible() ) { echo $thumbnail; } else { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($_product->id), ‘thumbnail’ ); $cartimgsrc=UNAVAILABLEIMG; if($thumb[0]){ $cartimgsrc=$thumb[0]; $product … Read more
So i manage to solve the problem myself after looking little more around, the hook is super poorly named. But it does the trick! It fires after the order is created, so you can manipulate the order as you wish. add_action(‘woocommerce_process_shop_order_meta’, woocommerce_process_shop_order’, 10, 2); function woocommerce_process_shop_order ($post_id, $post) { global $woocommerce; $oOrder = new WC_Order($post_id); … Read more