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 | |
| /** | |
| * Bypass the linear progression for courses in LearnDash LMS, | |
| * leveraging the learndash_course_progression_enabled filter. | |
| * | |
| * @param bool $setting. The $setting value in the database. True for Linear Progression, False for Free Form. | |
| * @param int $course_id. The course ID. | |
| * | |
| * @return bool. | |
| */ |
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 | |
| /** | |
| * Change the Great Job! You've completed this %s - Keep it going!" message | |
| * for any custom message of your choice using the learndash_alert_message filter. | |
| * | |
| * @param string $message. The message to be filtered. | |
| * @param string $type. The type of message. | |
| * @param string $icon. The message icon. | |
| * | |
| * @return string $message. The filtered message. |
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 | |
| /* | |
| * Show the Login Form first on the Registration page. | |
| */ | |
| add_action( 'wp_footer', function () { | |
| // Get the LearnDash registration page ID. | |
| $ld_registration_page_id = learndash_registration_page_get_id(); | |
| // Exit if user is already logged in or not on the registration page. |
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 | |
| /** | |
| * Debug LearnDash Quiz Certificates. | |
| * | |
| * Enter the Quiz ID and User ID into the [debug_learndash_quiz_certificate] shortcode. | |
| * If the user has earned the certificate for the quiz, the shortcode will return | |
| * the Certificate Download link. | |
| * | |
| * Clicking the link should open the generated certificate PDF according to the | |
| * certificate settings in the quiz. |
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 | |
| /* | |
| * Turn off Delivery (shipping option) in CheckoutWC's Local Pickup, | |
| * if the WooCommerce cart total is less or equal than 25. | |
| * | |
| * @param bool $disable. Whether to disable Delivery or not. | |
| * @return bool. The filtered value. | |
| */ | |
| add_filter( 'cfw_local_pickup_disable_shipping_option', function( $disable ) { |
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 | |
| /* | |
| * In CheckoutWC's Delivery method, hide the Shipping option completely when at least | |
| * one product in the cart is assigned to a specific category. | |
| * | |
| * @author Obi Juan <hola@obijuan.dev> | |
| * @link https://obijuan.dev | |
| */ | |
| /* |
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 | |
| /* In LearnDash, prevent unenrolled users from reaching | |
| the single course page and redirect them to the Button URL value */ | |
| /* TO DO | |
| * - Add support for groups | |
| * - Add an option in LearnDash settings to turn on/off. | |
| * - Add support for externa URLs as well (Unbounce, Click Funnels, etc). | |
| */ |
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
| <html> | |
| <form method="post"> | |
| <input name="url" size="50" /> | |
| <input name="submit" type="submit" /> | |
| </form> | |
| <?php | |
| // maximum execution time in seconds | |
| set_time_limit (24 * 60 * 60); | |
| if (!isset($_POST['submit'])) 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 | |
| add_action('admin_init', function () { | |
| // Redirect any user trying to access comments page | |
| global $pagenow; | |
| if ($pagenow === 'edit-comments.php') { | |
| wp_redirect(admin_url()); | |
| exit; | |
| } |
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 | |
| /* Redirect user after check out */ | |
| add_action( 'template_redirect', 'jay_custom_redirect_after_purchase' ); | |
| function jay_custom_redirect_after_purchase() { | |
| global $wp; | |
| if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
| wp_redirect( 'http://www.yoururl.com/your-page/' ); | |
| exit; |
NewerOlder