Skip to content

Commit

Permalink
Pass '/' as an argument to home_url(), preventing possible 404.
Browse files Browse the repository at this point in the history
In response to a support topic,
where the link wrapping the home logo in
legacy templating lead to a 404 page.
According to the documentation for home_url(),
passing the '/' argument is the default usage.
@see https://wordpress.org/support/topic/need-to-add-slash-to-end-of-url/#post-10293713
  • Loading branch information
kienstra authored and westonruter committed May 18, 2018
1 parent c65cbf8 commit 62483f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion includes/templates/class-amp-post-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function __construct( $post ) {

'document_title' => function_exists( 'wp_get_document_title' ) ? wp_get_document_title() : wp_title( '', false ), // Back-compat with 4.3.
'canonical_url' => get_permalink( $this->ID ),
'home_url' => home_url(),
'home_url' => home_url( '/' ),
'blog_name' => get_bloginfo( 'name' ),

'html_tag_attributes' => array(),
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Follow along with or [contribute](https://github.com/Automattic/amp-wp/blob/deve
- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). Props westonruter.
- Force VideoPress to use html5 player for AMP. See [#1125](https://github.com/Automattic/amp-wp/pull/1125). Props yurynix.
- Soft-deprecate `AMP_Base_Sanitizer::get_body_node()` instead of hard-deprecating it (with triggered notice). See [#1141](https://github.com/Automattic/amp-wp/pull/1141). Props westonruter.
- Pass '/' as an argument to home_url(), preventing possible 404. See [#1158](https://github.com/Automattic/amp-wp/issues/1158), [#1161](https://github.com/Automattic/amp-wp/pull/1161). Props kienstra.

See [0.7.1 milestone](https://github.com/Automattic/amp-wp/milestone/8?closed=1).

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Follow along with or [contribute](https://github.com/Automattic/amp-wp/blob/deve
- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). Props westonruter.
- Force VideoPress to use html5 player for AMP. See [#1125](https://github.com/Automattic/amp-wp/pull/1125). Props yurynix.
- Soft-deprecate `AMP_Base_Sanitizer::get_body_node()` instead of hard-deprecating it (with triggered notice). See [#1141](https://github.com/Automattic/amp-wp/pull/1141). Props westonruter.
- Pass '/' as an argument to home_url(), preventing possible 404. See [#1158](https://github.com/Automattic/amp-wp/issues/1158), [#1161](https://github.com/Automattic/amp-wp/pull/1161). Props kienstra.

See [0.7.1 milestone](https://github.com/Automattic/amp-wp/milestone/8?closed=1).

Expand Down

0 comments on commit 62483f0

Please sign in to comment.