Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bojan Radonic – WPMU DEV Support

    (@wpmudev-support4)

    Hey there Goharika,

    Hope you’re well today ??

    Unfortunately we currently do not offer a REST/public API.

    However, the plugin has a very flexible WordPress-side API and if you really need a REST API you are definitely able to create one yourself quite fast.

    The current Membership 2 API is documented in the admin page Membership 2 -> Help -> API Docs.

    Our developer provided a basic code-sample for a similar question here: https://www.ads-software.com/support/topic/api-instance

    Hope this helps ??

    Cheers,
    Bojan

    Thread Starter Goharika

    (@goharika)

    Thanks for feedback.
    I am not sure this what am I searching. I have register route with api, for my membership 2 plugin, Here how it looks like
    add_action( ‘init’, ‘add_memberships_to_json_api’, 30 );

    function add_memberships_to_json_api(){

    global $wp_post_types;

    $wp_post_types[‘ms_relationship’]->show_in_rest = true;

    $wp_post_types[‘ms_relationship’]->rest_base = ‘memberships’;

    $wp_post_types[‘ms_relationship’]->rest_controller_class = ‘WP_REST_Posts_Controller’;

    }

    And now get request returns me empty array, what am I doing wrong? I need to get my memberships not empty array.
    Here is the url where I am working on https://lc13754376.on-rev.com/restapi/wp-json/wp/v2/memberships
    I am going to add even ID parts, to get membership by ID, but need help to continue…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Membership 2 and WP API’ is closed to new replies.