PluginProbe
Juicer.io: Effortlessly embed, curate, and aggregate social media feeds into your website / 1.10.1
Juicer.io: Effortlessly embed, curate, and aggregate social media feeds into your website v1.10.1
1.12.18 1.12.5 1.12.6 1.12.7 1.12.8 1.12.9 1.2 1.3 1.3.1 1.4 1.4.1 1.5 1.6 1.6.1 1.7 1.7.1 1.7.2 1.8 1.9 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 All 45 releases
juicer / juicer.php

juicer.php in Juicer.io: Effortlessly embed, curate, and aggregate social media feeds into your website 1.10.1, at juicer.php

106 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Juicer
4 * Plugin URI: https://wp.juicer.io
5 * Description: Embed, curate & aggregate social media feeds from Instagram, Twitter, TikTok, Facebook, LinkedIn, YouTube, Slack, etc. and customize them as you like.
6 * Version: 1.10.1
7 * Author: saas.group LLC
8 * Author URI: https://saas.group
9 * License: GPLv2 or later
10 */
11
12 /*
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License
15 as published by the Free Software Foundation; either version 2
16 of the License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27
28
29 add_action( 'wp_enqueue_scripts', 'juicer_scripts', 0 );
30 function juicer_scripts() {
31
32 wp_enqueue_script('jquery');
33
34 wp_enqueue_script(
35 'juicerembed',
36 '//assets.juicer.io/embed-no-jquery.js',
37 array('jquery'),
38 false,
39 false
40 );
41
42 wp_enqueue_style(
43 'juicerstyle',
44 '//assets.juicer.io/embed.css'
45 );
46 }
47
48 class Juicer_Feed {
49
50 public function render( $args ) {
51
52 $defaults = array(
53 'name' => 'error',
54 );
55
56 $args = wp_parse_args( $args, $defaults);
57
58 $map_attributes = generate_attributes($args);
59
60 $attributes = join(' ', $map_attributes);
61
62 $output = '<ul class="juicer-feed" data-origin="wp-plugin-1-10" data-feed-id="' . $args['name'] . '" ' . $attributes . '>';
63
64 $closing = (array_key_exists('paid', $args)) ? '</ul>' : '<h1 class="referral"><a href="http://www.juicer.io">Powered by Juicer</a></h1></ul>';
65
66 $output = $output . $closing;
67
68 return $output;
69 }
70
71 }
72
73 function generate_attributes( $array ) {
74 $attrs = array();
75
76 foreach ( $array as $key => $val ) {
77 if ( !empty($val) ) {
78 if (strpos($val, 'data-') !== false) {
79 array_push($attrs, $val);
80 } else {
81 array_push($attrs, 'data-' . $key . '="' . $val . '"');
82 }
83 }
84 }
85
86 return $attrs;
87 }
88
89 function juicer_feed( $args ) {
90 $feed = new Juicer_Feed();
91 echo $feed->render( $args );
92 }
93
94 function juicer_shortcode( $args ) {
95 extract( shortcode_atts( array(
96 'name' => 'error',
97 ), $args ) );
98
99 $feed = new Juicer_Feed();
100
101 return $feed->render( $args );
102 }
103
104 add_shortcode( 'juicer', 'juicer_shortcode' );
105 ?>
106