Polylang auto-translate plugin (with GPT)
Cartflows get cart total discount
For one of my projects I needed the total discount of the items added in Cartflows to my cart so I could show the customer what he/she would save. I created the following function which loops over all the cart items and substracts the “custom price” from the “regular price”. The custom price is an […]
Cartflows get cart total without discount
For one of my projects I needed the original cart total price without the Cartflows product discounts. I created the following function to achieve this:
wp_get_nav_menu_items() current menu item
When displaying a menu in WordPress I sometimes find it pleasant to use the wp_get_nav_menu_items() function. This function returns only an array of menu item objects of the corresponding menu. So it allows you to build your custom menu exactly the way you want, without dealing with WordPress predefined output. However, if you would use the function wp_nav_menu() you benefit […]
Programmatically 301 redirect by url
There are times when you need to remove posts from your website and want to redirect them to another post. You can simply do this by checking the old post’s ID and set a 301 redirect to another post and keep the old post in your database. This basically gives the right result, but with larger projects […]
SQL queries update WordPress URLs
Update site url in wp_options: Update guid: Update all urls in post content: Update all urls in meta fields: