Hot answers tagged

3

Trying to detect when a UI was triggered, is indeed the wrong general approach (unless you want to tie to the UI). A proper one will be to hook on the user_register action. add_action( 'user_register', 'wpse223196_registration_save', 10, 1 ); function wpse223196_registration_save( $user_id ) { add_user_meta($user_id, 'score', 5); }


3

Register a collection post type to represent a single collection. You'll get permalinks and rewrite rules to resolve the requests for free. Insert a new collection post for a user when they create a collection, and save the chosen post IDs as an array in post meta. You can pass that array directly as post__in argument in a WP_Query instance to load the ...


1

If I get it right you are storing this data in user meta. WP_Query would have no remote idea how to retrieve that, since it's only aware of post meta. The two are completely separate and there is no native way to involve one in queries for another. Likely you will have to do this in a two step process: Use get_users() to retrieve IDs for all authors of ...



Only top voted, non community-wiki answers of a minimum length are eligible