*/ class Add_Social_Share_Buttons_Plugin_Public { /** * 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 the 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 public-facing side of the site. * * @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($this->plugin_name, plugin_dir_url(__FILE__) . 'css/add-social-share-buttons-plugin-public.css', array(), $this->version, 'all'); } /** * Register the JavaScript for the public-facing side of the site. * * @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($this->plugin_name, plugin_dir_url(__FILE__) . 'js/add-social-share-buttons-plugin-public.js', array('jquery'), $this->version, false); } /** * function for display share button option in front view * * @param get page content $content * @return return share button added html content */ public function insert_share_option_in_front_view($content) { global $wpdb, $wp, $post; //get whatspp share settings option $get_share_settings = get_option(ADSSB_PLUGIN_GLOBAL_SETTING_KEY); //whatspp share settings option unserialize $get_share_settings = maybe_unserialize($get_share_settings); //get current page or post post type $getPostType = $post->post_type; $html = ''; //share button icon array $sharebuttonArray = array(); //check share button size small if ($get_share_settings['share_button_size'] == 'small') { //create buton small size image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_small.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_small.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_small.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_small.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_small.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_small.png'; //check button medium size } elseif ($get_share_settings['share_button_size'] == 'medium') { //create buton medium medium image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_medium.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_medium.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_medium.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_medium.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_medium.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_medium.png'; //check button large size } elseif ($get_share_settings['share_button_size'] == 'large') { //create buton large image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_large.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_large.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_large.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_large.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_large.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_large.png'; } //creta arry for share social button url //check not empty or not null share settings if (!empty($get_share_settings) && $get_share_settings != '') { //check posttype availble if (!empty($get_share_settings['share_posttype']) && $get_share_settings['share_posttype'] != '') { if ($getPostType != 'product') { if (in_array($getPostType, $get_share_settings['share_posttype'])) { $html = ''; //get whatsapp share services option $get_services = get_option(ADSSB_PLUGIN_ADD_SOCIAL_BUTTIN_KEY); //whatspp share settings option unserialize $get_services = maybe_unserialize($get_services); //check share button not null or not empty if ($get_services['share_button'] != '' && !empty($get_services['share_button'])) { //create share buttom html $html .='
'; $html .=''; } //script for social share ?> post_type; //get page requert url $requestPageUrl = site_url($_SERVER['REQUEST_URI']); //trim page requert url $pageTitletrim = rtrim($_SERVER['REQUEST_URI'], '/'); $pageTitletrim = ltrim($pageTitletrim, '/'); //explode page requert url $explodePageTitle = explode("/", $pageTitletrim); //get array last value $explodePageTitle = end($explodePageTitle); //string replace $explodePageTitle = str_replace("-", " ", $explodePageTitle); //string first character capital $pageTitle = ucwords($explodePageTitle); $html = ''; //share button icon array //create share button array $sharebuttonArray = array(); //check button small size if ($get_share_settings['share_button_size'] == 'small') { //create buton small size image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_small.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_small.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_small.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_small.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_small.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_small.png'; //check button medium size } elseif ($get_share_settings['share_button_size'] == 'medium') { //create buton medium medium image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_medium.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_medium.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_medium.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_medium.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_medium.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_medium.png'; //check button large size } elseif ($get_share_settings['share_button_size'] == 'large') { //create buton large image $sharebuttonArray['Whatsapp'] = ASSB_PATH . '/images/whatsapp_large.png'; $sharebuttonArray['Viber'] = ASSB_PATH . '/images/viber_large.png'; $sharebuttonArray['Facebook'] = ASSB_PATH . '/images/facebook_large.png'; $sharebuttonArray['Twitter'] = ASSB_PATH . '/images/twitter_large.png'; $sharebuttonArray['Google_plus'] = ASSB_PATH . '/images/googleplus_large.png'; $sharebuttonArray['Linkedin'] = ASSB_PATH . '/images/linkedin_large.png'; } //create share button redirect url array $html = ''; //get whatsapp share option $get_services = get_option(ADSSB_PLUGIN_ADD_SOCIAL_BUTTIN_KEY); //unserialize whatsapp share option $get_services = maybe_unserialize($get_services); //check share button size if ($get_share_settings['share_button_size'] != '' && !empty($get_share_settings['share_button_size'])) { //check share button not null or not empty if ($get_services['share_button'] != '' && !empty($get_services['share_button'])) { //create share button html $html .=''; $html .=''; echo $html; } } //add social share button script ?> ' . wp_kses_post($get_share_settings['include_custom_styles']) . ''; } } /** * BN code added */ function paypal_bn_code_filter_assb($paypal_args) { $paypal_args['bn'] = 'Multidots_SP'; return $paypal_args; } }