当前位置:网站首页>WordPress get_ Users() returns all users with comparison queries - PHP

WordPress get_ Users() returns all users with comparison queries - PHP

2022-07-04 07:52:00 45MA

I can't seem to figure out why all users will receive this query . Any help , Thank you very much .

function user_main(){    $args = array(        'meta_key'     => 'profilepicture',        'meta_value'   => '3',        'meta_compare' => '='        );    $query = new WP_Query( $args );    $blogusers = get_users( $query );    // Array of WP_User objects.    foreach ( $blogusers as $user ) {        $current_meta = get_user_meta($user->ID, 'profilepicture', true);         write_log($user->ID . ' ' . $current_meta);    }}

Reference plan

You must use meta_query.
You can also try the following operations .

$meta_query = new WP_Meta_Query();$meta_query->parse_query_vars( array(    'meta_key'     => 'profilepicture',    'meta_value'   => '3',    'meta_compare' => '=') );

PHP- How to get the list of member functions of a class ? - php

If I know the name of the class . Is there any way to know the list of member functions of a class ? Reference plan get_class_methods() It's your friend

Exclude categories from the list -Wordpress - php

I am trying to exclude categories from the following list :<?php $categories = get_categories( 'orderby=id&exclude=1,'. getOption('promo-categorie', false) ); foreach( $categories as $category ) :…

WordPress wp_register_script Function did not load script in footer - php

I am trying to load in the footer of the blog before the body is finished Google managed JQuery. This is my in functions.php Functions used in the file .function load_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); // load the Google API copy in …

WordPress: Only one is loaded on the website jquery Script - php

Just about to start one WordPress Website , But notice that it is currently loading two jquery file , One contained in wp-includes in , The other one is from me header.php, Is there a way to make wordpress Load at front end wp-includes? Did a lot of search , And the only mention of this seems to include the following code , But I can't find any documents about it , Any idea ?<?php wp_enqueue_sc…

Wordpress the_permalink Performance and storing values in variables - php

What is the most effective way to make a new topic and create an article view with multiple objects linked to the article ? I am a C# professionals , But in PHP I'm not as good as I expected . Suppose you have :while(have_posts()) <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?>…

原网站

版权声明
本文为[45MA]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141517534625.html