*/ add_action( 'wp_enqueue_scripts', 'simple_banner' ); function simple_banner() { // Enqueue the style wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css'); wp_enqueue_style('simple-banner-style'); // Enqueue the script wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js', array( 'jquery' )); wp_enqueue_script('simple-banner-script'); if (get_option('pro_version_enabled')) { wp_register_script('simple-banner-pro-script', plugin_dir_url( __FILE__ ) . 'simple-banner-pro.js'); wp_enqueue_script('simple-banner-pro-script'); } } //add custom CSS colors add_action( 'wp_head', 'simple_banner_custom_color'); function simple_banner_custom_color() { if (get_option('simple_banner_color') != ""){ echo '"; } if (get_option('simple_banner_text_color') != ""){ echo '"; } if (get_option('simple_banner_link_color') != ""){ echo '"; } if (get_option('simple_banner_custom_css') != ""){ echo '"; } if (get_option('site_custom_css') != "" && get_option('pro_version_enabled')) { echo '"; } if (get_option('site_custom_js') != "" && get_option('pro_version_enabled')) { echo '"; } } //add custom banner text add_action( 'wp_head', 'simple_banner_custom_text'); function simple_banner_custom_text() { if (get_option('simple_banner_text') != ""){ if (!get_option('pro_version_enabled') || (get_option('pro_version_enabled') && !in_array(get_the_ID(), explode(",", get_option('disabled_pages_array'))))){ echo ''; } } } add_action('admin_menu', 'simple_banner_menu'); function simple_banner_menu() { add_menu_page('Simple Banner Settings', 'Simple Banner', 'administrator', 'simple-banner-settings', 'simple_banner_settings_page', 'dashicons-admin-generic'); } add_action( 'admin_init', 'simple_banner_settings' ); function simple_banner_settings() { register_setting( 'simple-banner-settings-group', 'simple_banner_color' ); register_setting( 'simple-banner-settings-group', 'simple_banner_text_color' ); register_setting( 'simple-banner-settings-group', 'simple_banner_link_color' ); register_setting( 'simple-banner-settings-group', 'simple_banner_text' ); register_setting( 'simple-banner-settings-group', 'simple_banner_custom_css' ); register_setting( 'simple-banner-settings-group', 'pro_version_activation_code' ); register_setting( 'simple-banner-settings-group', 'pro_version_enabled' ); register_setting( 'simple-banner-settings-group', 'disabled_pages_array' ); register_setting( 'simple-banner-settings-group', 'site_custom_css' ); register_setting( 'simple-banner-settings-group', 'site_custom_js' ); } function simple_banner_settings_page() { ?>
DONATE

Simple Banner Settings

Use Hex color values for the color fields.

Links in the banner text must be typed in with HTML <a> tags.
e.g. This is a <a href="http://www.wordpress.com">Link to Wordpress</a>.

This is what your banner will look like with a link.

*Note: Font and text styles subject to change based on chosen theme CSS.
Simple Banner Background Color
(Leaving this blank sets the color to the default value #024985)
Simple Banner Text Color
(Leaving this blank sets the color to the default value white)
Simple Banner Link Color
(Leaving this blank sets the color to the default value #f16521)
Simple Banner Text
(Leaving this blank removes the banner)
Simple Banner Custom CSS
CSS will be applied directly to the simple-banner class.
Be very careful, bad CSS can break the banner.
.simple-banner {
}

Pro Features Purchase Pro Version'; } ?>

Activation Code
Disabled Pages
Disable Simple Banner on the following pages.
'; $parent_checkbox .= get_option( 'blogname' ) . ' | ' . get_site_url() . ' '; $parent_checkbox .= '
'; echo $parent_checkbox; foreach ( $pages as $page ) { $checkbox = 'ID, explode(",", $disabled_pages_array))) ? 'checked ' : ''; $checkbox .= 'value="' . $page->ID . '">'; $checkbox .= $page->post_title . ' | ' . get_page_link( $page->ID ) . ' '; $checkbox .= '
'; echo $checkbox; } ?>
'; } ?>
Website Custom CSS
CSS will be applied to the entire website
'. get_option('site_custom_css') . ''; } else { echo ''; } ?>
Website Custom JS
JavaScript will be applied to the entire website
'. get_option('site_custom_js') . ''; } else { echo ''; } ?>