Changeset 14548 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/profiles.php
- Timestamp:
- 10/09/2025 05:44:02 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-learn/inc/profiles.php
r12130 r14548 19 19 } 20 20 21 add_action( 'sensei_course_status_updated', __NAMESPACE__ . '\add_course_completed_activity', 9, 3); // Before `redirect_to_course_completed_page()`.21 add_action( 'sensei_course_status_updated', __NAMESPACE__ . '\add_course_completed_activity', 9, 5 ); // Before `redirect_to_course_completed_page()`. 22 22 add_action( 'transition_post_status', __NAMESPACE__ . '\maybe_notify_new_published_post', 10, 3 ); 23 23 … … 30 30 */ 31 31 function maybe_notify_new_published_post( $new_status, $old_status, $post ) { 32 if ( 'publish' != $new_status ) {32 if ( 'publish' != $new_status || 'publish' === $old_status ) { 33 33 return; 34 34 } … … 104 104 * Add an activity to a user's profile when they complete a course. 105 105 */ 106 function add_course_completed_activity( string $status, int $user_id, int $course_id ) : void {107 if ( 'complete' !== $status ) {106 function add_course_completed_activity( string $status, int $user_id, int $course_id, int $comment_id, ?string $previous_status ) : void { 107 if ( 'complete' !== $status || 'complete' === $previous_status ) { 108 108 return; 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.