New answers tagged

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 ...


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 ...


0

I think you might have to modify the plugin, fork it, if you like the rest of it's functionality. Then add functionality that when you "favourite" a post/image, instead of adding it to your favourites you get a list which collection you want to add it to. All of these collections could have their own url like www.mysite.com/user/collections/collection-name ...


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); }


0

I found the following helped: $sql = "SELECT MAX(umeta_id) FROM wp_usermeta GROUP BY user_id, meta_key, meta_value HAVING COUNT(user_id) > 1"; $um = $wpdb->get_results( $sql, ARRAY_A ); foreach ($um as $user) { $sql = "DELETE FROM wp_usermeta WHERE umeta_id = " . ...



Top 50 recent answers are included