PluginProbe
Social Share Buttons / trunk
Social Share Buttons vtrunk
trunk 0.9 1.0 1.1 1.1.1 1.1.2 1.10 1.11 1.12 1.15 1.16 1.17 1.18 1.19 1.2 1.20 1.3 1.30 1.4 1.5 1.6 1.7 1.8 1.9
share-button / classes / network / custom.php

custom.php in Social Share Buttons trunk, at classes/network/custom.php

51 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace MBSocial;
3
4 /** Remote Custom Network Class */
5 class customNetwork extends mbNetwork
6 {
7
8 protected $priority = 'readmore';
9 protected $is_native = false;
10
11 /** Function to set default for custom networks to the data that was imported from remote.
12 *
13 * Start state of custom network is all these defaults, but no save on the main settings branch
14 */
15 public function get_all_defaults()
16 {
17 $network = MBSocial()->networks()->getNetworkSettings();
18
19 if (isset($network['custom'][$this->network]))
20 {
21
22 $settings = $network['custom'][$this->network];
23
24 $all_options = $this->get_all_options();
25
26 foreach($all_options as $option => $value)
27 {
28 if (isset($settings[$option]))
29 {
30 $all_options[$option] = $settings[$option];
31 }
32 }
33 }
34 return $all_options;
35 }
36
37 public function load_settings($settings)
38 {
39
40 if (isset($settings['name']))
41 {
42 $this->network = $settings['name'];
43 unset($settings['name']);
44 }
45
46
47 parent::load_settings($settings);
48
49 }
50 }
51