Comments screen in backend, how to disable Quick Edit | Edit | History | Spam | for non admins

This is done filtering the *_row_actions. For the Comments screen (/wp-admin/edit-comments.php) this is the hook: add_filter( ‘comment_row_actions’, ‘comments_row_wpse_92313’, 15, 2 ); function comments_row_wpse_92313( $actions, $comment ) { if( !current_user_can( ‘delete_plugins’ ) ) unset( $actions[‘quickedit’], $actions[‘edit’], $actions[‘spam’] ); return $actions; } I cannot see a History option, maybe it’s included by some plugin (?). It’s a … Read more

Can’t add default comments to custom post type

I figured this out after some searching. For anyone who wants to know: add_filter( ‘comments_open’, ‘my_comments_open’, 10, 2 ); function my_comments_open( $open, $post_id ) { $post = get_post( $post_id ); if ( ‘spark’ == $post->post_type ) $open = true; return $open; }

“Leave a comment” link even when you can’t

In the loop.php template file, you will find this line: <span class=”comments-link”><?php comments_popup_link( __( ‘Leave a comment’, ‘twentyten’ ), __( ‘1 Comment’, ‘twentyten’ ), __( ‘% Comments’, ‘twentyten’ ) ); ?></span> If you don’t want “leave a comment” to display if comments are closed, you can wrap the call to comments_popup_link() in a if ( … Read more

how to make author to write comment on only his own posts?

I have the same thing running on my website. Here is how I do do it… Only post author and commentor can view each others comments function restrict_comments( $comments , $post_id ){ global $post; $user = wp_get_current_user(); if($post->post_author == $user->ID){ return $comments; } foreach($comments as $comment){ if( $comment->user_id == $user->ID || $post->post_author == $comment->user_id ){ … Read more

Remove link preview in discussion dashboard

Since version 4.1.6, Akismet has a filter which allows you to disable these “mShots” (the site preview popups): <?php function disable_akismet_mshots( $value ) { return false; } add_filter( ‘akismet_enable_mshots’, ‘disable_akismet_mshots’ );

Can I seperate comments from post?

Most starter themes now, like Twenty Eleven, come with separate files for each template — for example, single.php and content-single.php represent the Single (Post) template in Twenty Eleven. The starter theme I use, Reddle (ddl), has the same template hierarchy, and here’s the solution I am using… Create a blank Page (NOT Post) titled “Comments, … Read more

Add Comment Custom Field

Here you go: Adding Custom Fields to WordPress Comment Forms? And another awesome post on this: http://wpengineer.com/2214/adding-input-fields-to-the-comment-form/ Functions are available to add/update, delete comment meta, similar to post and user meta. Edit: Here’s an example to give you a start (put the code into the functions.php or in a custom plugin): Add the fields to … Read more

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