Cron Jobs and WordPress

Occasionally you find the need to have scheduled tasks run in WordPress. Ideally this should be done using WordPress Cron which allows you to tie in with visits to the website as to things being run periodically. The main commands that you will be needing are the...

Custom Gravity Forms Popup Error Message

Here is a sample of code on how to show a custom popup error message. add_filter( ‘gform_validation_message_3’, ‘sw_gf_validation_message’, 10, 2 ); function sw_gf_validation_message( $validation_message ) { add_filter( ‘wp_footer’,...

Customize the Added to Cart Message

So I ran into a request where the client was looking to have a Continue Shopping button after a product got added to the cart.  So in this example I used the wc_add_to_cart_message hook to add a continue shopping button below what normally got output.  You will also...

Customize the Thank You Text on WooCommerce order

If you happen to want to change the text that is shown at the top of the order received or order confirmation page after someone successfully checks out in WooCommerce you can do so by adding a filter to the woocommerce_thankyou_order_received_text hook.  You can put...

Deactivate post after certain date

Here is a little function that upon loading of site checks to see if the date is past the set date for that post id.  If so then it sets that post to draft mode and removes the post from the live site. function deactivate_post_check() { $post_ids =...