PluginProbe
Disable Comments & Delete All Comments / 1.1.3
Disable Comments & Delete All Comments v1.1.3
1.3.3 1.3.2 trunk 1.0.0 1.0.4 1.0.5 1.0.8 1.0.9 1.1.1 1.1.3 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.3.0 1.3.1
comments-plus / includes / boot.php

boot.php in Disable Comments & Delete All Comments 1.1.3, at includes/boot.php

52 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Admin boot
4 *
5 * @author Alex Kovalev <alex.kovalevv@gmail.com>, Github: https://github.com/alexkovalevv
6 *
7 * @copyright Webcraftic 25.05.2017
8 */
9
10 // Exit if accessed directly
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 /**
16 * Получает список отключенны�
17 типов записей
18 *
19 * @return array|bool|mixed|void
20 */
21 function wbcr_cmp_get_disabled_post_types() {
22
23 $post_types = WCM_Plugin::app()->getPopulateOption( 'disable_comments_for_post_types' );
24
25 if ( WCM_Plugin::app()->getPopulateOption( 'disable_comments', 'enable_comments' ) == 'disable_comments' ) {
26
27 $args = [ 'public' => true ];
28
29 if ( WCM_Plugin::app()->isNetworkActive() ) {
30 $args['_builtin'] = true;
31 }
32
33 $all_post_types = get_post_types( $args, 'objects' );
34
35 return array_keys( $all_post_types );
36 }
37
38 // Not all extra_post_types might be registered on this particular site
39 /*if( $this->networkactive ) {
40 foreach( (array) $this->options['extra_post_types'] as $extra ) {
41 if( post_type_exists( $extra ) ) {
42 $types[] = $extra;
43 }
44 }
45 }*/
46
47 if ( is_array( $post_types ) ) {
48 return $post_types;
49 }
50
51 return explode( ',', $post_types );
52 }