Number of External Links in Comments – Moderation Option

Haha, I actually figured out a way to do this. As a plugin, this should work. class JPB_CommentCounter { var $count = 0; function __construct(){ add_filter( ‘pre_comment_content’, array( $this, ‘content’ ), 100 ); add_filter( ‘comment_max_links_url’, array( $this, ‘counter’ ) ); } function JPB_CommentCounter(){ $this->__construct(); } function counter( $num, $url ){ if($this->count < 1) return $num; … Read more

Use rich text editor in comments?

Solved it myself by loading tinymce in the header: wp_enqueue_script(‘tiny_mce’); This will include the TinyMCE javascript. Then simply use TinyMCE as you wish <script type=”text/javascript”> tinyMCE.init({ mode : “textareas”, theme : “advanced”, plugins : “autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template”, theme_advanced_buttons1 : “save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect”, theme_advanced_buttons2 : “cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor”, theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen”, theme_advanced_buttons4 : “insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage”, theme_advanced_toolbar_location : “top”, theme_advanced_toolbar_align : “left”, theme_advanced_statusbar_location : … Read more

Top Commenters: exclude admin

Extend the WHERE clause: WHERE comment_author_email != “” AND comment_author_email != “YOUR_MAIL_ADDRESS” AND comment_type = “” AND comment_approved = 1 ) If you want to exclude multiple email addresses, use the NOT IN operator and a comma separated list of strings: AND comment_author_email NOT IN ( “[email protected]”, “[email protected]” )

Disable Comments Feed

Something like this should work. function wpse45941_disable_feed( $comments ) { if( $comments ) { wp_die( ‘No feed available’ ); } } add_action(‘do_feed’, ‘wpse45941_disable_feed’,1 ); add_action(‘do_feed_rdf’, ‘wpse45941_disable_feed’,1 ); add_action(‘do_feed_rss’, ‘wpse45941_disable_feed’,1 ); add_action(‘do_feed_rss2’, ‘wpse45941_disable_feed’,1 ); add_action(‘do_feed_atom’, ‘wpse45941_disable_feed’,1 ); Note: I haven’t tested that at all, I just wrote it right into the answer box.

Change the HTML output of comments

Upon request, a bit more of inormation 🙂 The default html output of comment_form() is: <p class=”comment-form-author”><label for=”author”>Name</label> <span class=”required”>*</span><input id=”author” name=”author” type=”text” value=”” size=”30″ aria-required=’true’ /></p> <p class=”comment-form-email”><label for=”email”>Email</label> <span class=”required”>*</span><input id=”email” name=”email” type=”text” value=”” size=”30″ aria-required=’true’ /></p> <p class=”comment-form-url”><label for=”url”>Website</label><input id=”url” name=”url” type=”text” value=”” size=”30″ /></p> I would like to wrap all three … Read more

Comments number message in password protected post

The only hook to change that is gettext: add_action( ‘loop_start’, ‘wpse_77028_switch_filter’ ); add_action( ‘loop_end’, ‘wpse_77028_switch_filter’ ); /** * Turn comment text filter on or off depending on global $post object. * * @wp-hook loop_start * @wp-hook loop_end * @return void */ function wpse_77028_switch_filter() { $func=”loop_start” === current_filter() ? ‘add_filter’ : ‘remove_filter’; $func( ‘gettext’, ‘wpse_77028_comment_num_text’, 10, … Read more

Completely disable comments

The following is the list of hooks used by Frank Bultge’s plugin Remove Comments Absolutely: # Set the status on posts and pages – is_singular () add_filter( ‘the_posts’, array( $this, ‘set_comment_status’ ) ); # Close comments, if open add_filter( ‘comments_open’, array( $this, ‘close_comments’), 10, 2 ); add_filter( ‘pings_open’, array( $this, ‘close_comments’), 10, 2 ); # … Read more

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