jtsternberg / Shortcode_Button

Tinymce and Quicktag buttons for outputting shortcodes. Built to work with CMB2.
81 stars 7 forks source link

get cmb2 group params into shortcode #10

Closed modemlooper closed 8 years ago

modemlooper commented 8 years ago
jtsternberg commented 8 years ago

This seems sane, but would like to know the scenario where it is desired/necessary.

modemlooper commented 8 years ago

when you have a select and you want to show a group of fields based on select.

jtsternberg commented 8 years ago

Was hoping for some pseudo-code to demonstrate. You mean like: $options = array( 'all', 'this', 'that' ); and selecting 'all' should output: [shortcode this=1 that=1]?

modemlooper commented 8 years ago

Thats a good use case, my use case now is select option then only display this group or fields

jtsternberg commented 8 years ago

(For onlookers) we discussed this a bit more and determined that it's better, in most cases, to use the filter to modify shortcode attributes before they are sent back to JS: https://github.com/jtsternberg/Shortcode_Button/blob/master/shortcode-button.php#L348-L362