Notes
Notes - notes.io |
/*
* Plugin Name: My Banner Plugin
* Plugin URI: https://my-banner-pluing.com/
* Description: Handle a basic banner with this plugin.
* Version: 1.0.0
* Requires at least: 5.6
* Requires PHP: 7.2
* Author: Lukman Nakib
* Author URI: https://author.example.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://example.com/my-plugin/
* Text Domain: my-banner-plugin
* Domain Path: /languages
*/
class Menu
{
public function __construct()
{
add_action('admin_menu', array($this, 'add_plugin_menu'));
}
public function add_plugin_menu()
{
add_menu_page(
'My Banner Plugin',
'My Banner Plugin',
'manage_options',
'my-banner-plugin',
array($this, 'display_plugin_page'),
'dashicons-admin-plugins',
99
);
}
public function display_plugin_page()
{
// Enqueue JavaScript file
wp_enqueue_script('my-banner-plugin-script', plugin_dir_url(__FILE__) . 'banner-script.js', array('jquery'), '1.0', true);
// Localize script with required settings
wp_localize_script('my-banner-plugin-script', 'my_plugin_settings', array(
'ajax_url' => admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('my_banner_plugin_nonce'),
));
$settings = get_option('my_banner_settings');
$banner_title = isset($settings['banner_title']) ? $settings['banner_title'] : '';
$description = isset($settings['description']) ? $settings['description'] : '';
$enabled = isset($settings['enabled']) && $settings['enabled'] == 'yes' ?'checked' : '';
echo '<form><table class="form-table" >
<tbody>
<tr>
<th ><label for="banner_title">Site Title</label></th><td><input value="'.$banner_title.'" name="banner_title" type="text" id="banner_title" class="regular-text"></td>
</tr>
<tr>
<th ><label for="description">Description</label></th>
<td><textarea id="banner_description" name="description" class="regular-text">'.$description.'</textarea>
<p class="description" >Banner title and description</p>
</td>
</tr>
<tr>
<th></th>
<td> <input type="checkbox" '.$enabled.' id="enabled" name="enable" value="yes"> Enable</td>
</tr>
<tr>
<th></th>
<td> <button class="submit"><input type="submit" name="submit" id="submit-banner-plugin-settings" class="button button-primary" value="Save Changes"></button> </td>
</tr>
</tbody>
</table></form>';
}
}
new Menu();
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team
