Sharing_Service::get_service PHP Method

get_service() public method

public get_service ( $service_name )
    public function get_service($service_name)
    {
        $services = $this->get_blog_services();
        if (isset($services['visible'][$service_name])) {
            return $services['visible'][$service_name];
        }
        if (isset($services['hidden'][$service_name])) {
            return $services['hidden'][$service_name];
        }
        return false;
    }

Usage Example

示例#1
0
 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;
     }
 }
All Usage Examples Of Sharing_Service::get_service