admin
10 months ago
core
10 months ago
class-activator.php
10 months ago
class-assets.php
11 months ago
class-builder-page.php
1 year ago
class-deactivator.php
3 years ago
class-debug-info.php
2 years ago
class-feed-ajax.php
1 year ago
class-feed-block.php
1 year ago
class-feed-deserializer.php
11 months ago
class-feed-old.php
4 years ago
class-feed-page.php
11 months ago
class-feed-serializer.php
2 years ago
class-feed-shortcode.php
2 years ago
class-feed-widget.php
4 years ago
class-plugin-overview-ajax.php
1 year ago
class-plugin-overview.php
11 months ago
class-plugin-settings.php
10 months ago
class-plugin-support.php
1 year ago
class-plugin.php
11 months ago
class-post-types.php
3 years ago
class-reviews-cron.php
1 year ago
class-settings-save.php
1 year ago
class-view.php
10 months ago
index.php
4 years ago
page-setting-advance.php
1 year ago
page-setting-fig.php
1 year ago
page-setting-support.php
4 years ago
class-feed-old.php
56 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WP_Rplg_Google_Reviews\Includes; |
| 4 | |
| 5 | class Feed_Old { |
| 6 | |
| 7 | public static $widget_fields = array( |
| 8 | 'place_name' => '', |
| 9 | 'place_id' => '', |
| 10 | 'place_photo' => '', |
| 11 | 'text_size' => '120', |
| 12 | 'dark_theme' => '', |
| 13 | 'view_mode' => 'list', |
| 14 | 'pagination' => '5', |
| 15 | 'max_width' => '', |
| 16 | 'max_height' => '', |
| 17 | 'refresh_reviews' => true, |
| 18 | 'hide_based_on' => false, |
| 19 | 'hide_reviews' => false, |
| 20 | 'centered' => false, |
| 21 | 'reduce_avatars_size' => true, |
| 22 | 'open_link' => true, |
| 23 | 'nofollow_link' => true, |
| 24 | 'lazy_load_img' => true, |
| 25 | 'def_reviews_link' => false, |
| 26 | 'reviews_lang' => '', |
| 27 | ); |
| 28 | |
| 29 | public function __construct() { |
| 30 | } |
| 31 | |
| 32 | public function get_feed($id, $params) { |
| 33 | $feed_content = array(); |
| 34 | $conn = array(); |
| 35 | $opts = array(); |
| 36 | |
| 37 | foreach (self::$widget_fields as $variable => $value) { |
| 38 | if ($variable == 'place_id' || $variable == 'place_name' || $variable == 'place_photo' || $variable == 'reviews_lang') { |
| 39 | $key = str_replace('place_', '', $variable); |
| 40 | $key = str_replace('reviews_', '', $key); |
| 41 | $conn[$key] = !isset($params[$variable]) ? self::$widget_fields[$variable] : esc_attr($params[$variable]); |
| 42 | } elseif ($variable == 'refresh_reviews') { |
| 43 | $conn['refresh'] = isset($params[$variable]) && $params[$variable] == true ? true : false; |
| 44 | } else { |
| 45 | $opts[$variable] = !isset($params[$variable]) ? self::$widget_fields[$variable] : esc_attr($params[$variable]); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | $conn['platform'] = 'google'; |
| 50 | $feed_content['connections'] = array($conn); |
| 51 | $feed_content['options'] = $opts; |
| 52 | |
| 53 | return (object) array('ID' => $id, 'post_content' => json_encode($feed_content)); |
| 54 | } |
| 55 | } |
| 56 |