true ); if( $this->networkactive ) { $typeargs['_builtin'] = true; // stick to known types for network } $types = get_post_types( $typeargs, 'objects' ); foreach( array_keys( $types ) as $type ) { if( ! in_array( $type, $this->modified_types ) && ! post_type_supports( $type, 'comments' ) ) // the type doesn't support comments anyway unset( $types[$type] ); } $persistent_allowed = $this->persistent_mode_allowed(); if ( isset( $_POST['submit'] ) ) { check_admin_referer( 'disable-comments-admin' ); $this->options['remove_everywhere'] = ( $_POST['mode'] == 'remove_everywhere' ); if( $this->options['remove_everywhere'] ) $disabled_post_types = array_keys( $types ); else $disabled_post_types = empty( $_POST['disabled_types'] ) ? array() : (array) $_POST['disabled_types']; $disabled_post_types = array_intersect( $disabled_post_types, array_keys( $types ) ); // entering permanent mode, or post types have changed if( $persistent_allowed && !empty( $_POST['permanent'] ) && ( !$this->options['permanent'] || $disabled_post_types != $this->options['disabled_post_types'] ) ) $this->enter_permanent_mode(); $this->options['disabled_post_types'] = $disabled_post_types; $this->options['permanent'] = $persistent_allowed && isset( $_POST['permanent'] ); // Extra custom post types if( $this->networkactive && !empty( $_POST['extra_post_types'] ) ) { $extra_post_types = array_filter( array_map( 'sanitize_key', explode( ',', $_POST['extra_post_types'] ) ) ); $this->options['extra_post_types'] = array_diff( $extra_post_types, array_keys( $types ) ); // Make sure we don't double up builtins } $this->update_options(); $cache_message = WP_CACHE ? ' ' . __( 'If a caching/performance plugin is active, please invalidate its cache to ensure that changes are reflected immediately.' ) . '' : ''; echo '
' . __( 'Options updated. Changes to the Admin Menu and Admin Bar will not appear until you leave or reload this page.', 'disable-comments' ) . $cache_message . '
' . __( 'Disable Comments is Network Activated. The settings below will affect all sites in this network.', 'disable-comments') . '
' . __( "It seems that a caching/performance plugin is active on this site. Please manually invalidate that plugin's cache after making any changes to the settings below.", 'disable-comments') . '