Issues (924)

classes/admin/class-settings.php (194 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
namespace lsx\sharing\classes\admin;
3
4
/**
5
 * Houses the functions for the Settings page.
6
 *
7
 * @package lsx-sharing
8
 */
9
class Settings {
10
11
12
    /**
13
     * Holds class instance
14
     *
15
     * @since 1.0.0
16
     *
17
     * @var object \lsx\sharing\classes\admin\Settings()
18
     */
19
    protected static $instance = null;
0 ignored issues
show
Expected 1 blank line(s) before first member var; 2 found
Loading history...
20
21
    /**
22
     * Contructor
23
     */
24
    public function __construct() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
25
         add_action('cmb2_admin_init', array( $this, 'register_settings_page' ));
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
26
        add_action('lsx_sharing_settings_page', array( $this, 'configure_general_fields' ), 15, 1);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
27
        add_action('lsx_sharing_settings_page', array( $this, 'configure_archive_fields' ), 15, 1);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
28
        add_action('admin_enqueue_scripts', array( $this, 'assets' ));
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
29
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
30
31
    /**
32
     * Return an instance of this class.
33
     *
34
     * @since 1.0.0
35
     *
36
     * @return object \lsx\sharing\classes\admin\Settings()    A single instance of this class.
37
     */
38
    public static function get_instance() {
39
         // If the single instance hasn't been set, set it now.
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
40
        if ( null == self::$instance ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Found: ==. Use strict comparisons (=== or !==).
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
41
            self::$instance = new self();
42
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
43
        return self::$instance;
44
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
45
46
    /**
47
     * Configure fields for the Settings page.
48
     *
49
     * @return void
50
     */
51
    public function register_settings_page() {
52
         $args = array(
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
53
			 'id'           => 'lsx_sharing_settings',
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
54
			 'title'        => '<h1>' . esc_html__('LSX Sharing Settings', 'lsx-search') . ' <span class="version">' . LSX_SHARING_VER . '</span></h1>',
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
55
			 'menu_title'   => esc_html__('LSX Sharing', 'search'), // Falls back to 'title' (above).
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
56
			 'object_types' => array( 'options-page' ),
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
57
			 'option_key'   => 'lsx-sharing-settings', // The option key and admin menu page slug.
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
58
			 'parent_slug'  => 'options-general.php',
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
59
			 'capability'   => 'manage_options', // Cap required to view options-page.
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
60
		 );
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
61
        $cmb  = new_cmb2_box($args);
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 2 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
62
        do_action('lsx_sharing_settings_page', $cmb);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
63
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
64
65
    /**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$hook" missing
Loading history...
66
     * Enqueue JS and CSS.
67
     */
68
    public function assets( $hook ) {
69
         wp_enqueue_style('lsx-sharing-admin', LSX_SHARING_URL . 'assets/css/lsx-sharing-admin.css', array(), LSX_SHARING_VER);
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
70
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
71
72
    /**
0 ignored issues
show
Coding Style Documentation introduced by
Doc comment for parameter "$cmb" missing
Loading history...
73
     * Enable Business Directory Search settings only if LSX Search plugin is enabled.
74
     *
75
     * @return void
76
     */
77
    public function configure_general_fields( $cmb ) {
78
         $global_args = array(
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
79
			 'title' => __('Global', 'lsx-search'),
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
80
			 'desc'  => esc_html__('These settings will control sharing icons everywhere.', 'lsx-search'),
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
81
		 );
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
82
        $this->get_fields($cmb, 'global', $global_args);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
83
    }
0 ignored issues
show
Expected 2 blank lines after function; 1 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
84
85
    /**
86
     * Enable Sharing settings only if LSX Search plugin is enabled.
87
     *
88
     * @param  object $cmb      The CMB2() class.
89
     * @param  string $position either top of bottom.
0 ignored issues
show
Superfluous parameter comment
Loading history...
90
     * @return void
91
     */
92
    public function configure_archive_fields( $cmb ) {
93
         $archives       = array();
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 7 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
94
        $post_type_args = array(
95
			'public' => true,
96
        );
97
        $post_types     = get_post_types($post_type_args);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
98
        if ( ! empty($post_types) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
99
            foreach ( $post_types as $post_type_key => $post_type_value ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
100
                switch ( $post_type_key ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
101
                case 'post':
102
                    $page_url      = home_url();
103
                    $page_title    = __('Home', 'lsx-search');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
104
                    $show_on_front = get_option('show_on_front');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
105
                    if ( 'page' === $show_on_front ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
106
                            $page_for_posts = get_option('page_for_posts');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
107
                        if ( '' !== $page_for_posts ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
108
                            $page_title   = get_the_title($page_for_posts);
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 1 space but found 3 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
It seems like $page_for_posts can also be of type false; however, parameter $post of get_the_title() does only seem to accept WP_Post|integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

108
                            $page_title   = get_the_title(/** @scrutinizer ignore-type */ $page_for_posts);
Loading history...
109
                            $page_url     = get_permalink($page_for_posts);
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 5 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
It seems like $page_for_posts can also be of type false; however, parameter $post of get_permalink() does only seem to accept WP_Post|integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

109
                            $page_url     = get_permalink(/** @scrutinizer ignore-type */ $page_for_posts);
Loading history...
110
                        }
111
                    }
0 ignored issues
show
No blank line found after control structure
Loading history...
112
                    $description = sprintf(
113
                    /* translators: %s: The subscription info */
114
                        __('Control the sharing buttons on your <a target="_blank" href="%1$s">%2$s</a> posts.', 'lsx-search'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
115
                        $page_url,
0 ignored issues
show
It seems like $page_url can also be of type false; however, parameter $values of sprintf() does only seem to accept double|integer|string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

115
                        /** @scrutinizer ignore-type */ $page_url,
Loading history...
116
                        $page_title
117
                    );
118
                    $archives[ $post_type_key ] = array(
119
						'title' => __('Blog', 'lsx-search'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
120
						'desc'  => $description,
121
                    );
122
                        break;
123
124
                case 'product':
125
                    $page_url = home_url();
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
126
                    $page_title    = __('Shop', 'lsx-search');
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 1 space but found 4 spaces

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
127
                    if ( function_exists('wc_get_page_id') ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
128
                        $shop_page  = wc_get_page_id('shop');
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
129
                        $page_url   = get_permalink($shop_page);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
130
                        $page_title = get_the_title($shop_page);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
131
                    }
0 ignored issues
show
No blank line found after control structure
Loading history...
132
                    $description = sprintf(
133
                    /* translators: %s: The subscription info */
134
                        __('Control the sharing buttons which show on your <a target="_blank" href="%1$s">%2$s</a> product pages.', 'lsx-search'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
135
                        $page_url,
136
                        $page_title
137
                    );
138
                    $archives[ $post_type_key ] = array(
139
						'title' => __('Shop', 'lsx-search'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
140
						'desc'  => $description,
141
                    );
142
                        break;
143
144
                default:
145
                    if ( in_array($post_type_key, \lsx\sharing\includes\functions\get_restricted_post_types()) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Not using strict comparison for in_array; supply true for third argument.
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
146
                            break;
147
                    }
0 ignored issues
show
No blank line found after control structure
Loading history...
148
                    $temp_post_type = get_post_type_object($post_type_key);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
149
                    if ( ! is_wp_error($temp_post_type) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
150
                        $page_url    = get_post_type_archive_link($temp_post_type->name);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
151
                        $description = sprintf(
152
                        /* translators: %s: The subscription info */
153
                            __('Control the sharing buttons which show on your <a target="_blank" href="%1$s">%2$s</a> singles.', 'lsx-search'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
154
                            $page_url,
155
                            $temp_post_type->label
156
                        );
157
158
                        $archives[ $post_type_key ] = array(
159
							'title' => $temp_post_type->label,
160
							'desc'  => $description,
161
                        );
162
                    }
163
                        break;
164
                }
165
            }
166
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
167
        if ( ! empty($archives) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
168
            foreach ( $archives as $archive_key => $archive_args ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
169
                $this->get_fields($cmb, $archive_key, $archive_args);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
170
            }
171
        }
172
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
173
    /**
174
     * Gets the sharing fields and loops through them.
175
     *
176
     * @param  object $cmb
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
177
     * @param  string $section
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
178
     * @param  array  $args
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
179
     * @return void
180
     */
181
    public function get_fields( $cmb, $section, $args ) {
182
         $cmb->add_field(
0 ignored issues
show
Found precision alignment of 1 spaces.
Loading history...
Opening statement of multi-line function call not indented correctly; expected 8 spaces but found 9
Loading history...
183
            array(
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 13 spaces, but found 12.
Loading history...
184
				'id'          => 'settings_' . $section . '_sharing',
185
				'type'        => 'title',
186
				'name'        => $args['title'],
187
				'default'     => $args['title'],
188
				'description' => $args['desc'],
189
            )
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 13 spaces, but found 12.
Loading history...
190
        );
0 ignored issues
show
This line of the multi-line function call does not seem to be indented correctly. Expected 9 spaces, but found 8.
Loading history...
191
        if ( 'global' === $section ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
192
            $cmb->add_field(
193
                array(
194
					'name'        => esc_html__('Disable all', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
195
					'id'          => $section . '_disable_all',
196
					'description' => esc_html__('Disable all sharing buttons on the site', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
197
					'type'        => 'checkbox',
198
                )
199
            );
200
        } else {
201
            $cmb->add_field(
202
                array(
203
					'name'        => esc_html__('Disable', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
204
					'id'          => $section . '_disable_pt',
205
					'description' => esc_html__('Disable the share buttons on this post type', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
206
					'type'        => 'checkbox',
207
                )
208
            );
209
        }
210
211
		if ( 'global' === $section ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
212
			$label_text_description = esc_html__( 'If no text is specified per post type this text will display.' , 'lsx-sharing' );
0 ignored issues
show
Space found before comma in argument list
Loading history...
213
		} else {
214
			$label_text_description = esc_html__( 'This text will display alongside the sharing buttons.', 'lsx-sharing' );
215
		}
216
		
217
        $cmb->add_field(
218
			array(
219
				'name'        => esc_html__( 'Label text', 'lsx-sharing' ),
220
				'id'          => $section . '_label_text',
221
				'type'        => 'text',
222
				'description' => $label_text_description,
223
			)
224
		);
225
		
226
        if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'facebook') ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
227
            $cmb->add_field(
228
                array(
229
					'name'        => esc_html__('Disable Facebook', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
230
					'id'          => $section . '_disable_facebook',
231
					'description' => esc_html__('Disable Facebook share button.', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
232
					'type'        => 'checkbox',
233
                )
234
            );
235
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
236
        if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'twitter') ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
237
            $cmb->add_field(
238
                array(
239
					'name'        => esc_html__('Disable Twitter', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
240
					'id'          => $section . '_disable_twitter',
241
					'description' => esc_html__('Disable Twitter share button.', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
242
					'type'        => 'checkbox',
243
                )
244
            );
245
        }
0 ignored issues
show
No blank line found after control structure
Loading history...
246
        if ( 'global' === $section || ( 'global' !== $section && ! \lsx\sharing\includes\functions\is_button_disabled('global', 'pinterest') ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
247
            $cmb->add_field(
248
                array(
249
					'name'        => esc_html__('Disable Pinterest', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
250
					'id'          => $section . '_disable_pinterest',
251
					'description' => esc_html__('Disable Pinterest button.', 'lsx-sharing'),
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
252
					'type'        => 'checkbox',
253
                )
254
            );
255
        }
256
257
        do_action('lsx_sharing_settings_section', $cmb, $section);
0 ignored issues
show
Expected 1 spaces after opening parenthesis; 0 found
Loading history...
Expected 1 spaces before closing parenthesis; 0 found
Loading history...
258
        $cmb->add_field(
259
            array(
260
				'id'   => $section . '_title_closing',
261
				'type' => 'tab_closing',
262
            )
263
        );
264
    }
0 ignored issues
show
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
265
}
266