*/
class Add_Social_Share_Buttons_Plugin_Admin {
/**
* The ID of this plugin.
*
* @since 1.0.0
* @access private
* @var string $plugin_name The ID of this plugin.
*/
private $plugin_name;
/**
* The version of this plugin.
*
* @since 1.0.0
* @access private
* @var string $version The current version of this plugin.
*/
private $version;
/**
* Initialize the class and set its properties.
*
* @since 1.0.0
* @param string $plugin_name The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct($plugin_name, $version) {
$this->plugin_name = $plugin_name;
$this->version = $version;
}
/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Add_Social_Share_Buttons_Plugin_Loader as all of the hooks are defined
* in that particular class.
*
* The Add_Social_Share_Buttons_Plugin_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_style('wp-pointer');
wp_enqueue_style('add-social-share-buttons-plugin-admin', plugin_dir_url(__FILE__) . 'css/add-social-share-buttons-plugin-admin.css', array('wp-jquery-ui-dialog'), $this->version, 'all');
wp_enqueue_style('chosen-css', plugin_dir_url(__FILE__) . 'css/chosen.css', array(), $this->version, 'all');
wp_enqueue_script('wp-pointer');
}
/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {
/**
* This function is provided for demonstration purposes only.
*
* An instance of this class should be passed to the run() function
* defined in Add_Social_Share_Buttons_Plugin_Loader as all of the hooks are defined
* in that particular class.
*
* The Add_Social_Share_Buttons_Plugin_Loader will then create the relationship
* between the defined hooks and the functions defined in this
* class.
*/
wp_enqueue_script('jquery-ui-sortable');
wp_enqueue_script('add-social-share-buttons-plugin-admin', plugin_dir_url(__FILE__) . 'js/add-social-share-buttons-plugin-admin.js', array('jquery', 'jquery-ui-dialog'), $this->version, false);
wp_enqueue_script('jquery-validate-min', plugin_dir_url(__FILE__) . 'js/jquery.validate.min.js', $this->version, false);
wp_enqueue_script('chosen-jquery-js', plugin_dir_url(__FILE__) . 'js/chosen.jquery.js', '4.5.2');
}
/**
* add plugin main menu in admin menu
*
*/
public function whatsapp_sharing_custom_menu() {
//add admin main Crea plugins menu
add_submenu_page('options-general.php', ADSSB_PLUGIN_PAGE_MENU_TITLE, __(ADSSB_PLUGIN_NAME, ADSSB_PLUGIN_SLUG), 'manage_options', ADSSB_PLUGIN_PAGE_MENU_SLUG, 'custom_whatsapp_sharing_setting_html');
/**
* function for plugin admin menu callback html function
*/
function custom_whatsapp_sharing_setting_html() {
global $wpdb;
$current_user = wp_get_current_user();
if (!get_option('assb_plugin_notice_shown')) {
echo '
Subscribe for latest plugin update and get notified when we update our plugin and launch new products for free!
' . __('Welcome to Add Social Share Messenger Buttons Whatsapp and Viber') . '';
$new_pointer_content .= '
' . __('Easy to Add Social Share Buttons in Custom Post, Page and Product page. Add social buttons to share your posts for Whatsapp Facebook, Twitter, Google+, Pinterest, and Linkedin. Automatically display buttons on page, post and product page.') . '