PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.2.1
Wp Social Login and Register Social Counter v3.2.1
3.2.1 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 1 week ago share 1 week ago counter-factory.php 1 week ago share-factory.php 1 week ago
share-factory.php
117 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 use WP_Social\Lib\Provider\Share\Lineapp_Sharer;
22
23 defined('ABSPATH') || exit;
24
25 class Share_Factory {
26
27 private $provider_type;
28 private $post_id;
29
30 public $factory;
31
32
33 public function __construct($post_id) {
34
35 $this->post_id = intval($post_id);
36 }
37
38
39 public function make($type) {
40
41 $this->provider_type = $type;
42
43 switch($type) {
44
45 case 'facebook' :
46 $this->factory = new Facebook_Sharer($this->post_id, $type);
47 break;
48
49 case 'twitter' :
50 $this->factory = new Twitter_Sharer($this->post_id, $type);
51 break;
52
53 case 'pinterest' :
54 $this->factory = new Pinterest_Sharer($this->post_id, $type);
55 break;
56
57 case 'linkedin' :
58 $this->factory = new Linkedin_Sharer($this->post_id, $type);
59 break;
60
61 case 'facebook-messenger' :
62 $this->factory = new Facebook_Messenger_Sharer($this->post_id, $type);
63 break;
64
65 case 'kik' :
66 $this->factory = new Kik_Sharer($this->post_id, $type);
67 break;
68
69 case 'skype' :
70 $this->factory = new Skype_Sharer($this->post_id, $type);
71 break;
72
73 case 'trello' :
74 $this->factory = new Trello_Sharer($this->post_id, $type);
75 break;
76
77 case 'viber' :
78 $this->factory = new Viber_Sharer($this->post_id, $type);
79 break;
80
81 case 'whatsapp' :
82 $this->factory = new Whatsapp_Sharer($this->post_id, $type);
83 break;
84
85 case 'telegram' :
86 $this->factory = new Telegram_Sharer($this->post_id, $type);
87 break;
88
89 case 'email' :
90 $this->factory = new Email_Sharer($this->post_id, $type);
91 break;
92
93 case 'reddit' :
94 $this->factory = new Reddit_Sharer($this->post_id, $type);
95 break;
96
97 case 'digg' :
98 $this->factory = new Digg_Sharer($this->post_id, $type);
99 break;
100
101 case 'stumbleupon' :
102 $this->factory = new Stumbleupon_Sharer($this->post_id, $type);
103 break;
104
105 case 'lineapp' :
106 $this->factory = new Lineapp_Sharer($this->post_id, $type);
107 break;
108
109 default:
110 $this->factory = new No_Provider_Share();
111
112 }
113
114 return $this->factory;
115 }
116
117 }