According to the official Contact Form 7 docs, it is possible to pass a a default value to CF7 from the shortcode, in this way: This works for a simple text field, but I need to pass an array of values to a <select> field and use them as <option>s inside it; I’ve tried to modify a bit this c…
Tag: wordpress
Hide “remove item” and “quantity input” from cart in WooCommerce
On the WooCommerce cart page I want to hide: “remove item” button “quantity input” field For items that will go in the comment of // HIDE REMOVE BUTTON & QUNATITY OF THESE ITEMS in the code below Can someone walk me through how to do that? Answer A first option is to hide these fie…
Check if WooCommerce custom order status exist to execute code
I am creating woocommerce plugin and I have a custom order status “wc-shipped”. I want to execute some plugin options for this custom order status only. Here is my code I want if “wc-shipped” status exist then show these plugin options but I am getting below error. How to fix this ? An…
show category and tags when using register_post_type
So i used register_post_type to add books post_type section. But i want to show category and tags(and more) on the back panel edit.php. I know how to this(adding custom fields) in regular post. …
PHP / WP How to save checkbox status after refresh?
I have a filter that is list of country looped using foreach, I want to be able to save the checkbox’s status when I refresh the page. So for example if Japan is checked, it should stay checked when I …
Woocommerce Product Category taxonomy in Admin Pages
I’m writing a plugin for WordPress using WooCommerce. I need to get the list of WooCommerce Product Categories (taxonomy ‘product_cat’) in the admin page of the plugin (note the emphasis on “…
Add checkout custom fields data to shipping packages for calculations in WooCommerce
I’m creating a plugin that will calculate custom shipping variants with API. I have a jQuery script that calculates postal and fias codes based on an entered address. $(“#billing_address_1”)….
WordPress: Set one password for all users in a role, existing + future signups
A client would like me to make a single password work for all users of a certain role(Attendee). I/they know this is not a smart thing to do security-wise, but it must be done. This role has basically …
Sort by custom meta value doesn’t work in WooCommerce products sort by
I’m trying to add a sorting option for woocommerce products’s list. The goal is to sort products by a meta value with meta key called _rating. For now I generate this meta value with a function …
WP_Query issue when trying to get out of stock products in WooCommerce
I’m using shortcode to display all sold out WooCommerce items on a WordPress page. It works fine, except for throwing an error: I figure that this means array_filter() expects an array, but is given null from the following code in my functions.php: Shortcode: [out_of_stock_products] Here’s the Woo…