Automatically register users with comments

There are a number of functions you can use: register_new_user wp_create_user wp_insert_user The first function being the most simple to use and the last function gives you many more options – it depends what you want to do. You can create the new account when the comment is posted using the comment_post hook. You will … Read more

How to change the comments form title based on post type

You can use the comment_form_defaults filter to change your text based on custom post type. Just check the post type in your filter function. For example: add_filter( ‘comment_form_defaults’, ‘my_comment_form_defaults’ ); function my_comment_form_defaults( $defaults ) { if ( ‘my_cool_custom_post_type’ == get_post_type() ) { $defaults[‘title_reply’] == ‘My Custom Post Type Comment Title’; } return $defaults; } If … Read more

How can I filter the comment action links so that I can display the actions links based on user capabilities?

Yes, there is a hook you can use to filter the action links: comment_row_actions. E.g. add_filter( ‘comment_row_actions’, ‘my_comment_row_actions’, 10, 2 ); function my_comment_row_actions( $actions, $comment ) { // Filter the actions by user role. $roles = (array) wp_get_current_user()->roles; if ( in_array( ‘administrator’, $roles ) ) { $actions[‘foo’] = ‘<a href=”#”>Foo action</a>’; } // Filter the … Read more

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