WordPress.org

Ready to get started?Download WordPress

Forums

Custom Multi Select Grid (3 posts)

  1. Flabadab
    Member
    Posted 2 years ago #

    Good Day,

    I'm trying to create a custom post meta box that allows a user to select multiple boxes/cells in a grid view. My idea is similar to creating a multiselect or checkbox group, but I don't know how to implement all the options.

    array(
    				"name"			=> "grid_options",
    				"title"			=> "Test Grid",
    				"description"	=> 'Select the options from this grid',
    				"type"			=> "grid",
    				"scope"			=>	 array( "post" ),
    				"capability"	=> "edit_post"
    
    			),

    ...customFields function case:

    http://pastebin.com/QRHXrCs5

    This only displays the table as I need it, the <input> code is where I'm having an issue. I can use jQuery to manipulate the value of the input when a user clicks on a table cell and it posts the array, but I don't know how to store that array of selections into the post meta when the post is saved/updated.

    I've thought of using a "checkbox group" but from my understanding, then I have to specify all 1152 options before-hand in the meta-box array, which is definitely not ideal.

    Any idea's on how to accomplish this would be greatly appreciated.

  2. Flabadab
    Member
    Posted 2 years ago #

    Managed to figure it out. For some reason the function I used for saving the functions kept skipping over the checkbox group. I had to specify the checkbox group update_post_meta separately and it now works.

  3. webmediatree
    Member
    Posted 2 years ago #

    is there any new theme of this?

Topic Closed

This topic has been closed to new replies.

About this Topic