Quick fix to add post_type to search form widget in Elementor
Add post_type|product in attributes of your widget and this code snippet in your functions.php:
Download MP3 from a YouTube video (using the terminal)
Install the necessary tools with Brew. Run the following command: Now, to download and convert to MP3, use the following command in the terminal. Replace the link with your YouTube video link: The terminal will display the download progress. Once completed, you’ll have the MP3 file in your folder, it will remove the video file … Read more
Extract comma separated emails from string
Extract email addresses from string and make sure to get only email address:
What happen when you change pricing on a Woocommerce Subscription plan?
WooCommerce Subscriptions is a popular plugin for creating and managing recurring payment plans for digital or physical products on a WooCommerce store. It allows store owners to offer their customers the convenience of automatic billing and the flexibility to change their subscription plan at any time. However, changing the pricing on a WooCommerce Subscription plan … Read more
WordPress Snippet: Change user’s role by username or email address
Here is a sample PHP code snippet to change the role of multiple users in WordPress based on their username: Replace [username1, username2, …] with the usernames of the users you want to change the role for and [new_role] with the new role you want to assign to the users. If you want to select … Read more
Creating a new sheet using Apps Script
One of the most basic tasks you can perform with Apps Script is creating a new sheet. In this post, we’ll show you how to create a new sheet using Apps Script in Google Sheets. Use the following lines to create a sheet and rename the new sheet created:
Get column index by letter Apps Script
This function is useful if you use a full range from column A.