| @@ -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 \simple_html_dom as simple_html_dom; | |
| 5 | +use \MaxButtons\maxUtils as maxUtils; | |
| 6 | +use \MaxButtons\maxCSSParser as maxCSSParser; | |
| 7 | +use \MaxButtons\simple_html_dom as simple_html_dom; | |
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | class collection |
| 11 | 11 | { |
| @@ -296,8 +296,9 @@ | ||
| 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 | + | |
| 300 | 301 | if ( Install::isPRO() ) { |
| 301 | 302 | $show_mobile = (isset($data['display']['show_mobile']) && $data['display']['show_mobile'] == 0) ? false: true; |
| 302 | 303 | $show_desktop = (isset($data['display']['show_desktop']) && $data['display']['show_desktop'] == 0) ? false: true; |
| 303 | 304 | |
| @@ -309,8 +310,9 @@ | ||
| 309 | 310 | { |
| 310 | 311 | $this->is_showable = false; |
| 311 | 312 | } |
| 312 | 313 | } |
| 314 | + | |
| 313 | 315 | // new method of getting data around |
| 314 | 316 | $w->tell('display/env/hook', $hook); |
| 315 | 317 | $w->tell('display/env/post_id', $this->post_id); |
| 316 | 318 | $w->tell('display/env/is_static', $this->is_static ); |
| @@ -622,9 +624,8 @@ | ||
| 622 | 624 | { |
| 623 | 625 | if (! $this->is_showable) |
| 624 | 626 | return; |
| 625 | 627 | |
| 626 | - | |
| 627 | 628 | /* 1.8 Deprecated. Not included in MB() anymore, using svg method. |
| 628 | 629 | if (method_exists(MB(), 'load_library')) |
| 629 | 630 | { |
| 630 | 631 | MB()->load_library('fontawesome'); // always load lib since change is about 100% this includes FA. |
| @@ -690,11 +691,16 @@ | ||
| 690 | 691 | } |
| 691 | 692 | |
| 692 | 693 | } |
| 693 | 694 | |
| 694 | - public function getDisplayCSS() // For file output | |
| 695 | + public function getDisplayCSS($doc_id = false) // For file output | |
| 695 | 696 | { |
| 696 | - $meta = $this->get_meta('_parsed_css'); | |
| 697 | + $key = '_parsed_css'; | |
| 698 | + | |
| 699 | + if ($doc_id) | |
| 700 | + $key .= '_' . $doc_id; | |
| 701 | + | |
| 702 | + $meta = $this->get_meta($key); | |
| 697 | 703 | if (is_array($meta)) |
| 698 | 704 | return array_shift($meta); |
| 699 | 705 | else |
| 700 | 706 | return false; |
| @@ -713,13 +719,14 @@ | ||
| 713 | 719 | if ($args['load_type'] == 'inline') |
| 714 | 720 | $args['style_tag'] =true; |
| 715 | 721 | |
| 716 | 722 | $output = ''; |
| 723 | + $css = apply_filters('mbsocial/displaycss/', $css); | |
| 717 | 724 | |
| 718 | 725 | if ($args["style_tag"]) |
| 719 | 726 | $output .= "<style type='text/css'>"; |
| 720 | 727 | |
| 721 | - $output .= apply_filters('mbsocial/displaycss/', $css); | |
| 728 | + $output .= $css; | |
| 722 | 729 | |
| 723 | 730 | if ($args["style_tag"]) |
| 724 | 731 | $output .= "</style>"; |
| 725 | 732 | |
| @@ -730,10 +737,11 @@ | ||
| 730 | 737 | |
| 731 | 738 | $use_file = get_option('maxbuttons_usecssfile', false); |
| 732 | 739 | if ($use_file) |
| 733 | 740 | { |
| 734 | - wp_enqueue_style('maxbuttons-social-front', admin_url('admin-ajax.php').'?action=maxbuttons_social_css&id=' . $this->collection_id); | |
| 735 | - $this->update_meta($this->collection_id, '_parsed_css', $css); | |
| 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); | |
| 736 | 744 | } |
| 737 | 745 | |
| 738 | 746 | if (self::$count > 1) |
| 739 | 747 | { |
| @@ -976,8 +984,9 @@ | ||
| 976 | 984 | $css = $this->styleObj->preParse($css); |
| 977 | 985 | $css = apply_filters('mbsocial/parsecss/', $css); // anybody else |
| 978 | 986 | |
| 979 | 987 | $css = $this->getCSSParser()->parse($css); |
| 988 | + | |
| 980 | 989 | maxUtils::endTime('collection-parseCSS-'. self::$count); |
| 981 | 990 | return $css; |
| 982 | 991 | } |
| 983 | 992 | |