extract serialized array to use for wp-query

You need to unserialize() if its serialized string. In your case from what I understand you store the array in the user_meta so its serialize it when you store it. but it will unserialize it when you use the get_user_meta so you dont need to unserialize() Your code seems fine. $author_in = get_user_meta($current_user->ID, ‘following_users’, true); … Read more

How to remove custom style from source?

This issue has been around at least since 2010. Though you can override the style in other ways, the easiest way (other than avoiding use of the Recent Comments Widget) just to remove it is to add the following code to your functions.php file: add_filter( ‘show_recent_comments_widget_style’, ‘__return_false’, 99 ); see: https://core.trac.wordpress.org/ticket/11928#comment:11 Tested and works.

Get the users that my following users are following

You can use the implode function to concatenate array elements: $get_the_following_users = get_user_meta($current_user->ID, ‘following_users’, true); $meta_qssuery = ”; //initialise to an empty string foreach ( $get_the_following_users as $following_user ) { $following_user = get_user_meta($following_user, ‘following_users’, true); if(!empty($following_user)) { //check if any data was returned $meta_qssuery .= implode(‘, ‘, $following_user).’, ‘; } } echo $meta_qssuery; This will … Read more

Change header on pages displaying taxonomy items

You need to change the code that currently displays that header, so that it doesn’t display the default title when it’s on this taxonomy. You can detect if you are on a taxonomy page with the is_tax() function, and then you could do something like this: $term_array = get_term_by( ‘slug’, get_query_var( ‘term’ ), ‘materia’ ); … Read more

Cannot access $wpdb, comes back NULL

As stated in the Comments, do not access a plugin file directly. Instead, use other means that incorporate the REST API or the included Ajax functionality in WordPress. To learn how to use Ajax in your Plugin, have a look here: Ajax in Plugins

WordPress meta_query >= &

Looks like I found the solution. I needed to use compare instead of operator in the meta_query so array( ‘key’ => ‘vacancy_small_salary’, ‘value’ => $vacancy_small_salary, ‘operator’ => ‘>=’, ‘type’ => ‘NUMERIC’ ), becomes array( ‘key’ => ‘vacancy_small_salary’, ‘value’ => $vacancy_small_salary, ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’ ), and the same for the other query