Update a list of product to featured if product have meta value (Mysql not wpquery)

Ok I’v created a admin plugin to do this… If you have better idea 🙂 I’m in Create a admin button to open a csv file of meta_value to compare with existing products. and update products as featured if exist. add_action(‘admin_menu’, ‘featured_button_menu’); function featured_button_menu() { add_menu_page(‘Featured Products Page’, ‘Mise en avant produits’, ‘manage_options’, ‘featured-button-slug’, ‘featured_button_admin_page’); … Read more

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

WP_Query multiple value not working

This is waaaay after the fact, but maybe it’ll help someone else. You’re looking for an IN comparison here – where the value is IN a group of values. Here’s what it’d look like: $args[‘meta_query’][] = [ ‘key’ => ‘antivirus_antivirus_featured_scaning’, ‘value’ => [‘scheduled_scan’,’anti_spyware’,’anti_worm’], ‘compare’ => ‘IN’ ]; Read more about it here: https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters =]

Query custom post type custom meta key

Now i got this code and i works. function get_events( ) { $recurrence_ids = get_post_custom_values( ‘_recurrence_id’ ); $recurrence_id = $recurrence_ids[0]; $the_query_args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘_recurrence_id’, ‘meta_value’ => $recurrence_id ); $the_query = new WP_Query( $the_query_args ); if ( $the_query->have_posts() ) { $output=”<div class=”weitere-termine”>”; while ( $the_query->have_posts() ) { $the_query->the_post(); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)