本文整理汇总了PHP中_media_states函数的典型用法代码示例。如果您正苦于以下问题:PHP _media_states函数的具体用法?PHP _media_states怎么用?PHP _media_states使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_media_states函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_rows
//.........这里部分代码省略.........
<?php
}
}
?>
</td>
<?php
break;
case 'title':
?>
<td <?php
echo $attributes;
?>
><strong>
<?php
if ($this->is_trash || !$user_can_edit) {
echo $att_title;
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID);
?>
"
title="<?php
echo esc_attr(sprintf(__('Edit “%s”'), $att_title));
?>
">
<?php
echo $att_title;
?>
</a>
<?php
}
_media_states($post);
?>
</strong>
<p class="filename"><?php
echo wp_basename($post->guid);
?>
</p>
<?php
echo $this->row_actions($this->_get_row_actions($post, $att_title));
?>
</td>
<?php
break;
case 'author':
?>
<td <?php
echo $attributes;
?>
><?php
printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('author' => get_the_author_meta('ID')), 'upload.php')), get_the_author());
?>
</td>
<?php
break;
case 'desc':
?>
<td <?php
echo $attributes;
?>
><?php
echo has_excerpt() ? $post->post_excerpt : '';
?>
示例2: display_rows
//.........这里部分代码省略.........
<?php
}
}
?>
</td>
<?php
break;
case 'title':
?>
<td <?php
echo $attributes;
?>
><strong>
<?php
if ($this->is_trash || !$user_can_edit) {
echo $att_title;
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID, true);
?>
"
title="<?php
echo esc_attr(sprintf(__('Edit “%s”'), $att_title));
?>
">
<?php
echo $att_title;
?>
</a>
<?php
}
_media_states($post);
?>
</strong>
<p>
<?php
if (preg_match('/^.*?\\.(\\w+)$/', get_attached_file($post->ID), $matches)) {
echo esc_html(strtoupper($matches[1]));
} else {
echo strtoupper(str_replace('image/', '', get_post_mime_type()));
}
?>
</p>
<?php
echo $this->row_actions($this->_get_row_actions($post, $att_title));
?>
</td>
<?php
break;
case 'author':
?>
<td <?php
echo $attributes;
?>
><?php
the_author();
?>
</td>
<?php
break;
case 'tags':
?>
<td <?php
echo $attributes;
示例3: column_title
/**
* Handles the title column output.
*
* @since 4.3.0
* @access public
*
* @param WP_Post $post The current WP_Post object.
*/
public function column_title($post)
{
list($mime) = explode('/', $post->post_mime_type);
$title = _draft_or_post_title();
$thumb = wp_get_attachment_image($post->ID, array(60, 60), true, array('alt' => ''));
$link_start = $link_end = '';
if (current_user_can('edit_post', $post->ID) && !$this->is_trash) {
$link_start = '<a href="' . get_edit_post_link($post->ID) . '">';
$link_end = '</a>';
}
$class = $thumb ? ' class="has-media-icon"' : '';
?>
<strong<?php
echo $class;
?>
>
<?php
echo $link_start;
?>
<?php
if ($thumb) {
?>
<span class="media-icon <?php
echo sanitize_html_class($mime . '-icon');
?>
"><?php
echo $thumb;
?>
</span>
<?php
}
?>
<span aria-hidden="true"><?php
echo $title;
?>
</span>
<span class="screen-reader-text"><?php
printf(__('Edit “%s”'), $title);
?>
</span>
<?php
echo $link_end;
?>
<?php
_media_states($post);
?>
</strong>
<p class="filename"><span class="screen-reader-text"><?php
_e('File name:');
?>
</span><?php
echo wp_basename($post->guid);
?>
</p>
<?php
}
示例4: column_title
/**
* @since 4.3.0
*
* @param WP_Post $post
*/
public function column_title($post)
{
list($mime) = explode('/', $post->post_mime_type);
$user_can_edit = current_user_can('edit_post', $post->ID);
$att_title = _draft_or_post_title();
?>
<div class="media-icon <?php
echo $mime;
?>
-icon">
<?php
$thumb = wp_get_attachment_image($post->ID, array(60, 60), true);
if ($thumb) {
if ($this->is_trash || !$user_can_edit) {
echo $thumb;
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID);
?>
" title="<?php
echo esc_attr(sprintf(__('Edit “%s”'), $att_title));
?>
"><?php
echo $thumb;
?>
</a><?php
}
}
?>
</div>
<div class="media-info">
<strong>
<?php
if ($this->is_trash || !$user_can_edit) {
echo $att_title;
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID);
?>
" title="<?php
echo esc_attr(sprintf(__('Edit “%s”'), $att_title));
?>
"><?php
echo $att_title;
?>
</a><?php
}
_media_states($post);
?>
</strong>
<p class="filename"><?php
echo wp_basename($post->guid);
?>
</p>
</div>
<?php
}
示例5: single_row
//.........这里部分代码省略.........
case 'title':
?>
<td <?php
echo $attributes;
?>
><strong>
<?php
$thumb = wp_get_attachment_image($post->ID, array(80, 60), true);
if ($this->is_trash || !$user_can_edit) {
if ($thumb) {
echo '<span class="media-icon image-icon">' . $thumb . '</span>';
}
echo '<span aria-hidden="true">' . $att_title . '</span>';
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID);
?>
" title="<?php
echo esc_attr(sprintf(__('Edit “%s”', 'gallery-plugin'), $att_title));
?>
">
<?php
if ($thumb) {
echo '<span class="media-icon image-icon">' . $thumb . '</span>';
}
?>
<?php
echo '<span aria-hidden="true">' . $att_title . '</span>';
?>
</a>
<?php
}
_media_states($post);
?>
</strong>
<p class="filename"><?php
echo wp_basename($post->guid);
?>
</p>
<?php
echo $this->row_actions($this->_get_row_actions($post, $att_title));
?>
<a href="#" class="gllr_info_show hidden"><?php
_e('Edit Attachment Info', 'gallery-plugin');
?>
</a>
</td>
<?php
break;
case 'dimensions':
?>
<td <?php
echo $attributes;
?>
data-colname="<?php
_e('Dimensions', 'gallery-plugin');
?>
">
<?php
echo $attachment_metadata['width'];
?>
× <?php
echo $attachment_metadata['height'];
?>
</td>
示例6: column_title
/**
* Handles the title column output.
*
* @since 4.3.0
* @access public
*
* @param WP_Post $post The current WP_Post object.
*/
public function column_title($post)
{
list($mime) = explode('/', $post->post_mime_type);
$title = _draft_or_post_title();
$thumb = wp_get_attachment_image($post->ID, array(60, 60), true, array('alt' => ''));
$link_start = $link_end = '';
if (current_user_can('edit_post', $post->ID) && !$this->is_trash) {
$link_start = sprintf('<a href="%s" aria-label="%s">', get_edit_post_link($post->ID), esc_attr(sprintf(__('“%s” (Edit)'), $title)));
$link_end = '</a>';
}
$class = $thumb ? ' class="has-media-icon"' : '';
?>
<strong<?php
echo $class;
?>
>
<?php
echo $link_start;
if ($thumb) {
?>
<span class="media-icon <?php
echo sanitize_html_class($mime . '-icon');
?>
"><?php
echo $thumb;
?>
</span>
<?php
}
echo $title . $link_end;
_media_states($post);
?>
</strong>
<p class="filename">
<span class="screen-reader-text"><?php
_e('File name:');
?>
</span>
<?php
$file = get_attached_file($post->ID);
echo esc_html(wp_basename($file));
?>
</p>
<?php
}
示例7: page_generator
/**
* Render the webcomic generator.
*
* @uses Webcomic::$config
* @uses Webcomic::get_attachments()
*/
public function page_generator()
{
global $post;
$attachments = self::get_attachments();
$columns = '
<tr>
<th class="check-column"><input type="checkbox"></th>
<th class="column-icon"></th>
<th>' . __('File', "webcomic") . '</th>
</tr>';
?>
<div class="wrap">
<div class="icon32" id="icon-upload"></div>
<h2><?php
echo get_admin_page_title();
?>
</h2>
<form method="post" class="webcomic-generator" data-webcomic-daycheck="<?php
esc_attr_e('The start date is not one of the selected publish days. Continue anyway?', "webcomic");
?>
">
<?php
wp_nonce_field('webcomic_generate', 'webcomic_generate');
?>
<div id="col-container">
<div id="col-right">
<div class="col-wrap">
<table class="wp-list-table widefat fixed posts">
<thead><?php
echo $columns;
?>
</thead>
<tfoot><?php
echo $columns;
?>
</tfoot>
<tbody>
<?php
$i = 0;
if ($attachments) {
foreach ($attachments as $attachment) {
$post = $attachment;
?>
<tr<?php
echo $i % 2 ? '' : ' class="alternate"';
?>
>
<th class="check-column"><input type="checkbox" name="attachments[]" id="attachment-<?php
echo $attachment->ID;
?>
" value="<?php
echo $attachment->ID;
?>
"></th>
<td class="media-icon"><label for="attachment-<?php
echo $attachment->ID;
?>
"><?php
echo wp_get_attachment_image($attachment->ID, array(60, 60));
?>
</label></td>
<td>
<a href="<?php
echo esc_url(add_query_arg(array('post' => $attachment->ID, 'action' => 'edit'), admin_url('post.php')));
?>
"><span class="row-title"><?php
echo get_the_title($attachment->ID);
?>
</span></a><b><?php
_media_states($attachment);
?>
</b>
<p><?php
echo preg_match('/^.*?\\.(\\w+)$/', get_attached_file($attachment->ID), $matches) ? esc_html(strtoupper($matches[1])) : strtoupper(str_replace('image/', '', get_post_mime_type($attachment->ID)));
?>
</p>
</td>
</tr>
<?php
$i++;
}
} else {
?>
<tr class="no-items">
<td colspan="3"><?php
_e('No unattached media found.', "webcomic");
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
//.........这里部分代码省略.........
示例8: display_rows
//.........这里部分代码省略.........
</a>
<?php
}
}
?>
</td>
<?php
break;
case 'title':
?>
<td <?php
echo $attributes;
?>
><strong>
<?php
if ($this->is_trash || !$user_can_edit) {
echo $att_title;
} else {
?>
<a href="<?php
echo get_edit_post_link($post->ID, true);
?>
"
title="<?php
echo esc_attr(sprintf(__('Edit “%s”'), $att_title));
?>
">
<?php
echo $att_title;
?>
</a>
<?php
}
_media_states($post);
?>
</strong>
<p>
<?php
if (preg_match('/^.*?\\.(\\w+)$/', get_attached_file($post->ID), $matches)) {
echo esc_html(strtoupper($matches[1]));
} else {
echo strtoupper(str_replace('image/', "", get_post_mime_type()));
}
?>
</p>
<?php
echo $this->row_actions($this->_get_row_actions($post, $att_title));
?>
</td>
<?php
break;
case 'author':
?>
<td <?php
echo $attributes;
?>
>
<?php
printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('author' => get_the_author_meta('ID')), 'upload.php')), get_the_author());
?>
</td>
<?php
break;
case 'date':
if ('0000-00-00 00:00:00' == $post->post_date) {
$h_time = __('Unpublished', 'wp-user-avatar');