Source View: twentysixteen_custom_header_sizes

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

  • Action hooks look like this: do_action( "hook_name" )
  • Filter hooks look like this: apply_filters( "hook_name", "what_to_filter" ).

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
86                          /**
87                           * Filter the default twentysixteen custom header sizes attribute.
88                           *
89                           * @since Twenty Sixteen 1.0
90                           *
91                           * @param string $custom_header_sizes sizes attribute
92                           * for Custom Header. Default '(max-width: 709px) 85vw,
93                           * (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px'.
94                           */
95                          $custom_header_sizes = apply_filters( 'twentysixteen_custom_header_sizes', '(max-width: 709px) 85vw, (max-width: 909px) 81vw, (max-width: 1362px) 88vw, 1200px' );
96                     ?>
97                     <div class="header-image">
98                          <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
99                               <img src="<?php header_image(); ?>" srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_custom_header()->attachment_id ) ); ?>" sizes="<?php echo esc_attr( $custom_header_sizes ); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
100                          </a>
101                     </div><!-- .header-image -->
102                <?php endif; // End header image check. ?>
103           </header><!-- .site-header -->
104