apply_filters( 'learndash_next_step_id', int $learndash_next_step_id, int $course_step_post, int $course_id, int $user_id )
Filters to override next step post ID.
Description #
This filter is not applied in the LD30 Modern mode. If you want to override the next step post ID in LD30 Modern mode, use the learndash_model_{$post_type_key}_next_step filter instead.
Parameters #
- $learndash_next_step_id
-
(int) The next step post ID.
- $course_step_post
-
(int) The current step WP_Post ID.
- $course_id
-
(int) The current Course ID.
- $user_id
-
(int) The current User ID.
Return #
(int) $learndash_next_step_id
Source #
Examples #
Note: Extended code example below not guaranteed, you may need to consult with a developer
<?php
/**
* Example usage for learndash_next_step_id filter.
*/
add_filter(
'learndash_next_step_id',
function( $learndash_next_step_id, $course_step_post, $course_id, $user_id ) {
// May add any custom logic using $learndash_next_step_id, $course_step_post, $course_id, $user_id.
// Always return $learndash_next_step_id.
return $learndash_next_step_id;
},
10,
4
);
Changelog #
| Version | Description |
|---|---|
| 3.1.2 | Introduced. |