# comments-plus/1.1.6/includes/boot.php

Disable Comments &amp; Delete All Comments, version 1.1.6. 51 lines.

- Page: https://pluginprobe.com/plugins/comments-plus/1.1.6/code/includes/boot.php
- Raw: https://pluginprobe.com/plugins/comments-plus/1.1.6/raw/includes/boot.php
- Modified: 2023-03-23T04:47:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/comments-plus/1.1.6/code/includes/boot.php#L10-L20`.

```php
<?php
/**
 * Admin boot
 *
 * @author    Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
 *
 * @copyright Webcraftic 25.05.2017
 */

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Получает список отключенных типов записей
 *
 * @return array|bool|mixed|void
 */
function wbcr_cmp_get_disabled_post_types() {

	$post_types = WCM_Plugin::app()->getPopulateOption( 'disable_comments_for_post_types' );

	if ( WCM_Plugin::app()->getPopulateOption( 'disable_comments', 'enable_comments' ) == 'disable_comments' ) {

		$args = [ 'public' => true ];

		if ( WCM_Plugin::app()->isNetworkActive() ) {
			$args['_builtin'] = true;
		}

		$all_post_types = get_post_types( $args, 'objects' );

		return array_keys( $all_post_types );
	}

	// Not all extra_post_types might be registered on this particular site
	/*if( $this->networkactive ) {
		foreach( (array) $this->options['extra_post_types'] as $extra ) {
			if( post_type_exists( $extra ) ) {
				$types[] = $extra;
			}
		}
	}*/

	if ( is_array( $post_types ) ) {
		return $post_types;
	}

	return explode( ',', $post_types );
}
```
