I'm trying to render meta, icons, and app store code in the head from my plugin, but it got rejected by the WordPress plugin review team:
Please use wp_enqueue commands
This is what I'm trying to add:
add_action('wp_head', array(&$this, 'add_meta'));
public function add_meta() {
global $post;
$url = $_SERVER['HTTP_HOST'] . rtrim($_SERVER['REQUEST_URI'], '/');
// Smart App Banner for Safari and iOS
echo '<meta name="apple-itunes-app" content="app-id=' . $this->getOption('iOSID') . ', app-argument=' . 'http://' . $url . '">';
// Google App Indexing
echo '<link rel="alternate" href="android-app://' . $this->getOption('AndroidID') . '/' . 'http/' . $url . '" />';
echo '<link rel="alternate" href="ios-app://' . $this->getOption('iOSID') . '/' . 'http/' . $url . '" />';
// App Icons
echo '<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">';
echo '<link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">';
echo '<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">';
echo '<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">';
echo '<link rel="manifest" href="/manifest.json">';
echo '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">';
echo '<meta name="msapplication-TileColor" content="#da532c">';
echo '<meta name="msapplication-TileImage" content="/mstile-144x144.png">';
}
However, I don't see a way these special link
and meta
tags can be done with wp_enqueue_style
. What's the correct "WordPress" way of doing this from a plugin?