Browse: Home / Functions /


learndash_safe_redirect( string $location = '',  int $status = null,  bool $exit = true,  string $context = '' )

Utility function to centralize all LearnDash redirect calls.

Description #

Parameters #


(string) (Optional) The URL to redirect the user to.

Default value: ''


(int) (Optional) The HTTP Status to set. Default 302.

Default value: null


(bool) (Optional) True if the function should exit on successful redirect.

Default value: true


(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 #

File: includes/ld-misc-functions.php

Changelog #

Version Description
3.2.3 Introduced.