本文整理汇总了PHP中ot_recognized_font_styles函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_recognized_font_styles函数的具体用法?PHP ot_recognized_font_styles怎么用?PHP ot_recognized_font_styles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ot_recognized_font_styles函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ot_type_typography
function ot_type_typography($args = array())
{
/* turns arguments array into variables */
extract($args);
/* verify a description */
$has_desc = $field_desc ? true : false;
/* format setting outer wrapper */
echo '<div class="format-setting type-typography ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
/* description */
echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
/* format setting inner wrapper */
echo '<div class="format-setting-inner">';
/* allow fields to be filtered */
$ot_recognized_typography_fields = apply_filters('ot_recognized_typography_fields', array('font-color', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'letter-spacing', 'line-height', 'text-decoration', 'text-transform'), $field_id);
/* build font color */
if (in_array('font-color', $ot_recognized_typography_fields)) {
/* build colorpicker */
echo '<div class="option-tree-ui-colorpicker-input-wrap">';
/* colorpicker JS */
echo '<script>jQuery(document).ready(function($) { OT_UI.bind_colorpicker("' . esc_attr($field_id) . '-picker"); });</script>';
/* set background color */
$background_color = isset($field_value['font-color']) ? esc_attr($field_value['font-color']) : '';
/* input */
echo '<input type="text" name="' . esc_attr($field_name) . '[font-color]" id="' . esc_attr($field_id) . '-picker" value="' . esc_attr($background_color) . '" class="hide-color-picker ' . esc_attr($field_class) . '" />';
echo '</div>';
}
/* build font family */
if (in_array('font-family', $ot_recognized_typography_fields)) {
$font_family = isset($field_value['font-family']) ? $field_value['font-family'] : '';
echo '<select name="' . esc_attr($field_name) . '[font-family]" id="' . esc_attr($field_id) . '-font-family" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-family</option>';
foreach (ot_recognized_font_families($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font size */
if (in_array('font-size', $ot_recognized_typography_fields)) {
$font_size = isset($field_value['font-size']) ? esc_attr($field_value['font-size']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-size]" id="' . esc_attr($field_id) . '-font-size" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-size</option>';
foreach (ot_recognized_font_sizes($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($font_size, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build font style */
if (in_array('font-style', $ot_recognized_typography_fields)) {
$font_style = isset($field_value['font-style']) ? esc_attr($field_value['font-style']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-style]" id="' . esc_attr($field_id) . '-font-style" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-style</option>';
foreach (ot_recognized_font_styles($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font variant */
if (in_array('font-variant', $ot_recognized_typography_fields)) {
$font_variant = isset($field_value['font-variant']) ? esc_attr($field_value['font-variant']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-variant]" id="' . esc_attr($field_id) . '-font-variant" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-variant</option>';
foreach (ot_recognized_font_variants($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_variant, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font weight */
if (in_array('font-weight', $ot_recognized_typography_fields)) {
$font_weight = isset($field_value['font-weight']) ? esc_attr($field_value['font-weight']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-weight]" id="' . esc_attr($field_id) . '-font-weight" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-weight</option>';
foreach (ot_recognized_font_weights($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_weight, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build letter spacing */
if (in_array('letter-spacing', $ot_recognized_typography_fields)) {
$letter_spacing = isset($field_value['letter-spacing']) ? esc_attr($field_value['letter-spacing']) : '';
echo '<select name="' . esc_attr($field_name) . '[letter-spacing]" id="' . esc_attr($field_id) . '-letter-spacing" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">letter-spacing</option>';
foreach (ot_recognized_letter_spacing($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($letter_spacing, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build line height */
if (in_array('line-height', $ot_recognized_typography_fields)) {
$line_height = isset($field_value['line-height']) ? esc_attr($field_value['line-height']) : '';
echo '<select name="' . esc_attr($field_name) . '[line-height]" id="' . esc_attr($field_id) . '-line-height" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">line-height</option>';
foreach (ot_recognized_line_heights($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($line_height, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build text decoration */
if (in_array('text-decoration', $ot_recognized_typography_fields)) {
$text_decoration = isset($field_value['text-decoration']) ? esc_attr($field_value['text-decoration']) : '';
echo '<select name="' . esc_attr($field_name) . '[text-decoration]" id="' . esc_attr($field_id) . '-text-decoration" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
//.........这里部分代码省略.........
示例2: ot_type_typography
function ot_type_typography($args = array())
{
/* turns arguments array into variables */
extract($args);
/* verify a description */
$has_desc = $field_desc ? true : false;
/* format setting outer wrapper */
echo '<div class="format-setting type-typography ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
/* description */
echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
/* format setting inner wrapper */
echo '<div class="format-setting-inner">';
/* build background colorpicker */
echo '<div class="option-tree-ui-colorpicker-input-wrap">';
/* colorpicker JS */
echo '<script>jQuery(document).ready(function($) { OT_UI.bind_colorpicker("' . esc_attr($field_id) . '-picker"); });</script>';
/* set background color */
$background_color = isset($field_value['font-color']) ? esc_attr($field_value['font-color']) : '';
/* set border color */
$border_color = in_array($background_color, array('#FFFFFF', '#FFF', '#ffffff', '#fff')) ? '#ccc' : $background_color;
/* input */
echo '<input type="text" name="' . esc_attr($field_name) . '[font-color]" id="' . esc_attr($field_id) . '-picker" value="' . esc_attr($background_color) . '" class="widefat option-tree-ui-input cp_input ' . esc_attr($field_class) . '" autocomplete="off" />';
echo '<div id="cp_' . esc_attr($field_id) . '-picker" class="cp_box"' . ($background_color ? " style='background-color:{$background_color}; border-color:{$border_color};'" : '') . '></div>';
echo '</div>';
/* build font family */
$font_family = isset($field_value['font-family']) ? esc_attr($field_value['font-family']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-family]" id="' . esc_attr($field_id) . '-family" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-family</option>';
foreach (ot_recognized_font_families($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
/* build font style */
$font_style = isset($field_value['font-style']) ? esc_attr($field_value['font-style']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-style]" id="' . esc_attr($field_id) . '-style" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-style</option>';
foreach (ot_recognized_font_styles($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
/* build font variant */
$font_variant = isset($field_value['font-variant']) ? esc_attr($field_value['font-variant']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-variant]" id="' . esc_attr($field_id) . '-variant" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-variant</option>';
foreach (ot_recognized_font_variants($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_variant, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
/* build font weight */
$font_weight = isset($field_value['font-weight']) ? esc_attr($field_value['font-weight']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-weight]" id="' . esc_attr($field_id) . '-weight" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-weight</option>';
foreach (ot_recognized_font_weights($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_weight, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
/* build font size */
$font_size = isset($field_value['font-size']) ? esc_attr($field_value['font-size']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-size]" id="' . esc_attr($field_id) . '-size" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-size</option>';
for ($i = 8; $i <= 72; $i++) {
$size = $i . 'px';
echo '<option value="' . esc_attr($size) . '" ' . selected($font_size, $size, false) . '>' . esc_attr($size) . '</option>';
}
echo '</select>';
echo '</div>';
echo '</div>';
}
示例3: ot_type_typography
function ot_type_typography($args = array())
{
/* turns arguments array into variables */
extract($args);
/* format setting outer wrapper */
echo '<div class="format-setting type-typography">';
/* format setting inner wrapper */
echo '<div class="format-setting-inner">';
/* allow fields to be filtered */
$ot_recognized_typography_fields = apply_filters('ot_recognized_typography_fields', array('font-color', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'letter-spacing', 'line-height', 'text-decoration', 'text-transform'), $field_id);
/* build background colorpicker */
if (in_array('font-color', $ot_recognized_typography_fields)) {
echo '<div class="option-tree-ui-colorpicker-input-wrap">';
/* colorpicker JS */
echo '<script>jQuery(document).ready(function($) { OT_UI.bind_colorpicker("' . esc_attr($field_id) . '-picker"); });</script>';
/* set background color */
$background_color = isset($field_value['font-color']) ? esc_attr($field_value['font-color']) : '';
/* set border color */
$border_color = in_array($background_color, array('#FFFFFF', '#FFF', '#ffffff', '#fff')) ? '#ccc' : $background_color;
/* input */
echo '<input maxlength="7" type="text" name="' . esc_attr($field_name) . '[font-color]" id="' . esc_attr($field_id) . '-picker" value="' . esc_attr($background_color) . '" class="widefat option-tree-ui-input cp_input ' . esc_attr($field_class) . '" autocomplete="off" placeholder="font-color" />';
echo '<div id="cp_' . esc_attr($field_id) . '-picker" class="cp_box"' . ($background_color ? " style='background-color:{$background_color}; border-color:{$border_color};'" : '') . '></div>';
echo '</div>';
}
/* build font family */
if (in_array('font-family', $ot_recognized_typography_fields)) {
$font_family = isset($field_value['font-family']) ? $field_value['font-family'] : '';
echo '<select name="' . esc_attr($field_name) . '[font-family]" id="' . esc_attr($field_id) . '-font-family" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-family</option>';
foreach (ot_recognized_font_families($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font size */
if (in_array('font-size', $ot_recognized_typography_fields)) {
$font_size = isset($field_value['font-size']) ? esc_attr($field_value['font-size']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-size]" id="' . esc_attr($field_id) . '-font-size" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-size</option>';
foreach (ot_recognized_font_sizes($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($font_size, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build font style */
if (in_array('font-style', $ot_recognized_typography_fields)) {
$font_style = isset($field_value['font-style']) ? esc_attr($field_value['font-style']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-style]" id="' . esc_attr($field_id) . '-font-style" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-style</option>';
foreach (ot_recognized_font_styles($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font variant */
if (in_array('font-variant', $ot_recognized_typography_fields)) {
$font_variant = isset($field_value['font-variant']) ? esc_attr($field_value['font-variant']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-variant]" id="' . esc_attr($field_id) . '-font-variant" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-variant</option>';
foreach (ot_recognized_font_variants($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_variant, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font weight */
if (in_array('font-weight', $ot_recognized_typography_fields)) {
$font_weight = isset($field_value['font-weight']) ? esc_attr($field_value['font-weight']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-weight]" id="' . esc_attr($field_id) . '-font-weight" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-weight</option>';
foreach (ot_recognized_font_weights($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_weight, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build letter spacing */
if (in_array('letter-spacing', $ot_recognized_typography_fields)) {
$letter_spacing = isset($field_value['letter-spacing']) ? esc_attr($field_value['letter-spacing']) : '';
echo '<select name="' . esc_attr($field_name) . '[letter-spacing]" id="' . esc_attr($field_id) . '-letter-spacing" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">letter-spacing</option>';
foreach (ot_recognized_letter_spacing($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($letter_spacing, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build line height */
if (in_array('line-height', $ot_recognized_typography_fields)) {
$line_height = isset($field_value['line-height']) ? esc_attr($field_value['line-height']) : '';
echo '<select name="' . esc_attr($field_name) . '[line-height]" id="' . esc_attr($field_id) . '-line-height" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">line-height</option>';
foreach (ot_recognized_line_heights($field_id) as $option) {
echo '<option value="' . esc_attr($option) . '" ' . selected($line_height, $option, false) . '>' . esc_attr($option) . '</option>';
}
echo '</select>';
}
/* build text decoration */
if (in_array('text-decoration', $ot_recognized_typography_fields)) {
$text_decoration = isset($field_value['text-decoration']) ? esc_attr($field_value['text-decoration']) : '';
echo '<select name="' . esc_attr($field_name) . '[text-decoration]" id="' . esc_attr($field_id) . '-text-decoration" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">text-decoration</option>';
foreach (ot_recognized_text_decorations($field_id) as $key => $value) {
//.........这里部分代码省略.........
示例4: ot_type_typography_heading
function ot_type_typography_heading($args = array())
{
/* turns arguments array into variables */
extract($args);
/* verify a description */
$has_desc = $field_desc ? true : false;
/* format setting outer wrapper */
echo '<div class="format-setting type-typography ' . ($has_desc ? 'has-desc' : 'no-desc') . '">';
/* description */
echo $has_desc ? '<div class="description">' . htmlspecialchars_decode($field_desc) . '</div>' : '';
/* format setting inner wrapper */
echo '<div class="format-setting-inner">';
/* allow fields to be filtered */
$ot_recognized_typography_fields = apply_filters('ot_recognized_typography_fields', array('font-color', 'font-family', 'font-style'), $field_id);
/* build font color */
if (in_array('font-color', $ot_recognized_typography_fields)) {
/* build colorpicker */
echo '<div class="option-tree-ui-colorpicker-input-wrap">';
/* colorpicker JS */
echo '<script>jQuery(document).ready(function($) { OT_UI.bind_colorpicker("' . esc_attr($field_id) . '-picker"); });</script>';
/* set background color */
$background_color = isset($field_value['font-color']) ? esc_attr($field_value['font-color']) : '';
/* input */
echo '<input type="text" name="' . esc_attr($field_name) . '[font-color]" id="' . esc_attr($field_id) . '-picker" value="' . esc_attr($background_color) . '" class="hide-color-picker ' . esc_attr($field_class) . '" />';
echo '</div>';
}
/* build font family */
if (in_array('font-family', $ot_recognized_typography_fields)) {
$font_family = isset($field_value['font-family']) ? $field_value['font-family'] : '';
echo '<select name="' . esc_attr($field_name) . '[font-family]" id="' . esc_attr($field_id) . '-font-family" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-family</option>';
foreach (ot_recognized_font_families($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_family, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
/* build font style */
if (in_array('font-style', $ot_recognized_typography_fields)) {
$font_style = isset($field_value['font-style']) ? esc_attr($field_value['font-style']) : '';
echo '<select name="' . esc_attr($field_name) . '[font-style]" id="' . esc_attr($field_id) . '-font-style" class="option-tree-ui-select ' . esc_attr($field_class) . '">';
echo '<option value="">font-style</option>';
foreach (ot_recognized_font_styles($field_id) as $key => $value) {
echo '<option value="' . esc_attr($key) . '" ' . selected($font_style, $key, false) . '>' . esc_attr($value) . '</option>';
}
echo '</select>';
}
echo '</div>';
echo '</div>';
}