Issues (631)

inc/custom-header.php (11 issues)

Labels
Severity
1
<?php
2
/**
3
 * Custom Header implementation
4
 *
5
 * @link http://codex.wordpress.org/Custom_Headers
6
 *
7
 * @package WordPress
8
 * @subpackage Strip
9
 */
10
11
/**
12
 * Setup the WordPress core custom header feature.
13
 *
14
 * @uses strip_header_style()
15
 * @uses strip_admin_header_style()
16
 * @uses strip_admin_header_image()
17
 *
18
 * @package strip
19
 */
20
function strip_custom_header_setup() {
21
	add_theme_support( 'custom-header', apply_filters( 'strip_custom_header_args', array(
0 ignored issues
show
The function apply_filters 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

21
	add_theme_support( 'custom-header', /** @scrutinizer ignore-call */ apply_filters( 'strip_custom_header_args', array(
Loading history...
The function add_theme_support 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

21
	/** @scrutinizer ignore-call */ 
22
 add_theme_support( 'custom-header', apply_filters( 'strip_custom_header_args', array(
Loading history...
22
		'default-image'          => get_template_directory_uri() . '/assets/images/Default-header.png',
0 ignored issues
show
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

22
		'default-image'          => /** @scrutinizer ignore-call */ get_template_directory_uri() . '/assets/images/Default-header.png',
Loading history...
23
		'default-text-color'     => '000',
24
		'flex-height'            => true,
25
		'flex-width'             => true,
26
		'height'                 => 320,
27
		'width'                  => 1920,
28
		'wp-head-callback'       => 'strip_header_style',
29
		'admin-head-callback'    => 'strip_admin_header_style',
30
		'admin-preview-callback' => 'strip_admin_header_image',
31
	) ) );
32
	/**
33
 * Register default header image
34
 */
35
	register_default_headers( array(
0 ignored issues
show
The function register_default_headers 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

35
	/** @scrutinizer ignore-call */ 
36
 register_default_headers( array(
Loading history...
36
		'default-image' => array(
37
		'url'  			    => '%s/assets/images/Default-header.png',
38
		'thumbnail_url' => '%s/assets/images/Default-header.png',
39
		'description'   => _x( 'DefaultHeader', 'header image description', 'strip' ),
0 ignored issues
show
The function _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

39
		'description'   => /** @scrutinizer ignore-call */ _x( 'DefaultHeader', 'header image description', 'strip' ),
Loading history...
40
		),
41
		)
42
	);
43
}
44
45
add_action( 'after_setup_theme', 'strip_custom_header_setup' );
0 ignored issues
show
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

45
/** @scrutinizer ignore-call */ 
46
add_action( 'after_setup_theme', 'strip_custom_header_setup' );
Loading history...
46
47
if ( ! function_exists( 'strip_header_style' ) ) :
48
/**
49
 * Styles the header image and text displayed on the blog
50
 *
51
 * @see strip_custom_header_setup().
52
 */
53
function strip_header_style() {
54
55
	/* Header text color. */
56
$header_text_color = get_header_textcolor();
0 ignored issues
show
The function get_header_textcolor 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

56
$header_text_color = /** @scrutinizer ignore-call */ get_header_textcolor();
Loading history...
57
58
	/* Header image. */
59
$header_image = esc_url( get_header_image() );
0 ignored issues
show
The function get_header_image 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

59
$header_image = esc_url( /** @scrutinizer ignore-call */ get_header_image() );
Loading history...
The function esc_url 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

59
$header_image = /** @scrutinizer ignore-call */ esc_url( get_header_image() );
Loading history...
60
61
/* Start header styles. */
62
	$style = '';
63
64
	/* Site title styles. */
65
	if ( display_header_text() ) {
0 ignored issues
show
The function display_header_text 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

65
	if ( /** @scrutinizer ignore-call */ display_header_text() ) {
Loading history...
66
		$style .= ".site-title, .site-title a, .site-description, .site-description a { color: #{$header_text_color} }";
67
		$style .= ".site-title { border-color: #{$header_text_color} }";
68
	}
69
70
	if ( ! display_header_text() ) {
71
		$style .= '.site-title, .site-title a, .site-description, .site-description a { clip: rect(1px, 1px, 1px, 1px); position: absolute; }';
72
	}
73
74
	/* Echo styles if it's not empty. */
75
	if ( ! empty( $style ) ) {
76
		echo "\n" . '<style type="text/css" id="custom-header-css">' . esc_attr( trim( $style ) ) . '</style>' . "\n";
0 ignored issues
show
The function esc_attr 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

76
		echo "\n" . '<style type="text/css" id="custom-header-css">' . /** @scrutinizer ignore-call */ esc_attr( trim( $style ) ) . '</style>' . "\n";
Loading history...
77
	}
78
}
79
endif; // strip_header_style.
80