This is useful if you need to set the start date on a day in the week following a specific date. /** * params *…
Web developer and open source enthusiast
Quick snippets and solutions
This is useful if you need to set the start date on a day in the week following a specific date. /** * params *…
Here is a way to replace the post slug with the post ID in a custom post type permalink structure. Example. Change somedomain.com/some-permalink To somedomain.com/123…
If you have a need to use a global variable in a PHP class this could be useful. In my case, I want to use…
Return an array of countries where key = code and value = name. if(class_exists(’WC_Countries’) { $countries = new WC_Countries(); $countries = $countries->__get(’countries’); print_r($countries); //…
I had a recent issue where a client of mine has a site and the previous developers used a method that justifies the output of…
I have a client that had a requirement to ‘Manually Complete’ WooCommerce subscriptions without having go through the rigmarole of generating a pending renewal request…
When you use add_menu_page(); The 5th argument is a callback for a page. If you set it, it will automatically generate a page using the…
If you have a PHP function that accepts a lot of arguments sometimes it would be easier just to pass those arguments into that function…
Here is a neat function you can call to display notices in the admin panel. function display_admin_notice($class=’updated’, $message) { global $notice; $notice = ‘ ‘.$message.”;…
A couple of times I have been called to investigate a web server, running a PHP application such as WordPress, that is sending spam mail…