Ejemplo n.º 1
0
 /**
  * Add section, settings and controls.
  */
 public function add($wp_customize)
 {
     $this->add_section($wp_customize);
     $fields = beans_get_fields('wp_customize', $this->section);
     foreach ($fields as $field) {
         if ($field['type'] === 'group') {
             foreach ($field['fields'] as $_field) {
                 $this->add_setting($wp_customize, $_field);
             }
         }
         $this->add_setting($wp_customize, $field);
         $this->add_control($wp_customize, $field);
     }
 }
Ejemplo n.º 2
0
 /**
  * Add section, settings and controls.
  */
 private function add()
 {
     global $wp_customize;
     $this->add_section($wp_customize);
     $fields = beans_get_fields('wp_customize', $this->section);
     foreach ($fields as $field) {
         if ('group' === $field['type']) {
             foreach ($field['fields'] as $_field) {
                 $this->add_setting($wp_customize, $_field);
             }
         }
         $this->add_setting($wp_customize, $field);
         $this->add_control($wp_customize, $field);
     }
 }
Ejemplo n.º 3
0
 /**
  * Fields content.
  */
 public function fields($tag)
 {
     beans_remove_action('beans_field_label');
     beans_modify_action_hook('beans_field_description', 'beans_field_wrap_after_markup');
     beans_modify_markup('beans_field_description', 'p');
     beans_add_attribute('beans_field_description', 'class', 'description');
     foreach (beans_get_fields('term_meta', $this->section) as $field) {
         echo '<tr class="form-field">';
         echo '<th scope="row">';
         beans_field_label($field);
         echo '</th>';
         echo '<td>';
         beans_field($field);
         echo '</td>';
         echo '</tr>';
     }
 }
Ejemplo n.º 4
0
 /**
  * Metabox content.
  */
 public function metabox_content($post)
 {
     foreach (beans_get_fields('post_meta', $this->section) as $field) {
         beans_field($field);
     }
 }
Ejemplo n.º 5
0
 /**
  * Metabox content.
  */
 public function metabox_content()
 {
     foreach (beans_get_fields('option', $this->section) as $field) {
         beans_field($field);
     }
 }