how to SELECT meta values that are not null?

I founded myself my searching: $sql = $wpdb->prepare( ” SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}comments ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}comments.comment_ID WHERE comment_post_ID = %d AND meta_key = ‘rating’ AND meta_value IS NOT NULL AND meta_value <> ” “, get_the_ID() ); $results = $wpdb->get_results( $sql );

How to search usermeta table

This works: $WhoIsUser = get_users( array( ‘meta_key’ => ‘deviceid’, ‘meta_value’ => ‘45545’ ) ); This returns the whole row for that user from the users table. If you print_r it out like so: echo ‘<pre>’ echo print_r($WhoIsUser, TRUE); echo ‘</pre>’ you get: Array ( [0] => WP_User Object ( [data] => stdClass Object ( [ID] … Read more

Filter multiple dynamic dropdown lists within one form using the Smart Grid-layout extension for Contact Form 7

Try this instead, combine all 3 functions into a single one, add_filter(‘cf7sg_dynamic_dropdown_custom_options’, ‘filter_options’,10,3); function filter_options($options, $field_name, $form_key){ //field ‘dynamic_select-461’ if($form_key == ‘bez-nazvu’ && $field_name == ‘dynamic_select-461’) { $options = array(); //get your terms $terms = get_the_terms( $post->ID , ‘strava’ ); if( ! empty( $terms ) && ! is_wp_error( $term_args ) ) { foreach( $terms as … Read more