1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | if ( ! class_exists( 'LSX_Customizer_Wysiwyg_Control' ) ) { |
||
0 ignored issues
–
show
|
|||
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
|
|||
16 | |||
17 | /** |
||
18 | * Render the control's content. |
||
19 | * |
||
20 | * @since 1.1.1 |
||
21 | */ |
||
22 | public function render_content() { |
||
0 ignored issues
–
show
|
|||
23 | ?> |
||
24 | <label> |
||
25 | <?php if ( ! empty( $this->label ) ) { ?> |
||
0 ignored issues
–
show
|
|||
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, |
||
0 ignored issues
–
show
|
|||
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
|
|||
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
|
|||
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.
![]() |
|||
52 | } |
||
0 ignored issues
–
show
|
|||
53 | |||
54 | } |
||
55 | |||
56 | } |
||
57 | |||
58 |