Add Custom Fields and API Data

Home Forums Legacy Support 4.0 Bugs & Issues Add Custom Fields and API Data

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #338915
    hilmanf
    Spectator
    Hello, I want to add fields to each course, like Course Tag or whatever. What is the best way to make this data appear in the WPLMS API too?
    #339303
    Veronica
    Moderator
    hi exactly in which course API you want the course tags?
    #339340
    hilmanf
    Spectator
    Hi, I'm using ACF plugin to make custom fields, is that a best way to make custom field in WPLMS?? Custom field location in course detail (single course) and also show in card.. What is the best way to make this data appear in the WPLMS API too?
    #339597
    Veronica
    Moderator
    hi please check this tip: https://wplms.io/support/knowledge-base/adding-custom-field-in-course-setting/ and also can you please share a screenshot that where you want to show it
    #340230
    hilmanf
    Spectator
    Hi, I want to make this field show to WPLMS course detail API and course archive..
    #340565
    Veronica
    Moderator
    hi please share screenshots and endpoints in which this detail you want
    #340643
    hilmanf
    Spectator
    This reply has been marked as private.
    #341279
    Anshuman Sahu
    Keymaster
    please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
    add_filter('bp_course_rest_prepare_course',function($response, $data, $request){
    
    	$response->data['tags'] = get_the_terms( $data->ID, 'course-tag' ); 
    	return $response;
    },10,3);
    #341464
    hilmanf
    Spectator
    This reply has been marked as private.
    #341829
    Anshuman Sahu
    Keymaster
    Well you have to change the taxonomy slug here : $response->data['tags'] = get_the_terms( $data->ID, 'course-tag' ); in this line .
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Custom Fields and API Data’ is closed to new replies.