Skip to content

Commit

Permalink
Merge pull request #117 from UCF/config-header-img-alt
Browse files Browse the repository at this point in the history
Config Header Image Alt Text
  • Loading branch information
jmbarne3 authored Jan 11, 2022
2 parents 692fa53 + 8b0dcd1 commit a447a8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
21 changes: 20 additions & 1 deletion dev/acf-export.json
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,25 @@
"default_value": "https:\/\/www.ucf.edu\/coronavirus\/",
"placeholder": ""
},
{
"key": "field_61ddb738a7b6d",
"label": "Header Image Alt",
"name": "header_image_alt",
"type": "text",
"instructions": "The text to place in the alt field of the header image.",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"default_value": "",
"placeholder": "",
"prepend": "",
"append": "",
"maxlength": ""
},
{
"key": "field_5f088e87d99c3",
"label": "Title",
Expand Down Expand Up @@ -1361,4 +1380,4 @@
"active": true,
"description": ""
}
]
]
3 changes: 2 additions & 1 deletion template-parts/impact/browser/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
$header_img = $options->header_image ?? null;
$header_img_utm_content = get_option( 'impact_header_utm_content' ) ?: '';
$header_img_url = isset( $options->header_image_link ) ? Impact\format_url_utm_params( $options->header_image_link, $header_img_utm_content ) : null;
$header_image_alt = $options->header_image_alt ?? '';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
Expand Down Expand Up @@ -185,7 +186,7 @@
<?php if ( $header_img_url ): ?>
<a href="<?php echo $header_img_url; ?>">
<?php endif; ?>
<img class="img-fluid" width="640" src="<?php echo $header_img; ?>" alt="TODO: Placeholder alt that describes what this email/image is" style="max-width: 100%;">
<img class="img-fluid" width="640" src="<?php echo $header_img; ?>" alt="<?php echo esc_attr( $header_image_alt ); ?>" style="max-width: 100%;">
<?php if ( $header_img_url ): ?>
</a>
<?php endif; ?>
Expand Down

0 comments on commit a447a8c

Please sign in to comment.