public function ajax_save_options() { if (isset($_POST['_wpnonce']) && isset($_POST['service']) && wp_verify_nonce($_POST['_wpnonce'], 'sharing-options_' . $_POST['service'])) { $sharer = new Sharing_Service(); $service = $sharer->get_service($_POST['service']); if ($service && $service instanceof Sharing_Advanced_Source) { $service->update_options($_POST); $sharer->set_service($_POST['service'], $service); } $this->output_service($service->get_id(), $service, true); echo '<!--->'; $service->button_style = 'icon-text'; $this->output_preview($service); die; } }
public function __construct($id, $total) { $services = new Sharing_Service(); $this->id = esc_html($id); $this->service = $services->get_service($id); $this->total = (int) $total; $this->name = $this->service->get_name(); }