11/12/2014 at 7:43 pm
#309763
Keymaster
@ Steve
Oh, I see. It works for me because I’m working with my dev version of Connections which fixed two minor bugs with the the code that renders the drop down. Try this instead:
function cn_state_select() {
global $wpdb;
$sql = 'SELECT state FROM ' . CN_ENTRY_ADDRESS_TABLE . ' GROUP BY state';
$result = $wpdb->get_col( $sql );
$keys = array_map( 'urlencode', $result );
$values = array_map( 'esc_attr', $result );
$states = array_combine( $keys, $values );
cnHTML::select( array( 'id' => 'cn-region', 'name' => 'cn-region', 'options' => $states, 'enhanced' => TRUE, 'default' => array( 'Select a State' ) ) );
}
add_action( 'cn_action_list_before-slim-plus', 'cn_state_select', 98 );
function cn_add_submit_button( $atts, $results ) {
cnTemplatePart::submit( array( 'return' => FALSE ) );
}
add_action( 'cn_action_list_before-slim-plus', 'cn_add_submit_button', 99, 2 );
function cn_disable_category_select( $atts ) {
$atts['enable_category_select'] = FALSE;
return $atts;
}
add_filter( 'cn_list_atts-slim-plus', 'cn_disable_category_select', 9 );
That minor tweak that should work in both versions. Let me know.
