Issues (311)

inc/custom-header.php (7 issues)

Labels
Severity
1
<?php
2
/**
3
 * Sample implementation of the Custom Header feature
4
 *
5
 * You can add an optional custom header image to header.php like so ...
6
 *
7
	<?php the_header_image_tag(); ?>
8
 *
9
 * @link https://developer.wordpress.org/themes/functionality/custom-headers/
10
 *
11
 * @package DesignFly
12
 */
13
14
/**
15
 * Set up the WordPress core custom header feature.
16
 *
17
 * @uses designfly_header_style()
18
 */
19
function designfly_custom_header_setup() {
20
	add_theme_support( 'custom-header', apply_filters( 'designfly_custom_header_args', array(
0 ignored issues
show
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

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

20
	add_theme_support( 'custom-header', /** @scrutinizer ignore-call */ apply_filters( 'designfly_custom_header_args', array(
Loading history...
21
		'default-image'          => '',
22
		'default-text-color'     => 'ffffff',
23
		'width'                  => 1000,
24
		'height'                 => 544,
25
		'flex-height'            => false,
26
		'wp-head-callback'       => 'designfly_header_style',
27
	) ) );
28
}
29
add_action( 'after_setup_theme', 'designfly_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

29
/** @scrutinizer ignore-call */ 
30
add_action( 'after_setup_theme', 'designfly_custom_header_setup' );
Loading history...
30
31
if ( ! function_exists( 'designfly_header_style' ) ) :
32
	/**
33
	 * Styles the header image and text displayed on the blog.
34
	 *
35
	 * @see designfly_custom_header_setup().
36
	 */
37
	function designfly_header_style() {
38
		$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

38
		$header_text_color = /** @scrutinizer ignore-call */ get_header_textcolor();
Loading history...
39
40
		/*
41
		 * If no custom options for text are set, let's bail.
42
		 * get_header_textcolor() options: Any hex value, 'blank' to hide text. Default: add_theme_support( 'custom-header' ).
43
		 */
44
		if ( get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
0 ignored issues
show
The function get_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

44
		if ( /** @scrutinizer ignore-call */ get_theme_support( 'custom-header', 'default-text-color' ) === $header_text_color ) {
Loading history...
45
			return;
46
		}
47
48
		// If we get this far, we have custom styles. Let's do this.
49
		?>
50
		<style type="text/css">
51
		<?php
52
		// Has the text been hidden?
53
		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

53
		if ( ! /** @scrutinizer ignore-call */ display_header_text() ) :
Loading history...
54
			?>
55
			.site-title,
56
			.site-description {
57
				position: absolute;
58
				clip: rect(1px, 1px, 1px, 1px);
59
			}
60
		<?php
61
		// If the user has set a custom color for the text use that.
62
		else :
63
			?>
64
			.site-title a,
65
			.site-description {
66
				color: #<?php echo esc_attr( $header_text_color ); ?>;
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

66
				color: #<?php echo /** @scrutinizer ignore-call */ esc_attr( $header_text_color ); ?>;
Loading history...
67
			}
68
		<?php endif; ?>
69
		</style>
70
		<?php
71
	}
72
endif;
73