Skip to content
This repository was archived by the owner on Jun 30, 2020. It is now read-only.
This repository was archived by the owner on Jun 30, 2020. It is now read-only.

filtering in custom taxonomy call #6

@denisyilmaz

Description

@denisyilmaz

Plugin is working great, even with categories etc. But I cant get it to work for custom taxonomies:

Example:
http://www.site.com/wp-json/wp/v2/custom-taxonomy?fields=id,name,count

add_action( 'init', 'create_custom_tax', 0);

function create_custom_tax() {
	$labels = array(…);

	$args = array(
		'hierarchical'      => true,
		'labels'            => $labels,
		'show_ui'           => true,
		'show_admin_column' => true,
		'query_var'         => true,
		'rewrite'           => array( 'slug' => 'custom_tax' ),
		'show_in_rest'       => true,
  		'rest_base'          => 'custom-taxonomy',
  		'rest_controller_class' => 'WP_REST_Terms_Controller'
	);

	register_taxonomy( 'custom_tax', array( 'post' ), $args );
}

… just gives the taxonomy result, but no filtering by the fields. Tested in Wordpress 4.7.2
any ideas?
Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions