Copy PHP Array to Javascipt Object

I often need to work with data client side that is returned from the server. Found this neat piece of code which I used to get the available mimetypes so I can validate client side that the file the user is attempting to upload is accepted.

Replace Gravity Forms Selects

I had an earlier post about cross browser safe select replacements. This is a function which replaces the gravity forms plugin select drop downs with those cross browser safe drop downs.

CSS styles. You will need to edit to fit your needs.

 

Woocommerce Edit Query

This was my first Woocommerce project and it was rough getting everything working as expected. This bit of code helped me narrow the query results for Woocommerce. Place in functions.php

 

Register Custom Post Types

I was sick of repeating myself when making CPTs. This is a pretty simple function that makes it easier.

Now this is obviously not a “One Size Fits All” Solution but I find it helpful as a starting point.

Query Custom Post Types

Query WordPress for a particular post type.

If you just want an object and not the entire post loop you can also do this.

 

Edit Search Query

Used to edit the search query. In this case we are only allowing the search to query for ticket and client post types.