WP_Editor not saving data in user_meta
Solved: jQuery(‘input[name=dokan_update_profile]‘).click(function(){ tinyMCE.triggerSave(); }); Needed to update manually the tinymce, guess because it’s in an Iframe. Thanks anyway
Solved: jQuery(‘input[name=dokan_update_profile]‘).click(function(){ tinyMCE.triggerSave(); }); Needed to update manually the tinymce, guess because it’s in an Iframe. Thanks anyway
You can do it with ‘orderby’ parameter. Parameter description: Field(s) to sort the retrieved users by. May be a single value, an array of values, or a multi-dimensional array with fields as keys and orders (‘ASC’ or ‘DESC’) as values. Accepted values are ‘ID’, ‘display_name’ (or ‘name’), ‘include’, ‘user_login’ (or ‘login’), ‘login__in’, ‘user_nicename’ (or ‘nicename’), … Read more
Looks like I had to figure this one out myself. replace $comment_meta_args and $replies with global $wpdb; $comment_meta_args=”SELECT * FROM `$wpdb->comments` WHERE `comment_approved` = 1 AND `comment_parent` = (“. intval($parent_comment_id) .”) AND `user_id` != 1 ORDER BY comment_date ASC LIMIT 3″; $replies=$wpdb->get_results($comment_meta_args);
You can use get_current_user_id() – if a user is not logged in, the value will be 0: <a href=”http://example.com/uid=<?php echo get_current_user_id() ?>”>…</a>
@Cristián Lávaque Thank you for the hints 😉 Actually I managed to resolve the issue blocking this function (show the hidden comment above). In case this would help anyone here is the final working code: function check_post_limit() { if ( current_user_can( ‘edit_posts’ ) ) { global $userdata; global $wpdb; $s2member_last_payment_time = get_user_meta( get_current_user_id(), ‘wp_s2member_last_payment_time’, true … Read more
Might be because you are using a depreciated function for updating/adding the user meta (update_usermeta). You need to use update_user_meta function. WP Codex: https://codex.wordpress.org/Function_Reference/update_user_meta
You could query all the authors and loop through to update their dates. The below query pulls all users who have a programme_id of the current post_id and allocates an array of their IDs. You can then loop through to update whatever is necessary: /** Save Custom Metaboxes **/ function save_custom_meta_boxes( $post_id, $post ) { … Read more
The username is not a user meta entry, so you’ll probably want to work with a WP_User object instead: $user = get_user_by( ‘id’, $_uid ); echo $user->user_login;
Meta table? (wp_usermeta or wp_postmeta)? You can get any meta of user by get_user_meta
Run a single cron, it’s much more manageable and more stable, and performance shouldn’t be an issue since you do 99% of the work of selecting which user should be notified in MySQL, which will be extremely fast. I’d use a table to save each day (and each user on that day) that my cron … Read more