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
| <?php | |
| add_filter( 'gform_form_post_get_meta', __NAMESPACE__ . '\\enforce_gravity_forms_anti_spam_honeypot' ); | |
| /** | |
| * Enforce anti-spam honeypot on all Gravity forms. | |
| * | |
| * @param array $form The current form to be filtered. | |
| * | |
| * @return array | |
| */ |
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
| <script> | |
| (function( $ ) { | |
| $( '.et_pb_toggle' ).hover(function() { | |
| $( this ).children( 'h5' ).trigger( 'click' ); | |
| }); | |
| })( jQuery ); | |
| </script> |
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
| <?php | |
| function shortcode_post_object_function() { | |
| ob_start(); | |
| $count = 0; | |
| //Get field | |
| $post_objects = get_field ('post_objects'); | |
| if (!empty($post_objects)) { | |
| foreach ($post_objects as $post_object) { | |
| $id = $post_object->ID; |
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
| /** | |
| * From https://isabelcastillo.com/woocommerce-check-shipping-class | |
| * Check if the cart has product with a certain Shipping Class | |
| * @param string $slug the shipping class slug to check for | |
| * @return bool true if a product with the Shipping Class is found in cart | |
| */ | |
| function cart_has_product_with_shipping_class( $slug ) { | |
| global $woocommerce; | |
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
| <?php | |
| // PHP memory limit for this site | |
| define( 'WP_MEMORY_LIMIT', '128M' ); | |
| define( 'WP_MAX_MEMORY_LIMIT', '256M' ); // Increase admin-side memory limit. | |
| // Database | |
| define( 'WP_ALLOW_REPAIR', true ); // Allow WordPress to automatically repair your database. | |
| define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true ); // Don't make database upgrades on global tables (like users) | |
| // Explicitely setting url |
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
| <?php | |
| if( | |
| strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false && | |
| strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false | |
| ) { | |
| header( 'Cache-Control: max-age=30000, must-revalidate' ); | |
| header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' ); | |
| header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' ); | |
| header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" ); | |
| die; |
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
| <?php | |
| function get_featured_image_func() { | |
| $postid = url_to_postid( $_SERVER['HTTP_REFERER'] ); | |
| $image = get_field('featured_image', $postid); | |
| $image = '<img src="'.$image["url"].'" />'; | |
| return $image; | |
| } | |
| add_shortcode( 'get_featured_image_shortcode', 'get_featured_image_func' ); |
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
| /** | |
| * Rename product data tabs | |
| */ | |
| add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 ); | |
| function woo_rename_tabs( $tabs ) { | |
| $tabs['description']['title'] = __( 'More Information' ); // Rename the description tab | |
| $tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab | |
| $tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab |
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
| /** | |
| * Reorder product data tabs | |
| */ | |
| add_filter( 'woocommerce_product_tabs', 'woo_reorder_tabs', 98 ); | |
| function woo_reorder_tabs( $tabs ) { | |
| $tabs['reviews']['priority'] = 5; // Reviews first | |
| $tabs['description']['priority'] = 10; // Description second | |
| $tabs['additional_information']['priority'] = 15; // Additional information third |
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
| /** | |
| * Customize product data tabs | |
| */ | |
| add_filter( 'woocommerce_product_tabs', 'woo_custom_description_tab', 98 ); | |
| function woo_custom_description_tab( $tabs ) { | |
| $tabs['description']['callback'] = 'woo_custom_description_tab_content'; // Custom description callback | |
| return $tabs; | |
| } |