Support » Plugin: WP Custom Fields Search » Custom Taxonomies

Viewing 1 replies (of 1 total)
  • it is actually quite easy to implement it on your one. It required only a few lines of code.

    Step 1: Extend the CategoryJoiner for your custom taxonomy in the ‘extra_search_fields.php’ file

    class CustomTaxonomyJoiner extends CategoryJoiner {
    	function getTaxonomy(){
    		return $this->param('taxonomy','custom-taxonomy');

    Step 2: Locate the getClasses method on the ‘wp-custom-fields-search.php’ and add this to the joiner array

    ....code before......
    function getClasses($type){
    	global $CustomSearchFieldStatic;
    		$CustomSearchFieldStatic['Types'] = array(
    				"PostDataJoiner" =>__( "Post Field",'wp-custom-fields-search'),
    				"CustomFieldJoiner" =>__( "Custom Field",'wp-custom-fields-search'),
    				"CategoryJoiner" =>__( "Category",'wp-custom-fields-search'),
    				"TagJoiner" =>__( "Tag",'wp-custom-fields-search'),
    				"CustomTaxonomyJoiner" =>__( "Custom Taxonomy",'wp-custom-fields-search'),
    				"PostTypeJoiner" =>__( "Post Type",'wp-custom-fields-search'),
    ...code after

    NB: Note that has been added to the array.
    Doing this will add Custom Taxonomy to the Data Types in the Admin. it worked for me and I hope this Helps you.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom Taxonomies’ is closed to new replies.