Notice: Trying to get property of non-object in /home/wpcmsnin/snippets.wpcms.ninja/wp-content/plugins/wordpress-seo/frontend/schema/class-schema-utils.php on line 25

Adding Validation to a WordPress Creation Toolkit Field

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...

Color Inverter

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. Color Inverter <?php //...

Create CSV File using PHP

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. Create Downloadable CSV File using PHP // output headers so that the file is...

Custom Gravity Forms Popup Error Message

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

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...