public static function get_options_by_mp($selectedPt)
 {
     global $post;
     $result = array();
     $result['active'] = true;
     $options = get_option(EasySocialShareButtons::$plugin_settings_name);
     $options_by_bp = array();
     if (is_array($options)) {
         if (isset($options['opt_by_mp'])) {
             $options_by_bp = $options['opt_by_mp'];
         }
     }
     $pt_networks = isset($options_by_bp[$selectedPt . '_networks']) ? $options_by_bp[$selectedPt . '_networks'] : array();
     if (count($pt_networks) > 0) {
         $result['networks'] = $pt_networks;
     }
     $pt_names = isset($options_by_bp[$selectedPt . '_names']) ? $options_by_bp[$selectedPt . '_names'] : array();
     if (count($pt_names) > 0) {
         $result['names'] = $pt_names;
     }
     $pt_fullwidth = isset($options_by_bp[$selectedPt . '_fullwidth']) ? $options_by_bp[$selectedPt . '_fullwidth'] : '';
     if ($pt_fullwidth != '') {
         if ($pt_fullwidth == "yes") {
             $result['fullwidth'] = true;
         } else {
             $result['fullwidth'] = false;
         }
         $pt_fullwidth_value = isset($options_by_bp[$selectedPt . '_fullwidth_value']) ? $options_by_bp[$selectedPt . '_fullwidth_value'] : '';
         if ($pt_fullwidth_value != '') {
             $result['fullwidth_value'] = $pt_fullwidth_value;
         }
     }
     $pt_hidenames = isset($options_by_bp[$selectedPt . '_hidenames']) ? $options_by_bp[$selectedPt . '_hidenames'] : '';
     if ($pt_hidenames != '') {
         if ($pt_hidenames == "yes") {
             $result['hidenames'] = '1';
         } else {
             $result['hidenames'] = '0';
         }
     }
     $pt_counters = isset($options_by_bp[$selectedPt . '_counters']) ? $options_by_bp[$selectedPt . '_counters'] : '';
     if ($pt_counters != '') {
         if ($pt_counters == "yes") {
             $result['counters'] = '1';
         } else {
             $result['counters'] = '0';
         }
     }
     $pt_counters_pos = isset($options_by_bp[$selectedPt . '_counters_pos']) ? $options_by_bp[$selectedPt . '_counters_pos'] : '';
     if ($pt_counters_pos != '') {
         $result['counters_pos'] = $pt_counters_pos;
     }
     $pt_total_counters_pos = isset($options_by_bp[$selectedPt . '_total_counters_pos']) ? $options_by_bp[$selectedPt . '_total_counters_pos'] : '';
     if ($pt_total_counters_pos != '') {
         $result['total_counters_pos'] = $pt_total_counters_pos;
     }
     $pt_template = isset($options_by_bp[$selectedPt . '_template']) ? $options_by_bp[$selectedPt . '_template'] : '';
     if ($pt_template != '') {
         $result['template'] = EasySocialShareButtons_Advanced_Display::get_template_slug($pt_template);
     }
     return $result;
 }
Beispiel #2
0
 function set_options_by_bp_activate_state()
 {
     $this->options_by_bp_active = EasySocialShareButtons_Advanced_Display::get_options_by_bp_activate_state();
 }