本文整理汇总了PHP中of_recognized_background_repeat函数的典型用法代码示例。如果您正苦于以下问题:PHP of_recognized_background_repeat函数的具体用法?PHP of_recognized_background_repeat怎么用?PHP of_recognized_background_repeat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了of_recognized_background_repeat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: of_sanitize_background_repeat
function of_sanitize_background_repeat($value)
{
$recognized = of_recognized_background_repeat();
if (array_key_exists($value, $recognized)) {
return $value;
}
return apply_filters('of_default_background_repeat', current($recognized));
}
示例2: optionsframework_fields
//.........这里部分代码省略.........
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
// Font Style
$styles = of_recognized_font_styles();
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
$textarea_name = esc_attr($option_name . '[' . $value['id'] . ']');
$default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
$editor_settings = array();
if (isset($value['settings'])) {
$editor_settings = $value['settings'];
}
$editor_settings = array_merge($editor_settings, $default_editor_settings);
示例3: optionsframework_fields
//.........这里部分代码省略.........
}
}
$font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$default_color = '';
if (isset($value['std']['color'])) {
if ($val != $value['std']['color']) {
$default_color = ' data-default-color="' . $value['std']['color'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />';
// Background Image
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]'));
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
$textarea_name = esc_attr($option_name . '[' . $value['id'] . ']');
$default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
$editor_settings = array();
if (isset($value['settings'])) {
$editor_settings = $value['settings'];
}
$editor_settings = array_merge($editor_settings, $default_editor_settings);
示例4: fields
//.........这里部分代码省略.........
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
/* Font Style */
$styles = ClassyOptionsSanitize::recognized_font_styles();
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例5: optionsframework_fields
//.........这里部分代码省略.........
}
}
$font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$default_color = '';
if (isset($value['std']['color'])) {
if ($val != $value['std']['color']) {
$default_color = ' data-default-color="' . $value['std']['color'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />';
// Background Image
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]'));
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
// Background Size
$output .= '<select class="of-background of-background-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = of_recognized_background_size();
foreach ($sizes as $key => $size) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['size'], $key, false) . '>' . esc_html($size) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
示例6: optionsframework_fields
//.........这里部分代码省略.........
}
}
$font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
$output .= '<div class="typographytextbox" id="' . $value['id'] . '">The Quick Brown Fox Jumps Over The Lazy Dog. 1234567890</div>';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
//$default_color = '';
// if ( isset( $value['std']['color'] ) ) {
// if ( $val != $value['std']['color'] )
// $default_color = ' data-default-color="' .$value['std']['color'] . '" ';
// }
// $output .= '<input name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" class="of-color of-background-color" type="text" value="' . esc_attr( $background['color'] ) . '"' . $default_color .' />';
// Background Image
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]'));
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
$textarea_name = esc_attr($option_name . '[' . $value['id'] . ']');
$default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
$editor_settings = array();
if (isset($value['settings'])) {
$editor_settings = $value['settings'];
}
$editor_settings = array_merge($default_editor_settings, $editor_settings);
示例7: optionsframework_fields
//.........这里部分代码省略.........
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
/* Font Style */
$styles = of_recognized_font_styles();
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($wpbs_typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $wpbs_typography_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($wpbs_typography_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例8: optionsframework_fields
//.........这里部分代码省略.........
$font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$font_style .= '</select>';
}
// Font Color
if ($typography_options['color']) {
$font_color = '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography_stored['color']) . '"></div></div>';
$font_color .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography_stored['color']) . '" />';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
$textarea_name = esc_attr($option_name . '[' . $value['id'] . ']');
$default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
$editor_settings = array();
if (isset($value['settings'])) {
$editor_settings = $value['settings'];
}
$editor_settings = array_merge($editor_settings, $default_editor_settings);
示例9: optionsframework_fields
//.........这里部分代码省略.........
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
/* Font Style */
$styles = of_recognized_font_styles();
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例10: optionsframework_fields
//.........这里部分代码省略.........
/* // Font Weight
$output .= '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
*/
/* Font Style */
/* $styles = of_recognized_font_styles();
foreach ( $styles as $key => $style ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr( $value['id'] ) . '_color_picker" class="colorSelector"><div style="' . esc_attr( 'background-color:' . $typography_stored['color'] ) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" type="text" value="' . esc_attr( $typography_stored['color'] ) . '" />';
*/
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例11: optionsframework_fields
//.........这里部分代码省略.........
}
}
$font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . '>';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$default_color = '';
if (isset($value['std']['color'])) {
if ($val != $value['std']['color']) {
$default_color = ' data-default-color="' . $value['std']['color'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . '>';
// Background Image
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]'));
$class = 'of-background-properties ' . (isset($value['class']) ? esc_attr($value['class']) : '') . '';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// export
// export
case 'export':
$rows = '8';
if (isset($value['settings']['rows'])) {
$custom_rows = $value['settings']['rows'];
if (is_numeric($custom_rows)) {
$rows = $custom_rows;
}
}
$output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input builder_select" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '">' . esc_textarea($value['export']) . '</textarea>';
break;
示例12: optionsframework_fields
//.........这里部分代码省略.........
$font_style .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$font_style .= '</select>';
}
// Font Color
if ($typography_options['color']) {
$font_color = '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography_stored['color']) . '"></div></div>';
$font_color .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography_stored['color']) . '" />';
//onkeypress="options_face_preview(\'' . esc_attr( $value['id'] . '_size' ) . '\', \'' . esc_attr($value['id']) . '_color'. '\', \'color\');return true;"/>';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
//$output .= '<p style="font-family: ' . $typography_stored['face'] . '; margin: 7px 0 10px 5px;display:block;width:200px; font-size: ' . $typography_stored['size'] . '" id="' . esc_attr($value['id']) . '_preview' . '">Font Preview</p>';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
if (isset($value['name'])) {
$output .= '<h5>' . esc_html($value['name']) . '</h5>' . "\n";
}
if (isset($value['desc'])) {
$output .= apply_filters('of_sanitize_info', $value['desc']) . "\n";
}
break;
// Heading for Navigation
// Heading for Navigation
case "heading":
if ($counter >= 2) {
$output .= '</div>' . "\n";
}
$jquery_click_hook = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($value['name']));
$jquery_click_hook = "of-option-" . $jquery_click_hook;
$menu .= '<a id="' . esc_attr($jquery_click_hook) . '-tab" class="nav-tab" title="' . esc_attr($value['name']) . '" href="' . esc_attr('#' . $jquery_click_hook) . '">' . esc_html($value['name']) . '</a>';
$output .= '<div class="group" id="' . esc_attr($jquery_click_hook) . '">';
$output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n";
break;
}
if ($value['type'] != "heading" && $value['type'] != "info") {
//if ( $value['type'] != "checkbox" ) {
$output .= '<br/>';
//}
$output .= '</div>';
//if ( $value['type'] != "checkbox" ) {
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
//}
$output .= '<div class="clear"></div></div></div>' . "\n";
}
}
$output .= '</div>';
echo $output;
}
示例13: optionsframework_fields
//.........这里部分代码省略.........
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
/* Font Style */
$styles = of_recognized_font_styles();
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($wpbs_typography_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $wpbs_typography_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($wpbs_typography_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - Nuevo cargador en AJAX usando Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例14: optionsframework_fields
//.........这里部分代码省略.........
$output .= '<option value="' . esc_attr($size) . '" ' . selected($typography2_stored['size'], $size, false) . '>' . esc_html($size) . '</option>';
}
$output .= '</select>';
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="' . $option_name . '[' . $value['id'] . '][style]" id="' . $value['id'] . '_style">';
$styles = array('normal' => 'Normal', 'italic' => 'Italic', 'bold' => 'Bold', 'bold italic' => 'Bold Italic');
foreach ($styles as $key => $style) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($typography2_stored['style'], $key, false) . '>' . $style . '</option>';
}
$output .= '</select>';
// Font Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $typography2_stored['color']) . '"></div></div>';
$output .= '<input class="of-color of-typography of-typography-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($typography2_stored['color']) . '" />';
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$output .= '<div id="' . esc_attr($value['id']) . '_color_picker" class="colorSelector"><div style="' . esc_attr('background-color:' . $background['color']) . '"></div></div>';
$output .= '<input class="of-color of-background of-background-color" name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" type="text" value="' . esc_attr($background['color']) . '" />';
// Background Image - New AJAX Uploader using Media Library
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= optionsframework_medialibrary_uploader($value['id'], $background['image'], null, '', 0, 'image');
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Info
// Info
case "info":
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
示例15: optionsframework_fields
//.........这里部分代码省略.........
}
}
$font_color = '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-typography-color type="text" value="' . esc_attr($typography_stored['color']) . '"' . $default_color . ' />';
}
// Allow modification/injection of typography fields
$typography_fields = compact('font_size', 'font_face', 'font_style', 'font_color');
$typography_fields = apply_filters('of_typography_fields', $typography_fields, $typography_stored, $option_name, $value);
$output .= implode('', $typography_fields);
break;
// Background
// Background
case 'background':
$background = $val;
// Background Color
$default_color = '';
if (isset($value['std']['color'])) {
if ($val != $value['std']['color']) {
$default_color = ' data-default-color="' . $value['std']['color'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . '][color]') . '" id="' . esc_attr($value['id'] . '_color') . '" class="of-color of-background-color" type="text" value="' . esc_attr($background['color']) . '"' . $default_color . ' />';
// Background Image
if (!isset($background['image'])) {
$background['image'] = '';
}
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $background['image'], null, esc_attr($option_name . '[' . $value['id'] . '][image]'));
$class = 'of-background-properties';
if ('' == $background['image']) {
$class .= ' hide';
}
$output .= '<div class="' . esc_attr($class) . '">';
// Background Repeat
$output .= '<select class="of-background of-background-repeat" name="' . esc_attr($option_name . '[' . $value['id'] . '][repeat]') . '" id="' . esc_attr($value['id'] . '_repeat') . '">';
$repeats = of_recognized_background_repeat();
foreach ($repeats as $key => $repeat) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['repeat'], $key, false) . '>' . esc_html($repeat) . '</option>';
}
$output .= '</select>';
// Background Position
$output .= '<select class="of-background of-background-position" name="' . esc_attr($option_name . '[' . $value['id'] . '][position]') . '" id="' . esc_attr($value['id'] . '_position') . '">';
$positions = of_recognized_background_position();
foreach ($positions as $key => $position) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['position'], $key, false) . '>' . esc_html($position) . '</option>';
}
$output .= '</select>';
// Background Attachment
$output .= '<select class="of-background of-background-attachment" name="' . esc_attr($option_name . '[' . $value['id'] . '][attachment]') . '" id="' . esc_attr($value['id'] . '_attachment') . '">';
$attachments = of_recognized_background_attachment();
foreach ($attachments as $key => $attachment) {
$output .= '<option value="' . esc_attr($key) . '" ' . selected($background['attachment'], $key, false) . '>' . esc_html($attachment) . '</option>';
}
$output .= '</select>';
$output .= '</div>';
break;
// Editor
// Editor
case 'editor':
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
echo $output;
$textarea_name = esc_attr($option_name . '[' . $value['id'] . ']');
$default_editor_settings = array('textarea_name' => $textarea_name, 'media_buttons' => false, 'tinymce' => array('plugins' => 'wordpress'));
$editor_settings = array();
if (isset($value['settings'])) {
$editor_settings = $value['settings'];
}
$editor_settings = array_merge($default_editor_settings, $editor_settings);