本文整理汇总了PHP中get_inline_data函数的典型用法代码示例。如果您正苦于以下问题:PHP get_inline_data函数的具体用法?PHP get_inline_data怎么用?PHP get_inline_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_inline_data函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: render_product_columns
/**
* Ouput custom columns for products
*
* @param string $column
*/
public function render_product_columns($column)
{
global $post, $the_product;
if (empty($the_product) || $the_product->id != $post->ID) {
$the_product = wc_get_product($post);
}
switch ($column) {
case 'thumb':
echo '<a href="' . get_edit_post_link($post->ID) . '">' . $the_product->get_image('post-thumbnail') . '</a>';
break;
case 'name':
$edit_link = get_edit_post_link($post->ID);
$title = _draft_or_post_title();
echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . $title . '</a>';
_post_states($post);
echo '</strong>';
if ($post->post_parent > 0) {
echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>';
}
// Excerpt view
if (isset($_GET['mode']) && 'excerpt' == $_GET['mode']) {
echo apply_filters('the_excerpt', $post->post_excerpt);
}
$this->_render_product_row_actions($post, $title);
get_inline_data($post);
/* Custom inline data for woocommerce */
echo '
<div class="hidden" id="woocommerce_inline_' . $post->ID . '">
<div class="menu_order">' . $post->menu_order . '</div>
<div class="sku">' . $the_product->sku . '</div>
<div class="regular_price">' . $the_product->regular_price . '</div>
<div class="sale_price">' . $the_product->sale_price . '</div>
<div class="weight">' . $the_product->weight . '</div>
<div class="length">' . $the_product->length . '</div>
<div class="width">' . $the_product->width . '</div>
<div class="height">' . $the_product->height . '</div>
<div class="shipping_class">' . $the_product->get_shipping_class() . '</div>
<div class="visibility">' . $the_product->visibility . '</div>
<div class="stock_status">' . $the_product->stock_status . '</div>
<div class="stock">' . $the_product->stock . '</div>
<div class="manage_stock">' . $the_product->manage_stock . '</div>
<div class="featured">' . $the_product->featured . '</div>
<div class="product_type">' . $the_product->product_type . '</div>
<div class="product_is_virtual">' . $the_product->virtual . '</div>
<div class="tax_status">' . $the_product->tax_status . '</div>
<div class="tax_class">' . $the_product->tax_class . '</div>
<div class="backorders">' . $the_product->backorders . '</div>
</div>
';
break;
case 'sku':
echo $the_product->get_sku() ? $the_product->get_sku() : '<span class="na">–</span>';
break;
case 'product_type':
if ('grouped' == $the_product->product_type) {
echo '<span class="product-type tips grouped" data-tip="' . esc_attr__('Grouped', 'woocommerce') . '"></span>';
} elseif ('external' == $the_product->product_type) {
echo '<span class="product-type tips external" data-tip="' . esc_attr__('External/Affiliate', 'woocommerce') . '"></span>';
} elseif ('simple' == $the_product->product_type) {
if ($the_product->is_virtual()) {
echo '<span class="product-type tips virtual" data-tip="' . esc_attr__('Virtual', 'woocommerce') . '"></span>';
} elseif ($the_product->is_downloadable()) {
echo '<span class="product-type tips downloadable" data-tip="' . esc_attr__('Downloadable', 'woocommerce') . '"></span>';
} else {
echo '<span class="product-type tips simple" data-tip="' . esc_attr__('Simple', 'woocommerce') . '"></span>';
}
} elseif ('variable' == $the_product->product_type) {
echo '<span class="product-type tips variable" data-tip="' . esc_attr__('Variable', 'woocommerce') . '"></span>';
} else {
// Assuming that we have other types in future
echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . ucfirst($the_product->product_type) . '"></span>';
}
break;
case 'price':
echo $the_product->get_price_html() ? $the_product->get_price_html() : '<span class="na">–</span>';
break;
case 'product_cat':
case 'product_tag':
if (!($terms = get_the_terms($post->ID, $column))) {
echo '<span class="na">–</span>';
} else {
$termlist = array();
foreach ($terms as $term) {
$termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=product') . ' ">' . $term->name . '</a>';
}
echo implode(', ', $termlist);
}
break;
case 'featured':
$url = wp_nonce_url(admin_url('admin-ajax.php?action=woocommerce_feature_product&product_id=' . $post->ID), 'woocommerce-feature-product');
echo '<a href="' . esc_url($url) . '" title="' . __('Toggle featured', 'woocommerce') . '">';
if ($the_product->is_featured()) {
echo '<span class="wc-featured tips" data-tip="' . esc_attr__('Yes', 'woocommerce') . '">' . __('Yes', 'woocommerce') . '</span>';
} else {
echo '<span class="wc-featured not-featured tips" data-tip="' . esc_attr__('No', 'woocommerce') . '">' . __('No', 'woocommerce') . '</span>';
//.........这里部分代码省略.........
开发者ID:vkolova,项目名称:bgscena,代码行数:101,代码来源:class-wc-admin-post-types.php
示例2: eventon_custom_event_columns
/**
* Custom Columns for event page
*
* @access public
* @param mixed $column
* @return void
*/
function eventon_custom_event_columns($column, $post_id)
{
global $post, $eventon;
//if ( empty( $ajde_events ) || $ajde_events->id != $post->ID )
//$ajde_events = get_product( $post );
$pmv = get_post_custom($post_id);
switch ($column) {
case has_filter("evo_column_type_{$column}"):
$content = apply_filters("evo_column_type_{$column}", $post_id);
echo $content;
break;
case "thumb":
//echo '<a href="' . get_edit_post_link( $post->ID ) . '">' . $ajde_events->get_image() . '</a>';
break;
case "name":
$edit_link = get_edit_post_link($post->ID);
$title = _draft_or_post_title();
$post_type_object = get_post_type_object($post->post_type);
$can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID);
echo "<div class='evoevent_item'>";
$img_src = $eventon->evo_admin->get_image('thumbnail', false);
$event_color = eventon_get_hex_color($pmv);
echo '<a class="evoevent_image" href="' . get_edit_post_link($post_id) . '">';
if ($img_src) {
echo '<img class="evoEventCirc" src="' . $img_src . '"/>';
} else {
echo '<span class="evoEventCirc" style="background-color:' . $event_color . '"></span>';
}
echo '</a><div class="evo_item_details">';
if ($can_edit_post) {
echo '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>';
} else {
echo '<strong>' . $title . '';
}
_post_states($post);
echo '</strong>';
if ($post->post_parent > 0) {
echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>';
}
// Excerpt view
if (isset($_GET['mode']) && $_GET['mode'] == 'excerpt') {
echo apply_filters('the_excerpt', $post->post_excerpt);
}
// Get actions
$actions = array();
$actions['id'] = 'ID: ' . $post->ID;
if ($can_edit_post && 'trash' != $post->post_status) {
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>';
}
if (current_user_can($post_type_object->cap->delete_post, $post->ID)) {
if ('trash' == $post->post_status) {
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
} elseif (EMPTY_TRASH_DAYS) {
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
}
}
if ($post_type_object->public) {
if (in_array($post->post_status, array('pending', 'draft', 'future'))) {
if ($can_edit_post) {
$actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
}
} elseif ('trash' != $post->post_status) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
}
$actions = apply_filters('post_row_actions', $actions, $post);
echo '<div class="row-actions">';
$i = 0;
$action_count = sizeof($actions);
foreach ($actions as $action => $link) {
++$i;
$i == $action_count ? $sep = '' : ($sep = ' | ');
echo "<span class='{$action}'>{$link}{$sep}</span>";
}
echo '</div>';
get_inline_data($post);
$event = $eventon->evo_event->get_event($post->ID);
//print_r($event);
/* Custom inline data for eventon */
echo '<div class="hidden" id="eventon_inline_' . $post->ID . '">';
foreach ($eventon->evo_event->get_event_fields_edit() as $field) {
$value = !empty($event->{$field}) ? $event->{$field} : null;
echo "<div class='{$field}'>{$value}</div>";
}
echo "<div class='_menu_order'>" . $post->menu_order . "</div>";
echo '</div>';
echo '</div>';
break;
case "event_type":
//.........这里部分代码省略.........
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:101,代码来源:ajde_events.php
示例3: cwp_post_row
//.........这里部分代码省略.........
}
if (current_user_can('delete_post', $post->ID)) {
if ('trash' == $post->post_status) {
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this post from the Trash')) . "' href='" . $untrash_link . "'>" . __('Restore') . "</a>";
} elseif (EMPTY_TRASH_DAYS) {
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this post to the Trash')) . "' href='" . $trash_link . "'>" . __('Trash') . "</a>";
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . wp_nonce_url($delete_link, 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
}
}
/*
if ( current_user_can('delete_post', $post->ID) ) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post')) . "' href='" . wp_nonce_url($delete_link, 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . esc_js(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
}
*/
if (in_array($post->post_status, array('pending', 'draft'))) {
if (current_user_can('edit_post', $post->ID)) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
}
} else {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
$actions = apply_filters('post_row_actions', $actions, $post);
$action_count = count($actions);
$i = 0;
echo '<div class="row-actions">';
foreach ($actions as $action => $link) {
++$i;
$i == $action_count ? $sep = '' : ($sep = ' | ');
echo "<span class='{$action}'>{$link}{$sep}</span>";
}
echo '</div>';
get_inline_data($post);
?>
</td>
<?php
break;
case 'categories':
?>
<td <?php
echo $attributes;
?>
><?php
$categories = get_the_category();
if (!empty($categories)) {
$out = array();
foreach ($categories as $c) {
$out[] = "<a href='edit.php?category_name={$c->slug}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
}
echo join(', ', $out);
} else {
_e('Uncategorized');
}
?>
</td>
<?php
break;
case 'tags':
?>
<td <?php
echo $attributes;
?>
><?php
$tags = get_the_tags($post->ID);
if (!empty($tags)) {
开发者ID:adamcarlile,项目名称:Alex-Goy,代码行数:67,代码来源:cwp.page.manage.php
示例4: display_page_row
/**
* {@internal Missing Short Description}}
*
* @since unknown
*
* @param unknown_type $page
* @param unknown_type $level
*/
function display_page_row( $page, $level = 0 ) {
global $post;
static $rowclass;
$post = $page;
setup_postdata($page);
$page->post_title = wp_specialchars( $page->post_title );
$pad = str_repeat( '— ', $level );
$id = (int) $page->ID;
$rowclass = 'alternate' == $rowclass ? '' : 'alternate';
$posts_columns = get_column_headers('edit-pages');
$hidden = get_hidden_columns('edit-pages');
$title = _draft_or_post_title();
?>
<tr id="page-<?php echo $id; ?>" class="<?php echo $rowclass; ?> iedit">
<?php
foreach ($posts_columns as $column_name=>$column_display_name) {
$class = "class=\"$column_name column-$column_name\"";
$style = '';
if ( in_array($column_name, $hidden) )
$style = ' style="display:none;"';
$attributes = "$class$style";
switch ($column_name) {
case 'cb':
?>
<th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /></th>
<?php
break;
case 'date':
if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) {
$t_time = $h_time = __('Unpublished');
} else {
$t_time = get_the_time(__('Y/m/d g:i:s A'));
$m_time = $page->post_date;
$time = get_post_time('G', true);
if ( ( abs(time() - $time) ) < 86400 ) {
if ( ( 'future' == $page->post_status) )
$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
else
$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
} else {
$h_time = mysql2date(__('Y/m/d'), $m_time);
}
}
echo '<td ' . $attributes . '>';
echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>';
echo '<br />';
if ( 'publish' == $page->post_status || 'future' == $page->post_status )
_e('Published');
else
_e('Last Modified');
echo '</td>';
break;
case 'title':
$attributes = 'class="post-title page-title column-title"' . $style;
$edit_link = get_edit_post_link( $page->ID );
?>
<td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); ?></strong>
<?php
$actions = array();
if ( current_user_can('edit_page', $page->ID) ) {
$actions['edit'] = '<a href="' . $edit_link . '" title="' . attribute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>';
$actions['inline'] = '<a href="#" class="editinline">' . __('Quick Edit') . '</a>';
$actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
}
if ( in_array($post->post_status, array('pending', 'draft')) ) {
if ( current_user_can('edit_page', $page->ID) )
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
} else {
$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
$action_count = count($actions);
$i = 0;
echo '<div class="row-actions">';
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
echo "<span class='$action'>$link$sep</span>";
}
echo '</div>';
get_inline_data($post);
echo '</td>';
break;
//.........这里部分代码省略.........
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:101,代码来源:template.php
示例5: single_row
//.........这里部分代码省略.........
$locked_avatar = $locked_text = '';
}
echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
}
if (!$this->hierarchical_display && 'excerpt' == $mode && current_user_can('read_post', $post->ID)) {
the_excerpt();
}
$actions = array();
if ($can_edit_post && 'trash' != $post->post_status) {
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>';
}
if (current_user_can('delete_post', $post->ID)) {
if ('trash' == $post->post_status) {
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
} elseif (EMPTY_TRASH_DAYS) {
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
}
}
if ($post_type_object->public) {
if (in_array($post->post_status, array('pending', 'draft', 'future'))) {
if ($can_edit_post) {
$actions['view'] = '<a href="' . esc_url(apply_filters('preview_post_link', set_url_scheme(add_query_arg('preview', 'true', get_permalink($post->ID))))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
}
} elseif ('trash' != $post->post_status) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
}
$actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post);
echo $this->row_actions($actions);
get_inline_data($post);
echo '</td>';
break;
case 'date':
if ('0000-00-00 00:00:00' == $post->post_date) {
$t_time = $h_time = __('Unpublished');
$time_diff = 0;
} else {
$t_time = get_the_time(__('Y/m/d g:i:s A'));
$m_time = $post->post_date;
$time = get_post_time('G', true, $post);
$time_diff = time() - $time;
if ($time_diff > 0 && $time_diff < DAY_IN_SECONDS) {
$h_time = sprintf(__('%s ago'), human_time_diff($time));
} else {
$h_time = mysql2date(__('Y/m/d'), $m_time);
}
}
echo '<td ' . $attributes . '>';
if ('excerpt' == $mode) {
echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
} else {
echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>';
}
echo '<br />';
if ('publish' == $post->post_status) {
_e('Published');
} elseif ('future' == $post->post_status) {
if ($time_diff > 0) {
echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
} else {
_e('Scheduled');
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:67,代码来源:class-wp-posts-list-table.php
示例6: manage_posts_custom_column
function manage_posts_custom_column($column)
{
global $post;
switch ($column) {
case "attendees":
global $wpdb;
$event = $post instanceof Eab_EventModel ? $post : new Eab_EventModel($post);
$yes = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . Eab_EventsHub::tablename(Eab_EventsHub::BOOKING_TABLE) . " WHERE event_id = %d AND status = %s;", $event->get_id(), Eab_EventModel::BOOKING_YES));
$no = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . Eab_EventsHub::tablename(Eab_EventsHub::BOOKING_TABLE) . " WHERE event_id = %d AND status = %s;", $event->get_id(), Eab_EventModel::BOOKING_NO));
$maybe = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . Eab_EventsHub::tablename(Eab_EventsHub::BOOKING_TABLE) . " WHERE event_id = %d AND status = %s;", $event->get_id(), Eab_EventModel::BOOKING_MAYBE));
printf('<b>' . __('Attending / Undecided', self::TEXT_DOMAIN) . ':</b> %d / %d<br />', $yes, $maybe);
printf('<b>' . __('Not Attending', self::TEXT_DOMAIN) . ':</b> %d', $no);
echo ' ';
echo '<a class="button" href="' . admin_url('index.php?eab_export=attendees&event_id=' . $event->get_id()) . '" class="eab-export_attendees">' . __('Export', self::TEXT_DOMAIN) . '</a>';
break;
case "start":
$event = new Eab_EventModel($post);
$df = get_option('date_format', 'Y-m-d');
if (!$event->is_recurring()) {
echo date_i18n($df, $event->get_start_timestamp()) . ' - ' . date_i18n($df, $event->get_end_timestamp());
} else {
$repeats = $event->get_supported_recurrence_intervals();
$title = @$repeats[$event->get_recurrence()];
$start = date_i18n($df, $event->get_recurrence_starts());
$end = date_i18n($df, $event->get_recurrence_ends());
printf(__("From %s, repeats every %s until %s", self::TEXT_DOMAIN), $start, $title, $end);
}
break;
case "venue":
$event = new Eab_EventModel($post);
echo $event->get_venue_location();
break;
case "event":
$event = new Eab_EventModel($post);
$post_type_object = get_post_type_object($post->post_type);
$edit_link = get_edit_post_link($event->get_id());
$statuses = array();
if ('draft' == $post->post_status) {
$statuses[] = __('Draft');
}
if ('private' == $post->post_status) {
$statuses[] = __('Private');
}
if ('pending' == $post->post_status) {
$statuses[] = __('Pending');
}
$status = $statuses ? ' - <span class="post-state">' . join(', ', $statuses) . '</span>' : '';
$title = current_user_can($post_type_object->cap->edit_post, $event->get_id()) && 'trash' != $post->post_status ? '<strong>' . '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf(__('Edit “%s”'), $event->get_title())) . '">' . $event->get_title() . '</a> ' . $status . '</strong>' : '<strong>' . $event->get_title() . ' ' . $status . '</strong>';
if (current_user_can($post_type_object->cap->edit_post, $event->get_id()) && 'trash' != $post->post_status) {
$actions['edit'] = '<a title="' . esc_attr(__('Edit Event', self::TEXT_DOMAIN)) . '" href="' . $edit_link . '">' . __('Edit') . '</a>';
if (!$event->is_recurring()) {
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this Event inline', self::TEXT_DOMAIN)) . '">' . __('Quick Edit') . '</a>';
}
}
if (current_user_can($post_type_object->cap->delete_post, $event->get_id())) {
if ('trash' == $post->post_status) {
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this Event from the Trash', self::TEXT_DOMAIN)) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $event->get_id())), 'untrash-' . $post->post_type . '_' . $event->get_id()) . "'>" . __('Restore') . "</a>";
} else {
if (EMPTY_TRASH_DAYS) {
$actions['trash'] = '<a class="submitdelete" title="' . esc_attr(__('Move this Event to the Trash', self::TEXT_DOMAIN)) . '" href="' . get_delete_post_link($event->get_id()) . '">' . __('Trash') . '</a>';
}
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this Event permanently', self::TEXT_DOMAIN)) . "' href='" . get_delete_post_link($event->get_id(), '', true) . "'>" . __('Delete Permanently') . "</a>";
}
}
if ('trash' != $post->post_status) {
$event_id = $event->get_id();
if ($event->is_recurring()) {
$children = Eab_CollectionFactory::get_all_recurring_children_events($event);
if (!$children || !$children[0] instanceof Eab_EventModel) {
$event_id = false;
} else {
$event_id = $children[0]->get_id();
}
}
if ($event_id) {
$actions['view'] = '<a href="' . get_permalink($event_id) . '" title="' . esc_attr(sprintf(__('View “%s”'), $event->get_title())) . '" rel="permalink">' . __('View') . '</a>';
}
}
echo $title;
if (!empty($actions)) {
foreach ($actions as $action => $link) {
$actions[$action] = "<span class='{$action}'>{$link}</span>";
}
}
echo '<div class="row-actions">' . join(' | ', $actions) . '</div>';
get_inline_data($post);
break;
}
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:91,代码来源:events-and-bookings.php
示例7: get_permalink
echo "<span><a target='_blank' href='" . get_permalink($inbox_item->post_id) . "&preview=true'>" . __("View", "oasisworkflow") . "</a></span> | ";
if (current_user_can('ow_sign_off_step') && $is_post_editable || $user->ID == $current_user_id) {
echo "<span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href='#' wfid='{$inbox_item->ID}' postid='{$inbox_item->post_id}' class='quick_sign_off'>" . $sign_off_label . "</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class='loading'>{$space}</span>\n\t\t\t\t\t\t\t\t\t\t\t</span> | ";
}
if (current_user_can('ow_reassign_task')) {
echo "<span>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href='#' wfid='{$inbox_item->ID}' class='reassign'>" . __("Reassign", "oasisworkflow") . "</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class='loading'>{$space}</span>\n\t\t\t\t\t\t\t\t\t\t\t</span> | ";
}
if (current_user_can('ow_abort_workflow')) {
echo "<span>\n\t\t\t\t\t\t\t\t\t\t<a href='#' wfid='{$inbox_item->ID}' postid='{$inbox_item->post_id}' class='abort_workflow'>" . $abort_workflow_label . "</a>\n\t\t\t\t\t\t\t\t\t\t<span class='loading'>{$space}</span>\n\t\t\t\t\t\t\t\t\t\t</span> | ";
}
if (current_user_can('ow_view_workflow_history')) {
$nonce_url = wp_nonce_url("admin.php?page=oasiswf-history&post={$inbox_item->post_id}", 'owf_view_history_nonce');
echo "<span><a href='{$nonce_url}'> " . __("View History", "oasisworkflow") . "</a></span>";
}
echo "</div>";
get_inline_data($post);
}
echo "</td>";
echo "<td>{$post->post_type}</td>";
echo "<td>" . OW_Utility::instance()->get_user_name($user->ID) . "</td>";
$workflow_name = $workflow->name;
if (!empty($workflow->version)) {
$workflow_name .= " (" . $workflow->version . ")";
}
echo "<td>{$workflow_name} [{$ow_workflow_service->get_gpid_dbid($workflow->ID, $stepId, 'lbl')}]</td>";
$arg = add_query_arg(array('category' => $cat_name, 'nonce' => wp_create_nonce('category_filter')));
echo "<td><a href={$arg}>{$cat_name}</a></td>";
$post_status = $ow_custom_statuses->get_single_term_by('slug', get_post_status($post->ID));
$post_status = is_object($post_status) && isset($post_status->name) ? $post_status->name : $wf_process_status[$ow_workflow_service->get_gpid_dbid($workflow->ID, $stepId, 'process')];
// if the due date is passed the current date show the field in a different color
echo "<td><span class=' . {$past_due_date_field_class} . '>" . OW_Utility::instance()->format_date_for_display($inbox_item->due_date) . "</span></td>";
开发者ID:andyUA,项目名称:kabmin-new,代码行数:31,代码来源:workflow-inbox.php
示例8: single_row
//.........这里部分代码省略.........
?>
</strong>
<?php
if ('excerpt' == $mode) {
the_excerpt();
}
}
$actions = array();
if ($can_edit_post && 'trash' != $post->post_status) {
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item')) . '">' . __('Edit') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline')) . '">' . __('Quick Edit') . '</a>';
}
if (current_user_can($post_type_object->cap->delete_post, $post->ID)) {
if ('trash' == $post->post_status) {
$actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-' . $post->post_type . '_' . $post->ID) . "'>" . __('Restore') . "</a>";
} elseif (EMPTY_TRASH_DAYS) {
$actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash')) . "' href='" . get_delete_post_link($post->ID) . "'>" . __('Trash') . "</a>";
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
}
}
if ($post_type_object->public) {
if (in_array($post->post_status, array('pending', 'draft', 'future'))) {
if ($can_edit_post) {
$actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
}
} elseif ('trash' != $post->post_status) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
}
}
$actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post);
echo $this->row_actions($actions);
get_inline_data($post);
echo '</td>';
break;
case 'date':
if ('0000-00-00 00:00:00' == $post->post_date && 'date' == $column_name) {
$t_time = $h_time = __('Unpublished');
$time_diff = 0;
} else {
$t_time = get_the_time(__('Y/m/d g:i:s A'));
$m_time = $post->post_date;
$time = get_post_time('G', true, $post);
$time_diff = time() - $time;
if ($time_diff > 0 && $time_diff < 24 * 60 * 60) {
$h_time = sprintf(__('%s ago'), human_time_diff($time));
} else {
$h_time = mysql2date(__('Y/m/d'), $m_time);
}
}
echo '<td ' . $attributes . '>';
if ('excerpt' == $mode) {
echo apply_filters('post_date_column_time', $t_time, $post, $column_name, $mode);
} else {
echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, $column_name, $mode) . '</abbr>';
}
echo '<br />';
if ('publish' == $post->post_status) {
_e('Published');
} elseif ('future' == $post->post_status) {
if ($time_diff > 0) {
echo '<strong class="attention">' . __('Missed schedule') . '</strong>';
} else {
_e('Scheduled');
}
开发者ID:vivekkodira1,项目名称:wordpress,代码行数:67,代码来源:class-wp-posts-list-table.php
示例9: wp_pro_ad_banners_show_columns
public function wp_pro_ad_banners_show_columns($name)
{
global $post, $pro_ads_banners, $pro_ads_adzones, $pro_ads_campaigns;
switch ($name) {
case 'b_banner':
$banner_type = get_post_meta($post->ID, '_banner_type', true);
$banner_url = get_post_meta($post->ID, '_banner_url', true);
$banner_is_image = $pro_ads_banners->check_if_banner_is_image($banner_type);
$html = '';
if ($banner_is_image) {
$img = !empty($banner_url) ? $banner_url : WP_ADS_URL . 'images/placeholder.png';
$html .= '<div class="preview_banner" style="background: url(' . $img . ') no-repeat center center; width:40px; height:40px; background-size: cover;"></div>';
} elseif ($banner_type == 'swf') {
$html .= "<object>";
$html .= "<embed allowscriptaccess='always' id='banner-swf' width='40' height='40' src='" . $banner_url . "'>";
$html .= "</object>";
} else {
$html .= '<img src="' . WP_ADS_URL . 'images/placeholder.png" width="40" />';
}
echo $html;
break;
case 'b_name':
$edit_link = get_edit_post_link($post->ID);
$title = _draft_or_post_title();
$post_type_object = get_post_type_object($post->post_type);
$can_edit_post = current_user_can($post_type_object->cap->edit_post, $post->ID);
echo '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . $title . '</a>';
_post_states($post);
echo '</strong>';
if ($post->post_parent > 0) {
echo ' ← <a href="' . get_edit_post_link($post->post_parent) . '">' . get_the_title($post->post_parent) . '</a>';
}
// Excerpt view
if (isset($_GET['mode']) && 'excerpt' == $_GET['mode']) {
echo apply_filters('the_excerpt', $post->post_excerpt);
}
// Get actions
$actions = array();
$actions['id'] = 'ID: ' . $post->ID;
if ($can_edit_post && 'trash' != $post->post_status) {
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '" title="' . esc_attr(__('Edit this item', 'wpproads')) . '">' . __('Edit', 'wpproads') . '</a>';
$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', 'wpproads')) . '">' . __('Quick Edit', 'wpproads') . '</a>';
}
if (current_user_can($post_type_object->cap->delete_post, $post->ID)) {
if ('trash' == $post->post_status) {
$actions['untrash'] = '<a title="' . esc_attr(__('Restore this item from the Trash', 'wpproads')) . '" href="' . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . '">' . __('Restore', 'wpproads') . '</a>';
} elseif (EMPTY_TRASH_DAYS) {
$actions['trash'] = '<a class="submitdelete" title="' . esc_attr(__('Move this item to the Trash', 'wpproads')) . '" href="' . get_delete_post_link($post->ID) . '">' . __('Trash', 'wpproads') . '</a>';
}
if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
$actions['delete'] = '<a class="submitdelete" title="' . esc_attr(__('Delete this item permanently', 'wpproads')) . '" href="' . get_delete_post_link($post->ID, '', true) . '">' . __('Delete Permanently', 'wpproads') . '</a>';
}
}
if ($post_type_object->public) {
if (in_array($post->post_status, array('pending', 'draft', 'future'))) {
if ($can_edit_post) {
$actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”', 'wpproads'), $title)) . '" rel="permalink">' . __('Preview', 'wpproads') . '</a>';
}
} elseif ('trash' != $post->post_status) {
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”', 'wpproads'), $title)) . '" rel="permalink">' . __('View', 'wpproads') . '</a>';
}
}
$actions = apply_filters('post_row_actions', $actions, $post);
echo '<div class="row-actions">';
$i = 0;
$action_count = sizeof($actions);
foreach ($actions as $action => $link) {
++$i;
$i == $action_count ? $sep = '' : ($sep = ' | ');
echo '<span class="' . $action . '">' . $link . $sep . '</span>';
}
echo '</div>';
get_inline_data($post);
break;
case 'b_advertiser':
$advertiser_id = get_post_meta($post->ID, '_banner_advertiser_id', true);
echo !empty($advertiser_id) ? '<a href="post.php?post=' . $advertiser_id . '&action=edit">' . get_the_title($advertiser_id) . '</a>' : '<span class="na">–</span>';
break;
case 'b_campaign':
$campaign_id = get_post_meta($post->ID, '_banner_campaign_id', true);
$campaign_status = get_post_meta($campaign_id, '_campaign_status', true);
$campaign_status = $pro_ads_campaigns->get_status($campaign_status);
echo !empty($campaign_id) ? '<a href="post.php?post=' . $campaign_id . '&action=edit">' . get_the_title($campaign_id) . '</a><br><small style="color:#999;">' . __('Campaign status:', 'wpproads') . '</small> <small class="' . $campaign_status['name_clean'] . '"><em>[' . $campaign_status['name'] . ']</em></small>' : '<span class="na">–</span>';
break;
case 'b_status':
$banner_status = get_post_meta($post->ID, '_banner_status', true);
$status = $pro_ads_banners->get_status($banner_status);
echo '<span class="' . $status['name_clean'] . '">' . $status['name'] . '</span>';
break;
case 'b_stats':
echo '<a class="stats" href="admin.php?page=wp-pro-ads-stats&
|
请发表评论