So I ran into a need to validate an email address for a frontend posting of a custom post type using Cozmos Labs WordPress Creation Toolkit. Here is the code that I used to be able to accomplish that. There is some commented out code that allows for you to see what...
I found this nice little function to take a color and give you its inverse color. It is pretty useful to display a color on a background that is opposite so you can ensure it will display correctly without having to know what the color is. <?php // color_inverse...
Came across this nice little bit of code to write a CSV file on the fly using PHP and grabbing the data from a MySQL database. Thank you Stephen Morley for authoring a great little how to. // output headers so that the file is downloaded rather than displayed...
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',...
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...