User updating their profile wipes my custom fields

I see two problems in your code. The first one is the user capability level and the second one is how you’re saving the data. You can fix the first one by setting the capability requirement in your saving function higher, some capability that only administrators have. Regarding edit_usercapability, WordPress Capabilities: edit_user vs edit_users The … Read more

How can get the last post date of the user?

In your sample code the $latest_posts is an instance of WP_Query class. If you want to get the latest post’s date, you should do this: $latest_posts = new WP_Query( $args ); $last_date=””; if ( $latest_posts->have_posts() ) { $latest_posts->the_post(); $last_date = get_the_date(); } return $last_date;

Append USER ID to an outbound link?

You should be able to use get_current_user_id(). Note that it will return ‘0’ if the user isn’t logged in. <a href=”https://example.com/?user_id=<?php echo get_current_user_id(); ?>”>Link</a> Update 2: Got bored, made a plugin: https://github.com/AndyMardell/append-user-id/releases/tag/v1.0.0-alpha Download the zip and install 🙂 Submitted to WordPress but it’s still under review. Installation and Usage: https://github.com/AndyMardell/append-user-id#installation Update: you won’t be able … Read more

How can i display pagination in custom comment list?

You should use append paginate_comments_links() into $output like so: add_shortcode ( ‘show_recent_comments’, ‘show_recent_comments_handler’ ); function show_recent_comments_handler( $atts, $content = null ) { extract( shortcode_atts( array( “count” => 20, “pretty_permalink” => 0 ), $atts )); $output=””; // this holds the output if ( is_user_logged_in() ) { global $current_user; get_currentuserinfo(); $args = array( ‘user_id’ => $current_user->ID, ‘number’ … Read more

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