Skip to content

Commit

Permalink
Merge pull request #305 from ethitter/add/manifest-url-helper
Browse files Browse the repository at this point in the history
Add manifest-URL helper
  • Loading branch information
westonruter authored Jul 7, 2020
2 parents 77c0944 + 24f1267 commit a518032
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wp-includes/class-wp-web-app-manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function init() {
public function manifest_link_and_meta() {
$manifest = $this->get_manifest();
?>
<link rel="manifest" href="<?php echo esc_url( rest_url( self::REST_NAMESPACE . self::REST_ROUTE ) ); ?>">
<link rel="manifest" href="<?php echo esc_url( static::get_url() ); ?>">
<meta name="theme-color" content="<?php echo esc_attr( $manifest['theme_color'] ); ?>">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
Expand Down Expand Up @@ -338,4 +338,13 @@ public function get_icons() {
public function sort_icons_callback( $a, $b ) {
return (int) strtok( $a['sizes'], 'x' ) - (int) strtok( $b['sizes'], 'x' );
}

/**
* Return manifest URL.
*
* @return string
*/
public static function get_url() {
return rest_url( self::REST_NAMESPACE . self::REST_ROUTE );
}
}

0 comments on commit a518032

Please sign in to comment.