Skip to content
Snippets Groups Projects

Super Admins can always comment

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Erick Hitter
    super-admin-comments.php 276 B
    <?php
    /**
     * Keep comments open for super admins (me)
     */
    function eth_allow_me_to_comment( $open ) {
    	if ( ! is_user_logged_in() ) {
    		return $open;
    	}
    
    	if ( is_super_admin() ) {
    		$open = true;
    	}
    
    	return $open;
    }
    add_filter( 'comments_open', 'eth_allow_me_to_comment' );
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment