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 | |
| // Allow the Gravity form to stay on the page when confirmation displays. | |
| add_filter( 'gform_pre_submission_filter', 'dw_show_confirmation_and_form' ); | |
| function dw_show_confirmation_and_form( $form ) { | |
| // Inserts a shortcode for the form without title or description | |
| $shortcode = '[gravityform id="' . $form['id'] . '" title="false" description="false"]'; | |
| // Ensures that new lines are not added to HTML Markup | |
| ob_start(); |
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 | |
| /** | |
| * Adding the payment fragment to the WC order review AJAX response | |
| */ | |
| add_filter( 'woocommerce_update_order_review_fragments', 'my_custom_payment_fragment' ); | |
| /** | |
| * Adding our payment gateways to the fragment #checkout_payments so that this HTML is replaced with the updated one. | |
| */ | |
| function my_custom_payment_fragment( $fragments ) { |
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 | |
| // Paste everything below this line to your child-theme's functions.php file. | |
| // Cancel sanitizing for all shipping option labels starting with 'HTML:'. | |
| remove_filter('woocommerce_shipping_rate_label', 'sanitize_text_field'); | |
| add_filter('woocommerce_shipping_rate_label', function($label) { | |
| if (substr_compare($label, 'HTML:', 0, 5) === 0) { | |
| $label = ltrim(substr($label, 5)); | |
| } |
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
| /** | |
| * Tell PMPro allow weak passwords on the change password and reset password forms. | |
| * Requires PMPro v2.3.3+ | |
| */ | |
| add_filter( 'pmpro_allow_weak_passwords', '__return_true' ); |
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
| //Here we get an array of related LearnDash courses related to a WC_Product | |
| $courses_id = get_post_meta( $product->get_id(), '_related_course',true); |
OlderNewer