• Resolved eranga

    (@eranga)


    Hi,

    I’ve followed the forum and managed to integrate the wp-job-manager plugin listings to provide me an output on the listing as follows. I’ve added additional post type and taxonomy as follows. But I am unable to get the listing data fields and custom fields data into the json response. Could anyone assist me in this?

    Extra taxonomy

    if ( isset( $wp_taxonomies[‘job_listing_category’] ) ) {
    $wp_taxonomies[‘job_listing_category’]->show_in_rest = true;
    $wp_taxonomies[‘job_listing_category’]->rest_base = ‘joblistingcategorys’;
    $wp_taxonomies[‘job_listing_category’]->rest_controller_class = ‘WP_REST_Terms_Controller’;
    }

    Extra post type

    if ( isset( $wp_post_types[‘job_listing’] ) ) {
    $wp_post_types[‘job_listing’]->show_in_rest = true;
    $wp_post_types[‘job_listing’]->rest_base = ‘joblistings’;
    $wp_post_types[‘job_listing’]->rest_controller_class = ‘WP_REST_Posts_Controller’;
    }

    Thank you,
    Eranga

    https://www.ads-software.com/plugins/rest-api/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m looking for the same.

    Thread Starter eranga

    (@eranga)

    Figured it out. This is for any one of you who is looking for the same thing.

    add_action( ‘rest_api_init’, ‘slug_register_starship’ );
    function slug_register_starship() {
    register_rest_field( ‘job_listing’,
    _company_phone‘,
    array(
    ‘get_callback’ => ‘slug_get_starship’,
    ‘update_callback’ => null,
    ‘schema’ => null,
    )
    );
    }

    Instead of _company_phone add whichever the meta field you need to have in the response.

    Happy coding!

    hi eranga,

    I want to create real estate property based custom API. May i know where & how could i start and develop the API’s for mobile application development.

    Thanks for posting this eranga. This is really helpful info. I’m working on something very similar right now with wp job manager.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘rest-api integration with wp-job-manager’ is closed to new replies.