本文整理汇总了PHP中Options_Framework_Media_Uploader::optionsframework_uploader方法的典型用法代码示例。如果您正苦于以下问题:PHP Options_Framework_Media_Uploader::optionsframework_uploader方法的具体用法?PHP Options_Framework_Media_Uploader::optionsframework_uploader怎么用?PHP Options_Framework_Media_Uploader::optionsframework_uploader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options_Framework_Media_Uploader
的用法示例。
在下文中一共展示了Options_Framework_Media_Uploader::optionsframework_uploader方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: optionsframework_fields
//.........这里部分代码省略.........
case "checkbox":
$output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />';
$output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
break;
// Multicheck
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-' . $option;
$name = $option_name . '[' . $value['id'] . '][' . $option . ']';
if (isset($val[$option])) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
}
break;
// Color picker
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />';
break;
// Uploader
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
// Typography
// Typography
case 'typography':
unset($font_size, $font_style, $font_face, $font_color);
$typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => '');
$typography_stored = wp_parse_args($val, $typography_defaults);
$typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true);
if (isset($value['options'])) {
$typography_options = wp_parse_args($value['options'], $typography_options);
}
// Font Size
if ($typography_options['sizes']) {
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = $typography_options['sizes'];
foreach ($sizes as $i) {
$size = $i . 'px';
$font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>';
}
$font_size .= '</select>';
}
// Font Face
if ($typography_options['faces']) {
$font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">';
$faces = $typography_options['faces'];
foreach ($faces as $key => $face) {
$font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>';
}
$font_face .= '</select>';
}
// Font Styles
if ($typography_options['styles']) {
示例2: optionsframework_fields
//.........这里部分代码省略.........
//html output
$output .= '<input type="text" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" value="' . esc_attr($val) . '" ' . $s_edit . ' />';
$output .= '<div id="' . $value['id'] . '-slider" class="ap_sliderui" ' . $s_data . '></div>';
break;
// Multicheck
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-' . $option;
$name = $option_name . '[' . $value['id'] . '][' . $option . ']';
if (isset($val[$option])) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
}
break;
// Color picker
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />';
break;
// Uploader
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
// Install Demo
// Install Demo
case 'demo':
$output .= '<a href="#">' . __('Install Demo', 'accesspress-mag') . '</a>';
break;
// Typography
// Typography
case 'typography':
unset($font_size, $font_style, $font_face, $font_color);
$typography_defaults = array('size' => $value['size'] . "px", 'face' => $value['face'], 'style' => $value['style'], 'color' => $value['color']);
$typography_stored = wp_parse_args($val, $typography_defaults);
$accesspress_pro_font_list = get_option('accesspress_mag_google_font');
$font_family = $typography_stored['face'];
$font_array = accesspress_search_key($accesspress_pro_font_list, 'family', $font_family);
$variants_array = $font_array['0']['variants'];
$typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => $variants_array, 'color' => true);
if (isset($value['options'])) {
$typography_options = wp_parse_args($value['options'], $typography_options);
}
// Font Size
if ($typography_options['sizes']) {
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = $typography_options['sizes'];
foreach ($sizes as $i) {
$size = $i . 'px';
$font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>';
}
$font_size .= '</select>';
}
// Font Face
if ($typography_options['faces']) {
示例3: optionsframework_fields
//.........这里部分代码省略.........
case "checkbox":
$output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input vpanel_checkbox" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . '>';
$output .= '<label class="explain explain-checkbox" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
break;
// Multicheck
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-' . $option;
$name = $option_name . '[' . $value['id'] . '][' . $option . ']';
if (isset($val[$option])) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input vpanel_multicheck" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . '><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
}
break;
// Color picker
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color ' . (isset($value['class']) ? esc_attr($value['class']) : '') . '" type="text" value="' . esc_attr($val) . '"' . $default_color . '>';
break;
// Uploader
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
// Typography
// Typography
case 'typography':
unset($font_size, $font_style, $font_face, $font_color);
$typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => '');
$typography_stored = wp_parse_args($val, $typography_defaults);
$typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true);
if (isset($value['options'])) {
$typography_options = wp_parse_args($value['options'], $typography_options);
}
// Font Size
if ($typography_options['sizes']) {
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = $typography_options['sizes'];
foreach ($sizes as $i) {
$size = $i . 'px';
$font_size .= '<option value="' . esc_attr($size) . '" ' . (is_string($typography_stored['size']) ? selected($typography_stored['size'], $size, false) : "") . '>' . esc_html($size) . '</option>';
}
$font_size .= '</select>';
}
// Font Face
if ($typography_options['faces']) {
$font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">';
$faces = $typography_options['faces'];
foreach ($faces as $key => $face) {
$font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>';
}
$font_face .= '</select>';
}
// Font Styles
if ($typography_options['styles']) {
示例4: optionsframework_fields
//.........这里部分代码省略.........
case "checkbox":
$output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />';
$output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
break;
// Multicheck
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-' . $option;
$name = $option_name . '[' . $value['id'] . '][' . $option . ']';
if (isset($val[$option])) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
}
break;
// Color picker
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />';
break;
// Uploader
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
// Typography
// Typography
case 'typography':
unset($font_size, $font_style, $font_face, $font_color);
$typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => '');
$typography_stored = wp_parse_args($val, $typography_defaults);
$typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true);
if (isset($value['options'])) {
$typography_options = wp_parse_args($value['options'], $typography_options);
}
// Font Size
if ($typography_options['sizes']) {
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = $typography_options['sizes'];
foreach ($sizes as $i) {
$size = $i . 'px';
$font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>';
}
$font_size .= '</select>';
}
// Font Face
if ($typography_options['faces']) {
$font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">';
$faces = $typography_options['faces'];
foreach ($faces as $key => $face) {
$font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>';
}
$font_face .= '</select>';
}
// Font Styles
if ($typography_options['styles']) {
示例5: optionsframework_fields
//.........这里部分代码省略.........
case "checkbox":
$output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />';
$output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
break;
// Multicheck
// Multicheck
case "multicheck":
foreach ($value['options'] as $key => $option) {
$checked = '';
$label = $option;
$option = preg_replace('/[^a-zA-Z0-9._\\-]/', '', strtolower($key));
$id = $option_name . '-' . $value['id'] . '-' . $option;
$name = $option_name . '[' . $value['id'] . '][' . $option . ']';
if (isset($val[$option])) {
$checked = checked($val[$option], 1, false);
}
$output .= '<input id="' . esc_attr($id) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($name) . '" ' . $checked . ' /><label for="' . esc_attr($id) . '">' . esc_html($label) . '</label>';
}
break;
// Color picker
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />';
break;
// Uploader
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
// Typography
// Typography
case 'typography':
unset($font_size, $font_style, $font_face, $font_color);
$typography_defaults = array('size' => '', 'face' => '', 'style' => '', 'color' => '');
$typography_stored = wp_parse_args($val, $typography_defaults);
$typography_options = array('sizes' => of_recognized_font_sizes(), 'faces' => of_recognized_font_faces(), 'styles' => of_recognized_font_styles(), 'color' => true);
if (isset($value['options'])) {
$typography_options = wp_parse_args($value['options'], $typography_options);
}
// Font Size
if ($typography_options['sizes']) {
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr($option_name . '[' . $value['id'] . '][size]') . '" id="' . esc_attr($value['id'] . '_size') . '">';
$sizes = $typography_options['sizes'];
foreach ($sizes as $i) {
$size = $i . 'px';
$font_size .= '<option value="' . esc_attr($size) . '" ' . selected($typography_stored['size'], $size, false) . '>' . esc_html($size) . '</option>';
}
$font_size .= '</select>';
}
// Font Face
if ($typography_options['faces']) {
$font_face = '<select class="of-typography of-typography-face" name="' . esc_attr($option_name . '[' . $value['id'] . '][face]') . '" id="' . esc_attr($value['id'] . '_face') . '">';
$faces = $typography_options['faces'];
foreach ($faces as $key => $face) {
$font_face .= '<option value="' . esc_attr($key) . '" ' . selected($typography_stored['face'], $key, false) . '>' . esc_html($face) . '</option>';
}
$font_face .= '</select>';
}
// Font Styles
if ($typography_options['styles']) {