SilentComics /
Strip
| 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
Bug
introduced
by
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
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
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
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
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
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
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
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
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
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
Loading history...
|
|||||||
| 77 | } |
||||||
| 78 | } |
||||||
| 79 | endif; // strip_header_style. |
||||||
| 80 |