本文整理汇总了PHP中RW_Meta_Box::add_cssclass方法的典型用法代码示例。如果您正苦于以下问题:PHP RW_Meta_Box::add_cssclass方法的具体用法?PHP RW_Meta_Box::add_cssclass怎么用?PHP RW_Meta_Box::add_cssclass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RW_Meta_Box
的用法示例。
在下文中一共展示了RW_Meta_Box::add_cssclass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: html
/**
* Get field HTML
*
* @param string $html
* @param mixed $meta
* @param array $field
*
* @return string
*/
static function html($html, $meta, $field)
{
if (!is_array($meta)) {
$meta = (array) $meta;
}
$i18n_msg = _x('Uploaded files', 'image upload', 'rwmb');
$i18n_title = _x('Upload files', 'image upload', 'rwmb');
// Filter to change the drag & drop box background string
$i18n_drop = apply_filters('rwmb_upload_drop_string', _x('Drop images here', 'image upload', 'rwmb'));
$i18n_or = _x('or', 'image upload', 'rwmb');
$i18n_select = _x('Select Files', 'image upload', 'rwmb');
$img_prefix = $field['id'];
$html = wp_nonce_field("rwmb-delete-file_{$field['id']}", "nonce-delete-file_{$field['id']}", false, false);
$html .= wp_nonce_field("rwmb-reorder-images_{$field['id']}", "nonce-reorder-images_{$field['id']}", false, false);
$html .= wp_nonce_field("rwmb-upload-images_{$field['id']}", "nonce-upload-images_{$field['id']}", false, false);
$html .= "<input type='hidden' class='field-id rwmb-image-prefix' value='{$field['id']}' />";
// Uploaded images
$html .= "<div id='{$img_prefix}-container'>";
// Check for max_file_uploads
$class = 'rwmb-drag-drop hide-if-no-js';
if (!empty($field['max_file_uploads'])) {
$max_file_uploads = (int) $field['max_file_uploads'];
$html .= "<input class='max_file_uploads' type='hidden' value='{$max_file_uploads}' />";
if (count($meta) >= $max_file_uploads) {
$class = RW_Meta_Box::add_cssclass('hidden', $class);
}
}
$html .= "<h4 class='rwmb-uploaded-title'>{$i18n_msg}</h4>";
$html .= "<ul class='rwmb-images rwmb-uploaded'>";
foreach ($meta as $image) {
$html .= self::img_html($image);
}
$html .= '</ul>';
// Show form upload
$html .= "\n\t\t\t\t<h4>{$i18n_title}</h4>\n\t\t\t\t<div id='{$img_prefix}-dragdrop' class='{$class}'>\n\t\t\t\t\t<div class = 'rwmb-drag-drop-inside'>\n\t\t\t\t\t\t<p>{$i18n_drop}</p>\n\t\t\t\t\t\t<p>{$i18n_or}</p>\n\t\t\t\t\t\t<p><input id='{$img_prefix}-browse-button' type='button' value='{$i18n_select}' class='button' /></p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t";
$html .= '</div>';
return $html;
}