*/ 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. */ if (isset($_GET['page']) && !empty($_GET['page']) && ($_GET['page'] == 'add_social_share_buttons')) { 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. */ if (isset($_GET['page']) && !empty($_GET['page']) && ($_GET['page'] == 'add_social_share_buttons')) { 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_localize_script('add-social-share-buttons-plugin-admin', 'pagevisit', array('ajaxurl' => admin_url('admin-ajax.php'))); //get settings option $get_share_settings = get_option(ADSSB_PLUGIN_GLOBAL_SETTING_KEY); $get_share_settings = maybe_unserialize($get_share_settings); if (!empty($get_share_settings['share_posttype']) || $get_share_settings['share_posttype'] != "") { $options = !empty($get_share_settings['share_posttype']) ? $get_share_settings['share_posttype'] : json_encode(array()); if (!empty($options) || $options != "") { wp_localize_script('add-social-share-buttons-plugin-admin', 'get_post_option_share', array('optionsarray' => json_encode($options))); } else { wp_localize_script('add-social-share-buttons-plugin-admin', 'get_post_option_share', array('optionsarray' => '')); } } else { $post_types = get_post_types(); wp_localize_script('add-social-share-buttons-plugin-admin', 'get_post_option_share', array('optionsarray' => '')); //json_encode($post_types)) } 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, 'add-social-share-buttons-plugin'), '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() { //get settings option $get_share_settings = get_option(ADSSB_PLUGIN_GLOBAL_SETTING_KEY); $get_share_settings = maybe_unserialize($get_share_settings); $get_services = get_option(ADSSB_PLUGIN_ADD_SOCIAL_BUTTIN_KEY); $get_services = maybe_unserialize($get_services); $sharesmallimagearray = array(); $sharesmallimagearray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_small.png'; $sharesmallimagearray['Viber'] = ASSB_PATH . '/images/viber_small.png'; $sharesmallimagearray['Facebook'] = ASSB_PATH . '/images/facebook_small.png'; $sharesmallimagearray['Twitter'] = ASSB_PATH . '/images/twitter_small.png'; $sharesmallimagearray['Google_plus'] = ASSB_PATH . '/images/googleplus_small.png'; $sharesmallimagearray['Linkedin'] = ASSB_PATH . '/images/linkedin_small.png'; $sharemediumimagearray = array(); $sharemediumimagearray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_medium.png'; $sharemediumimagearray['Viber'] = ASSB_PATH . '/images/viber_medium.png'; $sharemediumimagearray['Facebook'] = ASSB_PATH . '/images/facebook_medium.png'; $sharemediumimagearray['Twitter'] = ASSB_PATH . '/images/twitter_medium.png'; $sharemediumimagearray['Google_plus'] = ASSB_PATH . '/images/googleplus_medium.png'; $sharemediumimagearray['Linkedin'] = ASSB_PATH . '/images/linkedin_medium.png'; $sharelargeagearray = array(); $sharelargeagearray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_large.png'; $sharelargeagearray['Viber'] = ASSB_PATH . '/images/viber_large.png'; $sharelargeagearray['Facebook'] = ASSB_PATH . '/images/facebook_large.png'; $sharelargeagearray['Twitter'] = ASSB_PATH . '/images/twitter_large.png'; $sharelargeagearray['Google_plus'] = ASSB_PATH . '/images/googleplus_large.png'; $sharelargeagearray['Linkedin'] = ASSB_PATH . '/images/linkedin_large.png'; ?>

1) { ?>
$values) { if ($get_share_settings['share_button_size'] != '' && !empty($get_share_settings['share_button_size'])) { if ($get_share_settings['share_button_size'] == 'small') { ?><?php echo esc_attr($values); ?><?php echo esc_attr($values); ?><?php echo esc_attr($values); ?><?php echo esc_attr($values); ?>
'; if (isset($post_types) && !empty($post_types)) { foreach ($post_types as $cpost) { if ($cpost != "attachment" && $cpost != "revision" && $cpost != "nav_menu_item" && $cpost != "product_variation" && $cpost != "shop_order" && $cpost != "shop_order_refund" && $cpost != "shop_coupon" && $cpost != "shop_webhook" && $cpost != "scheduled-action" && $cpost != "shop_subscription" && $cpost != "wpcf7_contact_form" && $cpost != "mc4wp-form") { $html .=''; } } } $html .='( ' . __(ADSSB_PLUGIN_POSTTYPE_NOTE, 'add-social-share-buttons-plugin') . ' )'; echo $html; ?>
type="checkbox" name="include_listing_page" value="1" >

'wp-add-social-share-buttons&tab=about'), admin_url('index.php'))); } public function welcome_pages_screen_assb() { add_dashboard_page( 'Add Social Share Buttons Plugin Dashboard', 'Add Social Share Buttons Plugin Dashboard', 'read', 'wp-add-social-share-buttons', array(&$this, 'welcome_screen_content_assb') ); } public function welcome_screen_content_assb() { ?>

version); ?>
"Overview", "other_plugins" => "Checkout our other plugins")); $current_tab_wc = (isset($_GET['tab'])) ? sanitize_text_field($_GET['tab']) : 'general'; // $aboutpage = isset($_GET['page']) unused variable ?> $setting_tabvalue) { switch ($setting_tabkey_wc) { case $current_tab_wc: do_action('woocommerce_assb_' . $current_tab_wc); break; } } ?>

' . __('Welcome to Add Social Share Messenger Buttons Whatsapp and Viber', 'add-social-share-buttons') . ''; $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.', 'add-social-share-buttons') . '

'; return array( $prefix . 'assb_notice_view' => array( 'content' => $new_pointer_content, 'anchor_id' => '#adminmenu', 'edge' => 'left', 'align' => 'left', 'active' => (!in_array($prefix . 'assb_notice_view', $dismissed) ) ) ); }