learndash_safe_redirect( string $location = '', int $status = null, bool $exit = true, string $context = '' )
Utility function to centralize all LearnDash redirect calls.
Description #
Parameters #
- $location
-
(string) (Optional) The URL to redirect the user to.
Default value: ''
- $status
-
(int) (Optional) The HTTP Status to set. Default 302.
Default value: null
- $exit
-
(bool) (Optional) True if the function should exit on successful redirect.
Default value: true
- $context
-
(string) (Optional) Unique string provided by the caller to help filter conditions.
Default value: ''
Return #
(bool) The redirect status. Only if $exit is not true.
Source #
Changelog #
Version | Description |
---|---|
3.2.3 | Introduced. |
Related #
Namespace #
@package #
Uses #
Uses | Description |
---|---|
includes/ld-misc-functions.php: learndash_use_wp_safe_redirect |
Filters to override using the WordPress function wp_safe_redirect(). |
includes/ld-misc-functions.php: learndash_safe_redirect_location |
Filters the redirect location URL. |
includes/ld-misc-functions.php: learndash_safe_redirect_status |
Filters the redirect HTTP status. |
includes/ld-misc-functions.php: learndash_safe_redirect_nocache_header |
Filters the redirect nocache_headers. |
Used By #
Used By | Description |
---|---|
includes/settings/settings-pages/class-ld-settings-page-setup.php: LearnDash_Settings_Page_Setup::activate_connect_stripe () |
Activate Stripe connect. |
includes/payments/ld-login-registration-functions.php: learndash_reset_password_set_user_new_password () |
Set new password for user from reset password process |
includes/admin/class-learndash-admin-action-scheduler.php: Learndash_Admin_Action_Scheduler::add_admin_notice () |
Add an admin notice. |
includes/class-ld-course-wizard.php: LearnDash_Course_Wizard::process_url_action () |
Process the playlist URL |
includes/class-ld-course-wizard.php: LearnDash_Course_Wizard::create_course_action () |
Create the course |
includes/class-ld-course-wizard.php: LearnDash_Course_Wizard::process_url () |
Call the API to process the playlist URL. |
includes/class-ld-setup-wizard.php: LearnDash_Setup_Wizard::redirect_after_activation () |
Redirect to the setup wizard after an activation. |
includes/class-ld-setup-wizard.php: LearnDash_Setup_Wizard::dismiss () |
Dismiss |
includes/class-ld-setup-wizard.php: LearnDash_Setup_Wizard::enable_stripe_connect_and_redirect () |
Enable stripe connect and then redirect to the wizard again. |
includes/settings/settings-sections/settings-sections-payments/class-ld-settings-section-stripe-connect.php: LearnDash_Settings_Section_Stripe_Connect::handle_connection_request () |
Handle connection. |
includes/settings/settings-sections/settings-sections-payments/class-ld-settings-section-stripe-connect.php: LearnDash_Settings_Section_Stripe_Connect::handle_disconnection_request () |
Handle disconnection. |
includes/exam/ld-exam-functions.php: learndash_course_exam_challenge_redirect () |
Redirect the user to the associate challenge exam from the course. |
includes/exam/ld-exam-functions.php: learndash_exam_challenge_view_permission () |
Check user access to Exam posts. |
includes/settings/class-ld-settings-pages-deprecated.php: LearnDash_Settings_Pages_Deprecated::deprecated_settings_page () |
Mark a settings page url as deprecated and inform when it has been used. |
includes/ld-misc-functions.php: learndash_remove_lessons_and_quizzes_page () |
Redirects to the home page if the user lands on archive pages for lesson or quiz post types. |
src/deprecated/LearnDash_PayPal_IPN.php: LearnDash_PayPal_IPN::ipn_exit () |
IPN Processing exit. |
includes/payments/ld-login-registration-functions.php: learndash_user_register_error () |
Handles user registration failure. |
includes/payments/ld-login-registration-functions.php: learndash_authenticate () |
Updates user course data on user login. |
includes/payments/ld-login-registration-functions.php: learndash_login_failed () |
Handles the login fail scenario from WP. |
includes/ld-assignment-uploads.php: learndash_assignment_permissions () |
Manages the permissions to view the assignment. |
includes/ld-assignment-uploads.php: learndash_assignment_process_init () |
Handles the upload, delete, and mark as complete for the assignment. |
includes/ld-assignment-uploads.php: learndash_upload_assignment_init () |
Handles assignment uploads. |
includes/class-ld-translations.php: LearnDash_Translations::download_pot_file () |
Download .pot file |
includes/class-ld-translations.php: LearnDash_Translations::download_po_file () |
Download .po file |
includes/class-ld-addons-updater.php: LearnDash_Addon_Updater::load_repositories_options () |
Load Respository options. |
includes/settings/settings-sections/class-ld-settings-section-support-data-reset.php: LearnDash_Settings_Section_Data_Reset::on_settings_page_load () |
On Settings Page Load |
includes/settings/settings-sections/settings-sections-payments/class-ld-settings-section-paypal.php: LearnDash_Settings_Section_PayPal::load_settings_values () |
Initialize the metabox settings values. |
includes/settings/settings-sections/class-ld-settings-section-custom-labels.php: LearnDash_Settings_Section_Custom_Labels::load_settings_values () |
Initialize the metabox settings values. |
includes/settings/settings-pages/class-ld-settings-page-addons.php: LearnDash_Settings_Page_Addons::load_settings_page () |
Action function called when Add-ons page is loaded. |
includes/settings/settings-pages/class-ld-settings-page-translations.php: LearnDash_Settings_Page_Translations::handle_translation_actions () |
Handle Translation Actions |
includes/quiz/ld-quiz-pro.php: LD_QuizPro::edit_process () |
Routes to the WpProQuiz_Controller_Quiz controller to output the add or edit page for quizzes if not auto saving, post id is set, and the current user has permissions to add or edit quizzes. If there is an available template to load, WordPress redirects to the proper URL. |
includes/quiz/ld-quiz-essays.php: learndash_essay_permissions () |
Manages the permissions for the essay post type. |
includes/course/ld-course-steps-functions.php: learndash_check_course_step () |
Validates the URL requests when nested URL permalinks are used. |
includes/course/ld-course-functions.php: learndash_process_course_join () |
Handles the actions to be made when the user joins a course. |
includes/course/ld-course-user-functions.php: sfwd_lms_access_redirect () |
Redirects a user to the course page if it does not have access. |
includes/course/ld-course-progress.php: learndash_mark_complete_process () |
Processes a request to mark a course complete. |
includes/course/ld-course-progress.php: learndash_get_next_lesson_redirect () |
Redirects the user to next lesson. |
includes/course/ld-course-progress.php: learndash_quiz_redirect () |
Redirects the user after quiz completion. |