dimanche 1 mars 2015

trying to update Category Chained Selects but failing


I'm using Wordpress 4.1.1 and am trying to update an old plugin: Category Chained Selects.


I've placed the two files (php and js) in http://ift.tt/1E7oEDh I have made a couple of small modifications from the original.


The instructions for using this plugin are on this site


This is the code I placed in the page template:



chainselect_getcategories( 'location', 3, array('Select Continent', 'Select Country', 'Select State/Province'), array('Select Continent', 'Select Country', 'Select State/Province'), 'Submit', '', 0 );


The first argument "location" is a custom hierarchical taxonomy with 3 levels.


When the page is first loaded, the first dropdown is correctly populated. The second and third are greyed-out as they should be.


image 1


If I select a continent, the second field almost disappears and remains empty although there are terms to display.


image 2


According to reviews, this plugin used to work very well but not with the most recent version of WP.


I went through all the WP functions and checked them against the codex. I can't see a problem. The PHP looks OK to me but I'm far from being an expert. And the JS seems OK to me.


I did a var_dump() in the template file right after the line that calls chainselect_getcategories and it's empty. I don't know where else I can use the var_dump().


Firebug console does not give any JS errors.


I've tried comparing this code to other examples I've found, but as inexperienced as I am, I can't make heads or tales of it.


Is there anyone who can give me a hand? I'd appreciate it so much!





Aucun commentaire:

Enregistrer un commentaire