New updates 4.0 Version

Home Forums Legacy Support 4.0 Bugs & Issues New updates 4.0 Version

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #317214
    LSFglobal
    Participant
    The older version of the theme works with page load. so that's why we can able to get post type and we were able to alter content into it. but after the update, we checked and found that the new version of the theme used API calls for the unit content. Our goal: We want to add our own string/content inside the unit content. we already know that we can able to add content via WordPress admin for particular units but we have some dynamic process so we need to able to get the unit title and alter its contents. before the the filter 'add_filter('the_content', 'llms_get_post_content');' was worked. but now due to contents are coming from API call we are not sure how can we do it. Also, new version development guide is not working. can you please also send us a link for it? Please help us as soon as possible. Attached file for your reference. http://prnt.sc/uw3iwn http://prnt.sc/uw3jct Please try to give solution on priority.
    #317507
    Anshuman Sahu
    Keymaster
    Here is how you can add to content : UPDATED CODe:
    
    add_filter( 'bp_course_api_get_user_course_status_item',function($return, $request ){
        $body = json_decode($request->get_body(),true);
        if(!empty($body['token']) && is_numeric($request['course'])){
            
            $user = apply_filters('vibebp_api_get_user_from_token','',$body['token']);
            $user_id = $user->id;
        }
        if(!empty($user_id)){
            //do your thing here and add the content to :
    
            ob_start();
           echo 'your dynamic content';
    
            
              
    
            $cont =  ob_get_clean();
    
            $return['content'] .= $cont;//here the content is appending in api call return 
        }
    
        return $return;
    },10,2);
    
    #318405
    LSFglobal
    Participant
    Hi team, Thanks for providing the code as an example for the content filter. However we tried to put this code to alter/update content of course but unfortunately we do not get any change into it. We are thinking the filter should contain the course data such as course id to alter/update particular course data. It would be great if you help us to get to know how to update particular course data? Does it possible to filter specific course data? Let us know. Thanks
    #318993
    MrVibe
    Keymaster
    add_filter(‘the_content’, ‘llms_get_post_content’); inside your function llms_get_post_content , global $post has the post ID using which you can also capture the course ID. A better alternative is to create a static class capture the course ID at an earlier action : bp_course_api_get_user_course_status_item
    #321024
    LSFglobal
    Participant
    Thankyou so much for the code it worked and my external api work fine now. Just a small question i am running this code in the 4.090 update does the structure will change again in the further updates 4.095 or it will remain the same and i dont need to change the code. Please let me know else i will share my code for external api calling with you, just to ensure that i need not to change it for future updates.And if yes please le me know the aitration in it.
    #321533
    MrVibe
    Keymaster
    This is going to be same for some time. The WPLMS v4 is built as an App.
    #321560
    LSFglobal
    Participant
    HI Team, Should i update it or not to 4.095 or not then. Please let me know.
    #322103
    Veronica
    Moderator
    yes please update to the latest one in version 4 all updates are important as it is related to the functionalities and bug/issue fixes thanks
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘New updates 4.0 Version’ is closed to new replies.