本文整理汇总了PHP中postbox_classes函数的典型用法代码示例。如果您正苦于以下问题:PHP postbox_classes函数的具体用法?PHP postbox_classes怎么用?PHP postbox_classes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了postbox_classes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cmb_do_meta_boxes
/**
* Meta-Box template function
*
* @since 2.5.0
*
* @param string|object $screen Screen identifier
* @param string $context box context
* @param mixed $object gets passed to the box callback function as first parameter
* @return int number of meta_boxes
*/
function cmb_do_meta_boxes($screen, $context, $object)
{
global $wp_meta_boxes;
static $already_sorted = false;
if (empty($screen)) {
$screen = get_current_screen();
} elseif (is_string($screen)) {
$screen = convert_to_screen($screen);
}
$page = $screen->id;
$hidden = get_hidden_meta_boxes($screen);
$i = 0;
do {
// Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
if (!$already_sorted && ($sorted = get_user_option("meta-box-order_{$page}"))) {
foreach ($sorted as $box_context => $ids) {
foreach (explode(',', $ids) as $id) {
if ($id && 'dashboard_browser_nag' !== $id) {
add_meta_box($id, null, null, $screen, $box_context, 'sorted');
}
}
}
}
$already_sorted = true;
if (!isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context])) {
break;
}
foreach (array('high', 'sorted', 'core', 'default', 'low') as $priority) {
if (isset($wp_meta_boxes[$page][$context][$priority])) {
foreach ((array) $wp_meta_boxes[$page][$context][$priority] as $box) {
if (false == $box || !$box['title']) {
continue;
}
$i++;
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
?>
<div id="<?php
esc_attr_e($box['id']);
?>
" class="<?php
esc_attr_e(postbox_classes($box['id'], $page) . $hidden_class);
?>
">
<?php
call_user_func($box['callback'], $object, $box);
?>
</div>
<?php
}
}
}
} while (0);
return $i;
}
示例2: wpcf_admin_metabox_begin
function wpcf_admin_metabox_begin($title, $id = false, $table_id = false, $table_show = true)
{
$screen = get_current_screen();
$markup = sprintf('<div class="postbox %s" %s><div title="%s" class="handlediv"><br></div><h3 class="hndle">%s</h3><div class="inside">', postbox_classes($id, $screen->id), $id ? sprintf('id="%s"', $id) : '', __('Click to toggle'), $title);
if ($table_show) {
$markup .= sprintf('<table %s class="wpcf-types-form-table widefat"><tbody><tr><td>', $table_id ? sprintf('id="%s"', $table_id) : '');
}
return array('#type' => 'markup', '#markup' => $markup);
}
示例3: emulate_metabox
function emulate_metabox($post)
{
$post_type = !empty($post) ? $post->post_type : get_current_screen()->post_type;
if ('page' !== $post_type) {
return;
}
$box = array('id' => $this->args['page_slug'], 'title' => $this->args['page_title'], 'callback' => array(&$this, 'builder_settings_show'));
$page = get_current_screen()->id;
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . ' hidden" ' . '>' . "\n";
echo '<div class="handlediv" title="' . esc_attr__('Click to toggle', 'circleflip-builder') . '"><br /></div>';
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $post, $box);
echo "</div>\n";
echo "</div>\n";
}
示例4: do_meta_boxes
function do_meta_boxes($page, $context, $object) {
global $wp_meta_boxes;
if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
return;
foreach ( (array) $wp_meta_boxes[$page][$context] as $box ) {
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n";
echo "<h3>{$box['title']}</h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
echo "</div>\n";
echo "</div>\n";
}
}
示例5: _e
</label>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p><?php
_e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.');
?>
</p>
</div>
</div>
<div id="linkadvanceddiv" class="postbox <?php
echo postbox_classes('linkadvanceddiv', 'link');
?>
">
<h3><?php
_e('Advanced');
?>
</h3>
<div class="inside">
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr class="form-field">
<th valign="top" scope="row"><label for="link_image"><?php
_e('Image Address');
?>
</label></th>
<td><input type="text" name="link_image" id="link_image" size="50" value="<?php
echo $link->link_image;
示例6: nggallery_picturelist
//.........这里部分代码省略.........
<h2><?php
echo __ngettext('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo $gallery->title;
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid;
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<?php
if ($showTags) {
?>
<input type="hidden" name="showTags" value="true" /><?php
}
if ($hideThumbs) {
?>
<input type="hidden" name="hideThumbs" value="true" /><?php
}
?>
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
<div class="inside">
<table class="form-table" >
<tr>
<th align="left"><?php
_e('Title');
?>
:</th>
<th align="left"><input type="text" size="50" name="title" value="<?php
echo $gallery->title;
?>
" /></th>
<th align="right"><?php
_e('Page Link to', 'nggallery');
?>
:</th>
<th align="left">
<select name="pageid" style="width:95%">
<option value="0" ><?php
_e('Not linked', 'nggallery');
?>
</option>
<?php
parent_dropdown($gallery->pageid);
示例7: nggallery_picturelist
//.........这里部分代码省略.........
?>
<input type="hidden" name="page" value="manage-images" />
<?php
} else {
?>
<h2><?php
echo _n('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo esc_html(nggGallery::i18n($gallery->title));
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
if (nggGallery::current_user_can('NextGEN Edit gallery options')) {
?>
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
<div class="inside">
<table class="form-table" >
<tr>
<th align="left"><?php
_e('Title');
?>
:</th>
<th align="left"><input <?php
nggGallery::current_user_can_form('NextGEN Edit gallery title');
?>
type="text" size="50" name="title" value="<?php
echo esc_attr(stripslashes($gallery->title));
?>
" /></th>
<th align="right"><?php
_e('Page Link to', 'nggallery');
?>
:</th>
<th align="left">
<select <?php
nggGallery::current_user_can_form('NextGEN Edit gallery page id');
?>
name="pageid" style="width:95%">
示例8: do_meta_boxes
/**
* Meta-Box template function
*
* @since 2.5.0
*
* @param string|object $screen Screen identifier
* @param string $context box context
* @param mixed $object gets passed to the box callback function as first parameter
* @return int number of meta_boxes
*/
function do_meta_boxes($screen, $context, $object)
{
global $wp_meta_boxes;
static $already_sorted = false;
if (empty($screen)) {
$screen = get_current_screen();
} elseif (is_string($screen)) {
$screen = convert_to_screen($screen);
}
$page = $screen->id;
$hidden = get_hidden_meta_boxes($screen);
printf('<div id="%s-sortables" class="meta-box-sortables">', htmlspecialchars($context));
$i = 0;
do {
// Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
if (!$already_sorted && ($sorted = get_user_option("meta-box-order_{$page}"))) {
foreach ($sorted as $box_context => $ids) {
foreach (explode(',', $ids) as $id) {
if ($id && 'dashboard_browser_nag' !== $id) {
add_meta_box($id, null, null, $screen, $box_context, 'sorted');
}
}
}
}
$already_sorted = true;
if (!isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context])) {
break;
}
foreach (array('high', 'sorted', 'core', 'default', 'low') as $priority) {
if (isset($wp_meta_boxes[$page][$context][$priority])) {
foreach ((array) $wp_meta_boxes[$page][$context][$priority] as $box) {
if (false == $box || !$box['title']) {
continue;
}
$i++;
$style = '';
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
if ('dashboard_browser_nag' != $box['id']) {
echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
}
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
echo "</div>\n";
echo "</div>\n";
}
}
}
} while (0);
echo "</div>";
return $i;
}
示例9: attribute_escape
echo attribute_escape($post->post_name);
?>
" />
</div>
</div>
<?php
$authors = get_editable_user_ids($current_user->id);
// TODO: ROLE SYSTEM
if ($post->post_author && !in_array($post->post_author, $authors)) {
$authors[] = $post->post_author;
}
if ($authors && count($authors) > 1) {
?>
<div id="authordiv" class="postbox <?php
echo postbox_classes('authordiv', 'post');
?>
">
<h3><?php
_e('Post Author');
?>
</h3>
<div class="inside">
<?php
wp_dropdown_users(array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author));
?>
</div>
</div>
<?php
}
?>
示例10: do_meta_boxes
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $page
* @param unknown_type $context
* @param unknown_type $object
* @return int number of meta_boxes
*/
function do_meta_boxes($page, $context, $object) {
global $wp_meta_boxes;
static $already_sorted = false;
//do_action('do_meta_boxes', $page, $context, $object);
$hidden = get_hidden_meta_boxes($page);
echo "<div id='$context-sortables' class='meta-box-sortables'>\n";
$i = 0;
do {
// Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page", 0, false ) ) {
foreach ( $sorted as $box_context => $ids )
foreach ( explode(',', $ids) as $id )
if ( $id )
add_meta_box( $id, null, null, $page, $box_context, 'sorted' );
}
$already_sorted = true;
if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) )
break;
foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) {
if ( isset($wp_meta_boxes[$page][$context][$priority]) ) {
foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) {
if ( false == $box || ! $box['title'] )
continue;
$i++;
$style = '';
if ( in_array($box['id'], $hidden) )
$style = 'style="display:none;"';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '" ' . $style . '>' . "\n";
echo '<div class="handlediv" title="' . __('Click to toggle') . '"><br /></div>';
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
echo "</div>\n";
echo "</div>\n";
}
}
}
} while(0);
echo "</div>";
return $i;
}
示例11: nggallery_picturelist
//.........这里部分代码省略.........
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<?php
} else {
?>
<h2><?php
echo _n('Gallery', 'Galleries', 1, 'nggallery');
?>
: <?php
echo nggGallery::i18n($gallery->title);
?>
</h2>
<br style="clear: both;" />
<form id="updategallery" class="nggform" method="POST" action="<?php
echo $ngg->manage_page->base_page . '&mode=edit&gid=' . $act_gid . '&paged=' . $_GET['paged'];
?>
" accept-charset="utf-8">
<?php
wp_nonce_field('ngg_updategallery');
?>
<input type="hidden" name="page" value="manage-images" />
<div id="poststuff">
<?php
wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
?>
<div id="gallerydiv" class="postbox <?php
echo postbox_classes('gallerydiv', 'ngg-manage-gallery');
?>
" >
<h3><?php
_e('Gallery settings', 'nggallery');
?>
<small> (<?php
_e('Click here for more settings', 'nggallery');
?>
)</small></h3>
<div class="inside">
<table class="form-table" >
<tr>
<th align="left"><?php
_e('Title');
?>
:</th>
<th align="left"><input type="text" size="50" name="title" value="<?php
echo $gallery->title;
?>
" /></th>
<th align="right"><?php
_e('Page Link to', 'nggallery');
?>
:</th>
<th align="left">
<select name="pageid" style="width:95%">
<option value="0" ><?php
_e('Not linked', 'nggallery');
?>
</option>
<?php
parent_dropdown($gallery->pageid);
示例12: postbox_classes
<div id="pageorderdiv" class="postbox <?php echo postbox_classes('pageorderdiv', 'page'); ?>">
<h3><?php _e('Page Order') ?></h3>
<div class="inside">
<p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
</div>
</div>
<?php
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
if ( $post->post_author && !in_array($post->post_author, $authors) )
$authors[] = $post->post_author;
if ( $authors && count( $authors ) > 1 ) :
?>
<div id="pageauthordiv" class="postbox <?php echo postbox_classes('pageauthordiv', 'page'); ?>">
<h3><?php _e('Page Author'); ?></h3>
<div class="inside">
<?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post_ID) ? $user_ID : $post->post_author) ); ?>
</div>
</div>
<?php endif; ?>
<?php do_meta_boxes('page', 'advanced', $post); ?>
</div>
</div>
</div>
</form>
示例13: printf
<li><a href="<?php
printf('#%s', $meta_box['id']);
?>
"><?php
echo $meta_box['title'];
?>
</a></li>
<?php
}
?>
</ul>
<?php
foreach ($view_args['meta_boxes'] as $meta_box) {
?>
<div id="<?php
echo $meta_box['id'];
?>
" class="postbox <?php
echo postbox_classes($meta_box['id'], 'campaign');
?>
">
<div class="inside">
<?php
call_user_func($meta_box['callback'], $post, $meta_box);
?>
</div>
</div>
<?php
}
?>
</div>
示例14: xfn_check
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
<?php _e('date') ?></label>
<label for="romantic">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
<?php _e('sweetheart') ?></label>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
</div>
</div>
<div id="linkadvanceddiv" class="postbox <?php echo postbox_classes('linkadvanceddiv', 'link'); ?>">
<h3><?php _e('Advanced') ?></h3>
<div class="inside">
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
<tr class="form-field">
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
<td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
</tr>
<tr class="form-field">
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
</tr>
示例15: postbox_classes
/**
* Get saved postbox states
*/
function postbox_classes($css_id)
{
if (function_exists('postbox_classes')) {
return postbox_classes($css_id, $this->page);
} else {
return "";
}
}