Small notice thrown in some scenarios
-
A small notice is thrown sometimes by the file header.php in some scenarios.
For example, when trying to create a child theme with Child Theme Configurator, I get a notice like this:
Notice: Trying to get property of non-object in /home/xxxxx/public_html/wp-content/themes/lovecraft/header.php on line 143
The lines from 141-143 show the next:
$header_image = get_header_image();
$header_image_data = get_theme_mod( 'header_image_data' );
$header_image_alt = get_post_meta( $header_image_data->attachment_id, '_wp_attachment_image_alt', true );What makes me then think that sometimes get_theme_mod does not get all the information it needs.
While this does not breaks anything, I noticed this while creating a child theme for this theme. So may make some people wonder.
Thanks for reading.
- The topic ‘Small notice thrown in some scenarios’ is closed to new replies.