PATH:
home
/
letacommog
/
dombes
/
wp-content
/
themes
/
dt-the7
/
inc
/
extensions
/
meta-box
/
inc
/
fields
<?php // Prevent loading this file directly defined( 'ABSPATH' ) || exit; if ( ! class_exists( 'RWMB_Fieldset_Text_Field' ) ) { class RWMB_Fieldset_Text_Field { /** * Get field HTML * * @param string $html * @param mixed $meta * @param array $field * * @return string */ static function html( $html, $meta, $field ) { $out = ''; if (count($meta)==1 && trim($meta[0])=='') { $meta = ""; } $html = array(); $before = '<fieldset><legend>'.$field['desc'].'</legend>'; $after = '</fieldset>'; $tpl = '<label>%s <input type="text" class="rwmb-fieldset-text" name="%s[%s][%d]" placeholder="%s" value="%s" /></label>'; for($n=0;$n<$field['rows'];$n++) { foreach( $field['options'] as $k => $v ) { $fid = $field['id']; if (is_array($meta) && !empty($meta)) { $html[] = sprintf($tpl, $k, $fid, $v, $n, $k, $meta[$v][$n]); } else { $html[] = sprintf($tpl, $k, $fid, $v, $n, $k, ''); } } $html[] = "<br/>\n"; } $out = $before . implode( ' ', $html ) . $after; return $out; } /** * Get meta value * * @param $meta * @param $post_id * @param $saved * @param $field * * @return array */ static function meta( $meta, $post_id, $saved, $field ) { $meta = get_post_meta( $post_id, $field['id'] ); if (is_array($meta) && !empty($meta)) { $meta = $meta[0]; } return $meta; } /** * Save meta value * * @param $new * @param $old * @param $post_id * @param $field */ static function save( $new, $old, $post_id, $field ) { update_post_meta($post_id, $field['id'], $new, $old); } } }
[+]
..
[-] range.php
[edit]
[-] fieldset-text.php
[edit]
[-] image-advanced.php
[edit]
[-] post.php
[edit]
[-] text.php
[edit]
[-] textarea.php
[edit]
[-] image.php
[edit]
[-] button.php
[edit]
[-] checkbox-list.php
[edit]
[-] file.php
[edit]
[-] oembed.php
[edit]
[-] color.php
[edit]
[-] wysiwyg.php
[edit]
[-] url.php
[edit]
[-] plupload-image.php
[edit]
[-] divider.php
[edit]
[-] thickbox-image.php
[edit]
[-] hidden.php
[edit]
[-] slider.php
[edit]
[-] map.php
[edit]
[-] number.php
[edit]
[-] checkbox.php
[edit]
[-] file-advanced.php
[edit]
[-] text-list.php
[edit]
[-] datetime.php
[edit]
[-] time.php
[edit]
[-] index.php
[edit]
[-] radio.php
[edit]
[-] select.php
[edit]
[-] taxonomy.php
[edit]
[-] select-advanced.php
[edit]
[-] heading.php
[edit]
[-] email.php
[edit]
[-] date.php
[edit]
[-] taxonomy-advanced.php
[edit]
[-] password.php
[edit]