mardi 17 mars 2015

apply multiple checkboxes as taxonomies

I've created a website which allows users to upload photos graphs, and put them in albums by assigning taxonomies.


The users select a check box to signal which album they want the photo inserted into.


I want users to be able to insert the same photo into more than one album.


Currently when more than one check box is selected, the photo just goes into the last checked box.



$terms = $_POST['album']; //takes name from 'album' in html

//if checkbox is ticked
if (isset($_POST['album'])) { //Username ='". $_GET['user']."'";
//echo "YES";

$assign_to_album = wp_set_object_terms( $new_post, $terms, 'Albums');

//new dBug($terms);
//new dBug($assign_to_album);
}




Aucun commentaire:

Enregistrer un commentaire