@@ 522-526 (lines=5) @@ | ||
519 | $global_options = $sharer->get_global_options(); |
|
520 | ||
521 | $enqueue = false; |
|
522 | if ( is_singular() && in_array( get_post_type(), $global_options['show'] ) ) { |
|
523 | $enqueue = true; |
|
524 | } elseif ( in_array( 'index', $global_options['show'] ) && ( is_home() || is_front_page() || is_archive() || is_search() || in_array( get_post_type(), $global_options['show'] ) ) ) { |
|
525 | $enqueue = true; |
|
526 | } |
|
527 | ||
528 | /** |
|
529 | * Filter to decide when sharing scripts should be enqueued. |
|
@@ 669-675 (lines=7) @@ | ||
666 | $global = $sharer->get_global_options(); |
|
667 | ||
668 | $show = false; |
|
669 | if ( !is_feed() ) { |
|
670 | if ( is_singular() && in_array( get_post_type(), $global['show'] ) ) { |
|
671 | $show = true; |
|
672 | } elseif ( in_array( 'index', $global['show'] ) && ( is_home() || is_front_page() || is_archive() || is_search() || in_array( get_post_type(), $global['show'] ) ) ) { |
|
673 | $show = true; |
|
674 | } |
|
675 | } |
|
676 | ||
677 | /** |
|
678 | * Filter to decide if sharing buttons should be displayed. |