Passed
Push — master ( 95836d...7727ff )
by SILENT
02:05
created

strip_customize_preview_js()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Strip Theme Customizer
4
 *
5
 * @package WordPress
6
 * @subpackage Strip
7
 */
8
9
/**
10
 * Add postMessage support for site title and description for the Theme Customizer.
11
 *
12
 * @param WP_Customize_Manager $wp_customize Theme Customizer object.
0 ignored issues
show
Bug introduced by
The type WP_Customize_Manager was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
 */
14
function strip_customize_register( $wp_customize ) {
15
	$wp_customize->get_setting( 'blogname' )        ->transport = 'postMessage';
16
	$wp_customize->get_setting( 'blogdescription' ) ->transport = 'postMessage';
17
	$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
18
	$wp_customize->get_setting( 'background_image' )->transport = 'postMessage';
19
	$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'content_title_color', array(
0 ignored issues
show
Bug introduced by
The type WP_Customize_Color_Control was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
		'label'   => esc_html_x( 'Content Title Color', 'admin', 'strip' ),
0 ignored issues
show
Bug introduced by
The function esc_html_x was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

20
		'label'   => /** @scrutinizer ignore-call */ esc_html_x( 'Content Title Color', 'admin', 'strip' ),
Loading history...
21
		'section' => 'colors',
22
	) ) );
23
}
24
add_action( 'customize_register', 'strip_customize_register' );
0 ignored issues
show
Bug introduced by
The function add_action was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

24
/** @scrutinizer ignore-call */ 
25
add_action( 'customize_register', 'strip_customize_register' );
Loading history...
25
26
/**
27
 * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
28
 */
29
function strip_customize_preview_js() {
30
	wp_enqueue_script( 'strip_customizer', get_template_directory_uri() . '/js/min/customizer-min.js', array( 'customize-preview' ), '20130508', true );
0 ignored issues
show
Bug introduced by
The function get_template_directory_uri was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

30
	wp_enqueue_script( 'strip_customizer', /** @scrutinizer ignore-call */ get_template_directory_uri() . '/js/min/customizer-min.js', array( 'customize-preview' ), '20130508', true );
Loading history...
Bug introduced by
The function wp_enqueue_script was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

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

30
	/** @scrutinizer ignore-call */ 
31
 wp_enqueue_script( 'strip_customizer', get_template_directory_uri() . '/js/min/customizer-min.js', array( 'customize-preview' ), '20130508', true );
Loading history...
31
}
32
add_action( 'customize_preview_init', 'strip_customize_preview_js' );
33