Пример #1
0
 public function settings_page()
 {
     // Do we have post?
     if (isset($_POST['_wpnonce'])) {
         if (wp_verify_nonce($_POST['_wpnonce'], $this->key)) {
             $this->save($_POST);
         }
     }
     $this->build_fields();
     $form = new \Proud\Core\FormHelper($this->key, $this->fields);
     $form->printForm(['button_text' => __pcHelp('Save'), 'method' => 'post', 'action' => '', 'name' => $this->key, 'id' => $this->key]);
 }
Пример #2
0
 /**
  * Prints list filters
  */
 public function print_filters($include_filters = null, $button_text = 'Filter')
 {
     // Remove filters that we don't want to show
     if (!empty($include_filters)) {
         foreach ($this->filters as $key => $filter) {
             if (!in_array($key, $include_filters)) {
                 unset($this->filters[$key]);
             }
         }
     }
     // Grab form helper
     $form = new \Proud\Core\FormHelper('proud-teaser-filter', $this->filters);
     $form->printForm(['button_text' => __($button_text, 'proud-teaser')]);
 }
 /**
  * Adds document form metadata field
  */
 public function display_document_form_meta_box($document)
 {
     $this->build_fields($document->ID);
     $form = new \Proud\Core\FormHelper($this->key, $this->fields);
     $form->printFields();
 }
Пример #4
0
 public function display_agency_social_meta_box($agency)
 {
     $this->build_fields($agency->ID);
     $form = new \Proud\Core\FormHelper(self::$key, $this->fields);
     $form->printFields();
 }