PluginProbe
Social Share Buttons / 1.5
Social Share Buttons v1.5
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
← All changes | classes/class-collection.php +7 -48 1.201.5 View file →
@@ -1,11 +1,11 @@
1 1 <?php
2 2 namespace MBSocial;
3 3 defined('ABSPATH') or die('No direct access permitted');
4 4
5 -use \MaxButtons\maxUtils as maxUtils;
6 -use \MaxButtons\maxCSSParser as maxCSSParser;
7 -use \MaxButtons\simple_html_dom as simple_html_dom;
5 +use \maxbuttons\maxUtils as maxUtils;
6 +use \maxbuttons\maxCSSParser as maxCSSParser;
7 +use \simple_html_dom as simple_html_dom;
8 8
9 9
10 10 class collection
11 11 {
@@ -59,9 +59,9 @@
59 59 $block = collections::getBlock($block_name);
60 60 if ($block)
61 61 {
62 62 $block->setCollection($this);
63 - $default_data = $block->save_fields($default_data, array() ); // force the fields to set a default pos.
63 + $default_data = $block->save_fields($default_data, null ); // force the fields to set a default pos.
64 64
65 65 $this->blocks[$block_name] = $block;
66 66
67 67 }
@@ -296,23 +296,8 @@
296 296 elseif (isset($meta['general']['active']) && $is_old_active === 0) // backward for 0.9.5 . Can go at some point
297 297 $this->is_showable = false;
298 298 }
299 299
300 -
301 - if ( Install::isPRO() ) {
302 - $show_mobile = (isset($data['display']['show_mobile']) && $data['display']['show_mobile'] == 0) ? false: true;
303 - $show_desktop = (isset($data['display']['show_desktop']) && $data['display']['show_desktop'] == 0) ? false: true;
304 -
305 - if ($this->is_mobile && ! $show_mobile)
306 - {
307 - $this->is_showable = false;
308 - }
309 - if ($this->is_desktop && ! $show_desktop)
310 - {
311 - $this->is_showable = false;
312 - }
313 - }
314 -
315 300 // new method of getting data around
316 301 $w->tell('display/env/hook', $hook);
317 302 $w->tell('display/env/post_id', $this->post_id);
318 303 $w->tell('display/env/is_static', $this->is_static );
@@ -624,14 +609,14 @@
624 609 {
625 610 if (! $this->is_showable)
626 611 return;
627 612
628 - /* 1.8 Deprecated. Not included in MB() anymore, using svg method.
613 +
629 614 if (method_exists(MB(), 'load_library'))
630 615 {
631 616 MB()->load_library('fontawesome'); // always load lib since change is about 100% this includes FA.
632 617 }
633 - */
618 +
634 619 maxUtils::startTime('collection-display-' . self::$count);
635 620
636 621 $w = MBSocial()->whistle();
637 622
@@ -691,23 +676,8 @@
691 676 }
692 677
693 678 }
694 679
695 - public function getDisplayCSS($doc_id = false) // For file output
696 - {
697 - $key = '_parsed_css';
698 -
699 - if ($doc_id)
700 - $key .= '_' . $doc_id;
701 -
702 - $meta = $this->get_meta($key);
703 - if (is_array($meta))
704 - return array_shift($meta);
705 - else
706 - return false;
707 -
708 - }
709 -
710 680 public function displayCSS($css, $args = array() ) // $echo = true, $style_tag = true)
711 681 {
712 682
713 683 $default = array(
@@ -719,14 +689,13 @@
719 689 if ($args['load_type'] == 'inline')
720 690 $args['style_tag'] =true;
721 691
722 692 $output = '';
723 - $css = apply_filters('mbsocial/displaycss/', $css);
724 693
725 694 if ($args["style_tag"])
726 695 $output .= "<style type='text/css'>";
727 696
728 - $output .= $css;
697 + $output .= apply_filters('mbsocial/displaycss/', $css);
729 698
730 699 if ($args["style_tag"])
731 700 $output .= "</style>";
732 701
@@ -734,22 +703,13 @@
734 703 if ($args["load_type"] == 'footer')
735 704 {
736 705 $load_id = 'collection-' . $this->collection_id; // must be unique for unique items, otherwise css won't be output
737 706
738 - $use_file = get_option('maxbuttons_usecssfile', false);
739 - if ($use_file)
740 - {
741 -
742 - wp_enqueue_style('maxbuttons-social-front-' . self::$count, admin_url('admin-ajax.php').'?action=maxbuttons_social_css&id=' . $this->collection_id . '&doc=' . self::$count) ;
743 - $this->update_meta($this->collection_id, '_parsed_css_' . self::$count, $css);
744 - }
745 -
746 707 if (self::$count > 1)
747 708 {
748 709 $load_id .= "-" . self::$count;
749 710 }
750 711
751 -
752 712 do_action('mb-footer',$load_id, $output);
753 713 }
754 714 elseif ($args["load_type"] == 'inline')
755 715 {
@@ -984,9 +944,8 @@
984 944 $css = $this->styleObj->preParse($css);
985 945 $css = apply_filters('mbsocial/parsecss/', $css); // anybody else
986 946
987 947 $css = $this->getCSSParser()->parse($css);
988 -
989 948 maxUtils::endTime('collection-parseCSS-'. self::$count);
990 949 return $css;
991 950 }
992 951