Thread Starter
paka
(@paka)
Second problem solved.
I found the tables, to select the categories,:-) but this was’nt the reason, why I posted this question.
You find the categories and tell them from tags, with the tables wp_terms and wp_term_taxonomy.
It would be nice, if there is a solution to the first one, because I would prefer a WP function, and this is, why I asked.
Hopefull
Paka
You could hack the multiple selection on there using str_replace
with wp_dropdown_categories
, and could probably do something similar for wp_list_categories
..
$select_cats = wp_dropdown_categories( array( 'echo' => 0 ) );
$select_cats = str_replace( 'id=', 'multiple="multiple" id=', $select_cats );
echo $select_cats;
Thread Starter
paka
(@paka)
Hello Mark / t31os
tank you, this was quick.
It works, the only thing, I had to change from your posted code was, that I had to change the name attribute too, to get an array $_POST[‘cat’] instead of only one value. It has to be name=’cat[]’. But this is only a xhtml detail, the point was, to use str_replace on the return value of wp_dropdown_categories.
The code I use now is this:
$select_cats = wp_dropdown_categories( array( 'echo' => 0 ) );
$select_cats = str_replace( "name='cat' id=", "name='cat[]' multiple='multiple' id=", $select_cats );