Front-end update_post_meta with ajax

You should check out this document on WordPress.org: http://codex.wordpress.org/AJAX_in_Plugins It gives you everything you need to create front-facing XHR functionality. Make sure to set a nopriv hook for those who aren’t logged in. http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side Also the JS variable ajaxurl is only set on the backend. You will need to define that yourself on the front-end. … Read more

Custom post metadata not appearing in public API

Try using the rest_api_allowed_public_metadata filter to whitelist the facebook custom field. It will then appear in the response: add_filter( ‘rest_api_allowed_public_metadata’, ‘jeherve_allow_fb_metadata’ ); function jeherve_allow_fb_metadata() { // only run for REST API requests if ( ! defined( ‘REST_API_REQUEST’ ) || ! REST_API_REQUEST ) return $allowed_meta_keys; $allowed_meta_keys[] = ‘facebook’; return $allowed_meta_keys; }

Allow Users to Set Password During Registration

Well, you can create your own login form which I´ve have done also few years ago, but it is easier to do it with a plugin. there are a lot of these plugins, for example: Auto login new user https://wordpress.org/plugins/auto-login-new-user-after-registration/; also you can add social login to your WordPress, this creates an automatic registration on … Read more

Custom Field Multiple Clauses

First, the sample WHERE clause you provide doesn’t make sense. That is not how to write a query that will return “between a range of startDate and endDate”. Secondly… I am basically looking for posts which are between a range of startDate and endDate and should show further posts also. It is not clear what … Read more

Slow meta query with multi meta keys

The problem here is that post meta wasn’t designed for these kinds of searches, that’s why the taxonomy tables exist, else categories and tags would be stored as post meta Post meta is optimised for fetching data when you already know the post ID Taxonomies are optimised for finding posts when you already know the … Read more

How can I sort get_users() by any value (last_name, user defined fields and more)

get_users() does not allow you to directly sort by whatever you like, but there are ways around it. The Codex for get_users() says: orderby – Sort by ‘ID’, ‘login’, ‘nicename’, ’email’, ‘url’, ‘registered’, ‘display_name’, ‘post_count’, ‘include’, or ‘meta_value’ (query must also contain a ‘meta_key’ – see WP_User_Query). meta_value is a very powerful way to go … Read more

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