Get all user meta_keys and then group users by matching values

Eventually came to a solution in case anyone needs it: function mb_get_user_meta_values( $mb_user_meta_key ) { if( empty($mb_user_meta_key) ) return; $mb_get_users = get_users( array( ‘meta_key’ => $mb_user_meta_key ) ); $mb_user_meta_values = array(); foreach( $mb_get_users as $mb_user ) { $mb_user_meta_values[] = get_user_meta( $mb_user->ID, $mb_user_meta_key, true ); } $mb_user_meta_values = array_unique( $mb_user_meta_values ); return $mb_user_meta_values; } Then I … Read more

WordPress filter from custom table is not working properly

First of all, you should never build SQL queries like you do – concatenating SQL with raw variables is insecure and it causes SQL Injection vulnerabilities. You should always prepare all queries. As for the main part of question… You use AND operator in your query, so it will retrieve only rows, that will satisfy … Read more

How do I render content from a wp_editor in a plugin setting field?

the_content filter can be used to filter the content after it is retrieved from the database and before it is printed to the screen. The Core filters on the_content are: add_filter( ‘the_content’, ‘wptexturize’ ); add_filter( ‘the_content’, ‘convert_smilies’ ); add_filter( ‘the_content’, ‘convert_chars’ ); add_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘shortcode_unautop’ ); add_filter( ‘the_content’, ‘prepend_attachment’ ); Reference … Read more

Load my Inline js footer area

You can enqueue your script in footer <?php wp_enqueue_script(‘handle’, ‘src’, ‘deps’, ‘ver’, ‘in_footer’); ?> like wp_enqueue_script(‘jquery’,’PATH_SCRIPT’,”,”,true); Setting $in_footer to true I see references here, please have look https://developer.wordpress.org/reference/functions/wp_enqueue_script/