This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Ajax Add to Cart | |
| jQuery(function($) { | |
| if ($( "body" ).hasClass( "single-product" )) { | |
| $(document).on("click", ".single_add_to_cart_button", function(e) { | |
| var product_button = $(this); | |
| $product_form = $( this ).closest('form.cart'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists('write_log')) { | |
| function write_log ( $log ) { | |
| if ( is_array( $log ) || is_object( $log ) ) { | |
| error_log( print_r( $log, true ) ); | |
| } else { | |
| error_log( $log ); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| location ~ ^/wp-content/uploads/woocommerce_uploads/(.*?)\.zip$ { | |
| rewrite / permanent; | |
| } | |
| location ~ ^/wp-content/uploads/woocommerce_uploads/(.*?)\.wav$ { | |
| rewrite / permanent; | |
| } | |
| location ~ ^/wp-content/uploads/woocommerce_uploads/(.*?)\.mp3$ { | |
| rewrite / permanent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'rest_prepare_post', 'my_custom_json_fields', 12, 3 ); | |
| function my_custom_json_fields( $data, $post, $context ) { | |
| return [ | |
| 'title' => $data->data['title']['rendered'], | |
| 'link' => $data->data['link'], | |
| ]; | |
| } | |
| credit: https://github.com/WP-API/WP-API/issues/446#issuecomment-212443511 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Gravity Forms anchor - disable auto scrolling of forms | |
| add_filter("gform_confirmation_anchor", create_function("","return false;")); | |
| //Gravity Forms anchor - with form ID | |
| add_filter( 'gform_confirmation_anchor_5', '__return_false' ); |