Advertisement
verygoodplugins

Untitled

Aug 18th, 2020
1,305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. function sync_course_view() {
  2.  
  3.     if ( ! function_exists( 'wp_fusion' ) ) {
  4.         return;
  5.     }
  6.  
  7.     if ( ! is_user_logged_in() ) {
  8.         return;
  9.     }
  10.  
  11.     global $post;
  12.  
  13.     if ( empty( $post ) ) {
  14.         return;
  15.     }
  16.  
  17.     if ( 'sfwd-courses' !== $post->post_type ) {
  18.         return;
  19.     }
  20.  
  21.     update_user_meta( get_current_user_id(), 'ld_last_course_progressed', $post->post_title );
  22.  
  23. }
  24.  
  25. add_action( 'wp_footer', 'sync_course_view' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement