WordPress.org

Plugin Directory

Changeset 590094


Ignore:
Timestamp:
08/25/12 05:20:09 (20 months ago)
Author:
solarissmoke
Message:

More efficient version of previous commit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • disable-comments/trunk/disable-comments.php

    r590069 r590094  
    7171            add_action( 'admin_menu', array( $this, 'settings_menu' ) ); 
    7272            add_action( 'admin_print_footer_scripts', array( $this, 'discussion_notice' ) ); 
    73             add_action( 'edit_form_advanced', array( $this, 'edit_form_inputs' ) ); 
    74             add_action( 'edit_page_form', array( $this, 'edit_form_inputs' ) ); 
     73             
     74            if( !$this->options['permanent'] ) { 
     75                add_action( 'edit_form_advanced', array( $this, 'edit_form_inputs' ) ); 
     76                add_action( 'edit_page_form', array( $this, 'edit_form_inputs' ) ); 
     77            } 
    7578             
    7679            if( $this->options['remove_admin_menu_comments'] ) 
     
    8891        global $post; 
    8992        // Without a dicussion meta box, comment_status will be set to closed on new/updated posts 
    90         if( !$this->options['permanent'] && in_array( $post->post_type, $this->modified_types ) ) { 
     93        if( in_array( $post->post_type, $this->modified_types ) ) { 
    9194            echo '<input type="hidden" name="comment_status" value="' . $post->comment_status . '" /><input type="hidden" name="ping_status" value="' . $post->ping_status . '" />'; 
    9295        } 
Note: See TracChangeset for help on using the changeset viewer.