Skip to content

Instantly share code, notes, and snippets.

@theukedge
Last active December 23, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theukedge/6563876 to your computer and use it in GitHub Desktop.
Save theukedge/6563876 to your computer and use it in GitHub Desktop.
<?php
function chain_select_shortcode( $atts ) {
extract( shortcode_atts( array( 'tax' => 'category', 'level' => 1, 'titles' => array( 'Please select…' ), 'labels' => '', 'btn_text' => 'Submit', 'exclude' => '', 'count' => 1 ), $atts ) );
return chainselect_getcategories( $tax, $level, explode( ', ', $titles ), explode( ', ', $labels ), $btn_text, $exclude, $count );
}
add_shortcode( 'ajax_chain_select', 'chain_select_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment