This repository was archived by the owner on Nov 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-smartappbanner.php
More file actions
31 lines (31 loc) · 1.29 KB
/
set-smartappbanner.php
File metadata and controls
31 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/*
Plugin Name: WP-SmartAppBanner
Plugin URI: https://christianoliff.com/wp-plugins/wp-smartappbanner/
Description: Displays a Smart App Banner to your site to promote your iPhone/iPad app (iOS 6 required to see the Smart App Banner)
Version: 1.1.4
Author: C.Oliff
Author URI: https://christianoliff.com
*/
add_option('set_ios_app_value', 'nothing');
add_action('wp_head', 'set_ios_app_do');
add_action('admin_menu', 'set_ios_app_menu');
function set_ios_app_do(){
echo '<meta name="apple-itunes-app" content="app-id=' . get_option('set_ios_app_value') . '">';
}
function set_ios_app_menu(){
add_options_page( 'Set SmartAppBanner', 'Set SmartAppBanner', 'manage_options', 'set_ios_app', 'set_ios_app_value_admin');
}
function set_ios_app_value_admin(){
echo '<div class="wrap">';
if(isset($_REQUEST["ios_app_value"])){
update_option('set_ios_app_value', $_REQUEST["ios_app_value"]);
echo '<b>Settings Updated!</b>';
}
echo '<p><form name="set_ios_app" action="" method="post"></p>';
echo '<p>iOS App ID: <input type="text" placeholder="e.g. 123456789" pattern="\d*" inputmode="numeric" minlength="9" name="ios_app_value" value="' . get_option('set_ios_app_value') . '" required /></p>';
echo '<p><input type="submit" value="Save Changes"></p>';
echo '<p></form></p>';
echo '</div>';
}
?>