PluginProbe
The WP Remote WordPress Plugin / trunk
The WP Remote WordPress Plugin vtrunk
6.72 6.69 6.65 6.62 6.48 6.47 4.87 4.97 5.05 5.09 5.16 5.22 5.24 5.25 5.38 5.41 5.42 5.45 5.47 5.53 5.56 5.65 5.68 5.72 5.73 All 53 releases
wpremote / callback / wings / brand.php

brand.php in The WP Remote WordPress Plugin trunk, at callback/wings/brand.php

47 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) exit;
4 if (!class_exists('WPRBrandCallback')) :
5
6 class WPRBrandCallback extends WPRCallbackBase {
7 public $settings;
8
9 const BRAND_WING_VERSION = 1.1;
10
11 public function __construct($callback_handler) {
12 $this->settings = $callback_handler->settings;
13 }
14
15 public function process($request) {
16 $bvinfo = new WPRInfo($this->settings);
17 $option_name = $bvinfo->brand_option;
18 $whitelabel_infos = $bvinfo->getPluginsWhitelabelInfos();
19 $params = $request->params;
20 switch($request->method) {
21 case 'setbrand':
22 foreach ($params as $slug => $whitelabel_info) {
23 if (isset($slug) && is_array($whitelabel_info)) {
24 $whitelabel_infos[$slug] = $whitelabel_info;
25 }
26 }
27 $this->settings->updateOption($option_name, $whitelabel_infos);
28 $resp = array("setbrand" => $this->settings->getOption($option_name));
29 break;
30 case 'rmbrand':
31 foreach ($params["delete_keys"] as $slug) {
32 unset($whitelabel_infos[$slug]);
33 }
34 $this->settings->updateOption($option_name, $whitelabel_infos);
35 $resp = array("rmbrand" => true);
36 break;
37 case 'rmallbrands':
38 $this->settings->deleteOption($option_name);
39 $resp = array("rmallbrands" => !$this->settings->getOption($option_name));
40 break;
41 default:
42 $resp = false;
43 }
44 return $resp;
45 }
46 }
47 endif;