Tag Info

Hot answers tagged

3

There is no "safe" way to edit core files; if you do you will need to check and repeat the edition after every update. Not recommended at all. Instead of editing core files, you could use any of the actions and filters available. For example, pre_comment_on_post (example code not tested): add_action( 'pre_comment_on_post', function( $post_id ) { if( ...


1

Comment type is similar to post type, because it allow to query only a specific type of comments, just like post type allow to query one or more post types. And just like core post types (page, post) there are core comment type as well: 'comment', 'pingback', 'trackback'. A difference between the two is that, by default, WP_Query do not fetch post types ...


1

It's strange that you want to use comments pagination where the comment links are without the comments pagination base. But you can try this (untested): /** * Remove the comments pagination base from comments links */ ! is_admin() && add_filter( 'get_comment_link', function( $link, $comment, $args ) { if( $args['per_page'] ) $link = ...


1

One surprisingly useful solution to foil most spam-bots is to use a honeypot. Put an extra entry field into your comment forms, and then hide it with css. Normal users won't fill it in because they won't ever even see it. Based on that, you can safely assume that anytime an entry is made with that field filled, that it's a bot and you can just discard/mark ...


1

The function is_wp_error checks if the given var is an instance of WP_Error class (soruce code as WP 4.2.2): function is_wp_error( $thing ) { return ( $thing instanceof WP_Error ); } As you can see, if the given variable is a instance of WP_Error class, the function returns true, even if the object is empty. Your $error variable is a WP_Error ...



Only top voted, non community-wiki answers of a minimum length are eligible