PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 2.2.4
Wp Social Login and Register Social Counter v2.2.4
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / lib / provider / share-factory.php
wp-social / lib / provider Last commit date
counter 3 years ago share 5 years ago counter-factory.php 5 years ago share-factory.php 5 years ago
share-factory.php
112 lines
1 <?php
2
3 namespace WP_Social\Lib\Provider;
4
5 use WP_Social\Lib\Provider\Share\Digg_Sharer;
6 use WP_Social\Lib\Provider\Share\Email_Sharer;
7 use WP_Social\Lib\Provider\Share\Facebook_Messenger_Sharer;
8 use WP_Social\Lib\Provider\Share\Facebook_Sharer;
9 use WP_Social\Lib\Provider\Share\Kik_Sharer;
10 use WP_Social\Lib\Provider\Share\Linkedin_Sharer;
11 use WP_Social\Lib\Provider\Share\No_Provider_Share;
12 use WP_Social\Lib\Provider\Share\Pinterest_Sharer;
13 use WP_Social\Lib\Provider\Share\Reddit_Sharer;
14 use WP_Social\Lib\Provider\Share\Skype_Sharer;
15 use WP_Social\Lib\Provider\Share\Stumbleupon_Sharer;
16 use WP_Social\Lib\Provider\Share\Telegram_Sharer;
17 use WP_Social\Lib\Provider\Share\Trello_Sharer;
18 use WP_Social\Lib\Provider\Share\Twitter_Sharer;
19 use WP_Social\Lib\Provider\Share\Viber_Sharer;
20 use WP_Social\Lib\Provider\Share\Whatsapp_Sharer;
21
22 defined('ABSPATH') || exit;
23
24 class Share_Factory {
25
26 private $provider_type;
27 private $post_id;
28
29 public $factory;
30
31
32 public function __construct($post_id) {
33
34 $this->post_id = intval($post_id);
35 }
36
37
38 public function make($type) {
39
40 $this->provider_type = $type;
41
42 switch($type) {
43
44 case 'facebook' :
45 $this->factory = new Facebook_Sharer($this->post_id, $type);
46 break;
47
48 case 'twitter' :
49 $this->factory = new Twitter_Sharer($this->post_id, $type);
50 break;
51
52 case 'pinterest' :
53 $this->factory = new Pinterest_Sharer($this->post_id, $type);
54 break;
55
56 case 'linkedin' :
57 $this->factory = new Linkedin_Sharer($this->post_id, $type);
58 break;
59
60 case 'facebook-messenger' :
61 $this->factory = new Facebook_Messenger_Sharer($this->post_id, $type);
62 break;
63
64 case 'kik' :
65 $this->factory = new Kik_Sharer($this->post_id, $type);
66 break;
67
68 case 'skype' :
69 $this->factory = new Skype_Sharer($this->post_id, $type);
70 break;
71
72 case 'trello' :
73 $this->factory = new Trello_Sharer($this->post_id, $type);
74 break;
75
76 case 'viber' :
77 $this->factory = new Viber_Sharer($this->post_id, $type);
78 break;
79
80 case 'whatsapp' :
81 $this->factory = new Whatsapp_Sharer($this->post_id, $type);
82 break;
83
84 case 'telegram' :
85 $this->factory = new Telegram_Sharer($this->post_id, $type);
86 break;
87
88 case 'email' :
89 $this->factory = new Email_Sharer($this->post_id, $type);
90 break;
91
92 case 'reddit' :
93 $this->factory = new Reddit_Sharer($this->post_id, $type);
94 break;
95
96 case 'digg' :
97 $this->factory = new Digg_Sharer($this->post_id, $type);
98 break;
99
100 case 'stumbleupon' :
101 $this->factory = new Stumbleupon_Sharer($this->post_id, $type);
102 break;
103
104 default:
105 $this->factory = new No_Provider_Share();
106
107 }
108
109 return $this->factory;
110 }
111
112 }