Ejemplo n.º 1
0
 public function put_forms_properties($property_values, $form_id)
 {
     $this->authorize("gravityforms_edit_forms");
     foreach ($property_values as $key => $property_value) {
         $result = GFAPI::update_form_property($form_id, $key, $property_value);
         if (is_wp_error($result)) {
             break;
         }
     }
     if (is_wp_error($result)) {
         $response = $this->get_error_response($result);
         $status = $this->get_error_status($result);
     } else {
         $status = 200;
         $response = __("Success", "gravityforms");
     }
     $this->end($status, $response);
 }
Ejemplo n.º 2
0
 public function put_forms_properties($property_values, $form_id)
 {
     $this->log_debug(__METHOD__ . '(): Running.');
     $capability = apply_filters('gform_web_api_capability_put_forms_properties', 'gravityforms_edit_forms');
     $this->authorize($capability);
     foreach ($property_values as $key => $property_value) {
         $result = GFAPI::update_form_property($form_id, $key, $property_value);
         if (is_wp_error($result)) {
             break;
         }
     }
     if (is_wp_error($result)) {
         $response = $this->get_error_response($result);
         $status = $this->get_error_status($result);
     } else {
         $status = 200;
         $response = __('Success', 'gravityforms');
     }
     $this->end($status, $response);
 }