Browse: Home / Snippets /

LearnDash Defines


Snippet #

Important: All snippets are provided as-is without support or guarantees. These snippets are provided as guidelines for advanced users looking to customize LearnDash. For any additional help or support with these snippets, we recommend reaching out to a LearnDash Expert.

Should not be changed.

LEARNDASH_VERSION - Defined as the current version. 3.2 etc.

LEARNDASH_SETTINGS_TRIGGER_UPGRADE_VERSION - Trigger version for Data Upgrade admin notice.
LEARNDASH_LMS_TEXT_DOMAIN - Set to 'learndah'. 

LEARNDASH_LMS_PLUGIN_KEY - Defined and set as the plugin directory and main file sfwd-lms/sfwd_lms.php

LEARNDASH_LMS_PLUGIN_DIR - Plugin directory. Includes trailing /
LEARNDASH_LMS_PLUGIN_URL - Plugin URL. Includes trailing /


LEARNDASH_TEMPLATES_DIR - WP_ULOADS + /learndash/trmplates/

LEARNDASH_LMS_DATABASE_PREFIX_SUB - Default is 'learndash_'. Sets the custom database table prefix.
LEARNDASH_PROQUIZ_DATABASE_PREFIX_SUB_DEFAULT - Default is 'wp_'. Sets the default WPProQuiz table prefix.

LEARNDASH_REST_API_ENABLED - Default true. Controls if LD REST API is enabled. This is required on as of LD 3.0.
LEARNDASH_REST_API_DIR - Default is LEARNDASH_LMS_PLUGIN_DIR + /includes/rest-api/ The path to the LearnDash REST library.

LEARNDASH_ACTIVATED - Set when LearnDash is being activated. Only set during that initial activation page load.

Can be changed as needed.
LEARNDASH_DEBUG - Similar to WP_DEBUG and used to enable certain debug output within LD. If WP_DEBUG is set to true this will also be set to true.
LEARNDASH_SCRIPT_DEBUG - Similar to WordPress SCRIPT_DEBUG. If set to true will load the non-minified versions of CSS and JS assets.
LEARNDASH_SCRIPT_VERSION_TOKEN - Used to append to all JS/CSS URLs for uniquness. Default is LEARNDASH_VERSION. If LEARNDASH_DEBUG is set to true the value will be a timestamp which means each page load will have a unique token.

LEARNDASH_TRANSIENTS_DISABLED - Default is false. If set to true will disable use of transient cache.
LEARNDASH_FILTER_PRIORITY_THE_CONTENT - Default 30. Controls to priority of the 'the_content' filter.

LEARNDASH_LESSON_VIDEO - Default true. If support for Video Progression is enabled.

LEARNDASH_COURSE_BUILDER - Default is true. If Course builder is enabled.
LEARNDASH_QUIZ_BUILDER - Default is true. If Quiz builder is enabled. 

LEARNDASH_GUTENBERG - Default is true. If Gutenberg support is enabled.
LEARNDASH_TRANSLATIONS - Default is true. If support for LD Translations is enabled.
LEARNDASH_ADDONS_UPDATER - Default is true. If support for the Add-ons logic is enabled.

LEARNDASH_HTTP_REMOTE_GET_TIMEOUT - Controls timeout for outbound HTTP Get requests. License and update checks for example.
LEARNDASH_HTTP_REMOTE_POST_TIMEOUT - Controls timeout for outbound HTTP Post requests. License and update checks for example.

LEARNDASH_LMS_DEFAULT_QUESTION_POINTS - Controls default Quiz question points. 
LEARNDASH_LMS_DEFAULT_ANSWER_POINTS - Controls default Quiz answer points.

LEARNDASH_LMS_DEFAULT_DATA_UPGRADE_BATCH_SIZE - Data Upgrades number of items to process per request.
LEARNDASH_PROCESS_TIME_PERCENT - Defalt 80. Used by Data upgrade. Controls the amount of processing time percentage per request.
LEARNDASH_PROCESS_TIME_SECONDS -  Default 10. Used by Data upgrade. Controls the amount of processing time per request.

LEARNDASH_LMS_DEFAULT_WIDGET_PER_PAGE - Number of items per page default for widgets.
LEARNDASH_LMS_DEFAULT_CB_INSERT_CHUNK_SIZE - User by Course/Quiz builders when saving changes.

LEARNDASH_ADMIN_CAPABILITY_CHECK - Default 'manage_options'. Used by function learndash_is_admin_user() to check if user is an admin.
LEARNDASH_GROUP_LEADER_CAPABILITY_CHECK - Default 'group_leader'. Used by function learndash_is_group_leader_user() to check if user is a group leader.

LEARNDASH_DEFAULT_THEME - Default 'ld30'. Sets default theme. Used on new installs.
LEARNDASH_LEGACY_THEME - Default 'legacy' Sets legacy theme.  Used on new installs.
LEARNDASH_QUIZ_RESULT_MESSAGE_MAX - Default 15. Used for max number of Quiz Result Messges.
LEARNDASH_ADMIN_POPUP_STYLE - Default 'jQuery-dialog'. Used for TinyMCE shortcodes popup.
LEARNDASH_SELECT2_LIB - Default true. Controls support for select2 JS library in LD Settings.
LEARNDASH_SETTINGS_HEADER_PANEL - Default is true. Support for new header panel in LD 3.0.0

LEARNDASH_SHOW_MARK_INCOMPLETE - Default is false. Controls support for "Mark Incomplete" button.

LEARNDASH_SETTINGS_SECTION_TYPE - Default is 'metabox'. Controls the layout of the various settings pages to group the sections into metaboxes. 

No longer used. But still in the code for legzcy support.

LEARNDASH_LMS_DEFAULT_LAZY_LOAD_PER_PAGE - Number of items to load per request for lazy load. Deprecated.