How to prevent multiple user accounts with the same meta field?

You can use the add_post_meta and update_post_meta filters to accomplish this. If you return anything other than null in these filters the post meta will not be saved. add_filter(‘add_post_metadata’, ‘check_metadata’, 10, 5); function check_metadata($check, $object_id, $meta_key, $meta_value, $prev_value){ /*** Check if the metadata exists via sql ***/ if($exists) { /*** Notify you or something ***/ … Read more

How to create page for user?

Is there a reason why you don’t just want to make the “author archive” a page and list them all on the page with a shortcode ? If that’s an option, simply put your single author template in author.php Author templates – Template hierarchy If not, you could take your current template (that you’ve put … Read more

Deleted users still able to login

It’s an weird one. Go to the database and check users table to see if the deleted users are there or not. If they are there, delete the unwanted users except the admin.

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)