Home › Forums › Legacy Support › 4.0 Bugs & Issues › New updates 4.0 Version
Tagged: New updates 4.0 Version
- This topic has 7 replies, 4 voices, and was last updated 4 years ago by Veronica.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
October 9, 2020 at 11:37 am #317214LSFglobalParticipantThe 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.October 10, 2020 at 2:37 pm #317507Anshuman SahuKeymasterHere 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);
October 15, 2020 at 4:49 am #318405LSFglobalParticipantHi 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. ThanksOctober 17, 2020 at 6:50 am #318993MrVibeKeymasteradd_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_itemOctober 27, 2020 at 9:58 am #321024LSFglobalParticipantThankyou 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.October 29, 2020 at 4:37 am #321533MrVibeKeymasterThis is going to be same for some time. The WPLMS v4 is built as an App.October 29, 2020 at 6:31 am #321560LSFglobalParticipantHI Team, Should i update it or not to 4.095 or not then. Please let me know.October 31, 2020 at 10:51 am #322103VeronicaModeratoryes 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 -
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘New updates 4.0 Version’ is closed to new replies.