-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from SuperPWA/branch-1.8
Branch 1.8
- Loading branch information
Showing
16 changed files
with
967 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
/** | ||
* Apple Touch Icons | ||
* | ||
* @since 1.8 | ||
* | ||
* @function superpwa_ati_add_apple_touch_icons() Add Apple Touch Icons to the wp_head | ||
*/ | ||
|
||
// Exit if accessed directly | ||
if ( ! defined( 'ABSPATH' ) ) exit; | ||
|
||
/** | ||
* Add Apple Touch Icons to the wp_head | ||
* | ||
* Uses the Application Icon and Splash Screen Icon for SuperPWA > Settings | ||
* and adds them to wp_head using the superpwa_wp_head_tags filter. | ||
* | ||
* @param (string) $tags HTML element tags passed on by superpwa_wp_head_tags | ||
* | ||
* @return (string) Appends the Apple Touch Icons to the existing tag string | ||
* | ||
* @since 1.8 | ||
*/ | ||
function superpwa_ati_add_apple_touch_icons( $tags ) { | ||
|
||
// Get the icons added via SuperPWA > Settings | ||
$icons = superpwa_get_pwa_icons(); | ||
|
||
foreach( $icons as $icon ) { | ||
$tags .= '<link rel="apple-touch-icon" sizes="' . $icon['sizes'] . '" href="' . $icon['src'] . '">' . PHP_EOL; | ||
} | ||
|
||
return $tags; | ||
} | ||
add_filter( 'superpwa_wp_head_tags', 'superpwa_ati_add_apple_touch_icons' ); |
Oops, something went wrong.