How to display data from db in select list [closed]

You’re recreating the select element on every iteration through the loop, and you need to name your current loop assignment variable differently, as you’re overwriting your original. Lastly, you’re also not assigning a value to the options within the loop, so you’re not going to get anything on the form submission, and text isn’t a … Read more

WordPress where clauses in db select

I think you are missing the relation key here. If you want the users to be picked up when both the above meta values are matched, then you should use this as below $users_sent_to_admin = new WP_User_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘pending_approval’, ‘value’ => ‘true’, ‘compare’ => ‘=’), array( … Read more

How to access the WordPress DB from a plugin file

If you plan to share/sell your plugin I strongly suggest don’t load your plugin directly. That because to load WordPress you need to load the bootstrap file, that is /wp-load.php so, you should put in your embed-video.php something like: require ‘/wordpress/path/wp-load.php’; Do you notice the problem here? The /wordpress/path/ part is different for user to … Read more