Issues (1724)

classes/class-lsx-customizer-wysiwyg-control.php (14 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
if ( ! class_exists( 'LSX_Customizer_Wysiwyg_Control' ) ) {
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
3
4
	/**
5
	 * LSX Customizer Wysiwyg Control Class
6
	 *
7
	 * @package   LSX Customizer
8
	 * @author    LightSpeed
9
	 * @license   GPL3
10
	 * @link
11
	 * @copyright 2016 LightSpeed
12
	 */
13
	class LSX_Customizer_Wysiwyg_Control extends WP_Customize_Control {
14
15
		public $type = 'wysiwyg';
0 ignored issues
show
Coding Style Documentation introduced by
Missing member variable doc comment
Loading history...
16
17
		/**
18
		 * Render the control's content.
19
		 *
20
		 * @since 1.1.1
21
		 */
22
		public function render_content() {
0 ignored issues
show
Expected 2 blank lines before function; 1 found
Loading history...
23
			?>
24
			<label>
25
				<?php if ( ! empty( $this->label ) ) { ?>
0 ignored issues
show
Expected 0 spaces after opening bracket; 1 found
Loading history...
Expected 0 spaces before closing bracket; 1 found
Loading history...
26
					<span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
27
				<?php } ?>
28
				<?php
29
					$settings = array(
30
						'media_buttons' => false,
31
						'teeny' => true,
32
					);
33
34
					$this->filter_editor_setting_link();
35
					wp_editor( $this->value(), $this->id, $settings );
36
				?>
37
			</label>
38
			<?php
39
			do_action( 'admin_footer' );
40
			do_action( 'admin_print_footer_scripts' );
41
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
42
43
		/**
44
		 * Filter editor setting link.
45
		 *
46
		 * @since 1.1.1
47
		 */
48
		private function filter_editor_setting_link() {
49
			add_filter( 'the_editor', function( $output ) {
0 ignored issues
show
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
For multi-line function calls, each argument should be on a separate line.

For a function calls that spawns multiple lines, the coding style suggests to split arguments to separate lines like this:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
);
Loading history...
50
				return preg_replace( '/<textarea/', '<textarea ' . $this->get_link(), $output, 1 );
51
			} );
0 ignored issues
show
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
52
		}
0 ignored issues
show
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected 2 blank lines after function; 1 found
Loading history...
53
54
	}
55
56
}
57
58