WP Custom Fields Search
Custom Taxonomies (2 posts)

  1. krembo99
    Posted 2 years ago #

    This looks like a great plugin !
    I think addding Custom Taxonomies to the mix would make this plugin really complete . would that be a future feature ?


  2. yemikudaisi
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Custom Fields Search
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.