本文整理汇总了PHP中wp_list_post_revisions函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_list_post_revisions函数的具体用法?PHP wp_list_post_revisions怎么用?PHP wp_list_post_revisions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_list_post_revisions函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: post_revisions_meta_box
/**
* Display list of revisions.
*
* @since 2.6.0
*
* @param object $post
*/
function post_revisions_meta_box($post)
{
wp_list_post_revisions($post);
}
示例2: ame_custom_column_page_actions
/**
* Adds content to the new 'Actions' column on the page management view
*
* @since 0.7
* @author scripts@schloebe.de
*
* @param string $ame_column_name
* @param int $ame_id
*/
function ame_custom_column_page_actions($ame_column_name, $ame_id)
{
global $wpdb, $locale;
if ($ame_column_name == 'ame_page_actions') {
$post_status = get_post_status($ame_id);
$q_post = get_post($ame_id);
echo '<div style="width:105px;" class="ame_options">';
// Visibility icon
$visstatus = $post_status == 'publish' ? 'draft' : 'publish';
echo '<div id="visicon' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" onclick="ame_ajax_set_visibility(' . $ame_id . ', \'' . $visstatus . '\', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . $visstatus . '.png" border="0" alt="' . __('Toggle visibility', 'admin-management-xtended') . '" title="' . __('Toggle visibility', 'admin-management-xtended') . '" /></a></div>';
// Date icon
echo '<div id="date' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" class="date-pick" id="datepicker' . $ame_id . '"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'date.png" border="0" alt="' . __('Change Publication Date', 'admin-management-xtended') . '" title="' . __('Change Publication Date', 'admin-management-xtended') . '" /></a></div> ';
// Slug edit icon
echo '<div id="slug' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" id="slugedit' . $ame_id . '" onclick="ame_slug_edit(' . $ame_id . ', \'post\');"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'slug_edit.png" border="0" alt="' . __('Edit Page Slug', 'admin-management-xtended') . '" title="' . __('Edit Page Slug', 'admin-management-xtended') . '" /></a></div>';
// Comment open/closed status icon
$comment_status = $q_post->comment_status;
if ($comment_status == 'open') {
$c_status = 0;
$c_img = '_open';
} else {
$c_status = 1;
$c_img = '_closed';
}
echo '<div id="commentstatus' . $ame_id . '" style="padding:1px;float:left;"><a tip="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" href="javascript:void(0);" onclick="ame_ajax_set_commentstatus(' . $ame_id . ', ' . $c_status . ', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'comments' . $c_img . '.png" border="0" alt="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" title="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" /></a></div> ';
// Plugin: Exclude Pages
if (is_plugin_active('exclude-pages/exclude_pages.php')) {
$excluded_pages = ep_get_excluded_ids();
if (in_array($ame_id, $excluded_pages)) {
$e_status = 0;
$e_img = '';
} else {
$e_status = 1;
$e_img = '_off';
}
echo '<div id="excludepagewrap' . $ame_id . '" style="padding:1px;float:left;"><a tip="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" href="javascript:void(0);" onclick="ame_ajax_set_excludestatus(' . $ame_id . ', ' . $e_status . ');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'excludepages' . $e_img . '.gif" border="0" alt="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" title="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" /></a></div>';
}
// Post revisions
if (function_exists('wp_list_post_revisions') && wp_get_post_revisions($ame_id)) {
echo '<div class="amehasrev" id="amerevisionwrap' . $ame_id . '" style="width:300px;height:165px;overflow:auto;display:none;">';
wp_list_post_revisions($ame_id);
echo '</div>';
}
echo '</div>';
}
}
示例3: _e
<tr><td colspan="2"><div class="updated"><p><?php
_e('These revisions are identical.');
?>
</p></div></td></tr>
<?php
}
?>
</table>
<br class="clear" />
<h3><?php
echo $title;
?>
</h3>
<?php
$args = array('format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left);
if (!WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions')) {
$args['type'] = 'autosave';
}
wp_list_post_revisions($post, $args);
?>
</div>
<?php
require_once './admin-footer.php';
示例4: post_revisions_meta_box
function post_revisions_meta_box($safecss_post)
{
// Specify numberposts and ordering args
$args = array('numberposts' => 5, 'orderby' => 'ID', 'order' => 'DESC');
// Remove numberposts from args if show_all_rev is specified
if (isset($_GET['show_all_rev'])) {
unset($args['numberposts']);
}
wp_list_post_revisions($safecss_post['ID'], $args);
}
示例5: ame_custom_column_post_actions
/**
* Adds content to the new 'Actions' column on the post management view
*
* @since 0.7
* @author scripts@schloebe.de
*
* @param string
* @param int
*/
function ame_custom_column_post_actions($ame_column_name, $ame_id)
{
global $wpdb, $locale;
if ($ame_column_name == 'ame_post_actions' && current_user_can('edit_post', $ame_id)) {
$post_status = get_post_status($ame_id);
$q_post = get_post($ame_id);
echo '<div style="width:90px;" class="ame_options">';
// Visibility icon
$visstatus = $post_status == 'publish' ? 'draft' : 'publish';
echo '<div id="visicon' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" onclick="ame_ajax_set_visibility(' . $ame_id . ', \'' . $visstatus . '\', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . $visstatus . '.png" border="0" alt="' . __('Toggle visibility', 'admin-management-xtended') . '" title="' . __('Toggle visibility', 'admin-management-xtended') . '" /></a></div>';
// Sticky icon
$stickyimg = is_sticky($ame_id) ? 'sticky.png' : 'nosticky.png';
echo '<div id="stickyicon' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" onclick="ame_ajax_set_sticky(' . $ame_id . ');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . $stickyimg . '" border="0" alt="' . __('Stick this post to the front page') . '" title="' . __('Stick this post to the front page') . '" /></a></div>';
// Date icon
echo '<div id="date' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" class="date-pick" id="datepicker' . $ame_id . '"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'date.png" border="0" alt="' . __('Change Publication Date', 'admin-management-xtended') . '" title="' . __('Change Publication Date', 'admin-management-xtended') . '" /></a></div>';
// Slug edit icon
echo '<div id="slug' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" id="slugedit' . $ame_id . '" onclick="ame_slug_edit(' . $ame_id . ', \'post\');"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'slug_edit.png" border="0" alt="' . __('Edit Post Slug', 'admin-management-xtended') . '" title="' . __('Edit Post Slug', 'admin-management-xtended') . '" /></a></div>';
// Comment open/closed status icon
$comment_status = $q_post->comment_status;
if ($comment_status == 'open') {
$c_status = 0;
$c_img = '_open';
} else {
$c_status = 1;
$c_img = '_closed';
}
echo '<div id="commentstatus' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" onclick="ame_ajax_set_commentstatus(' . $ame_id . ', ' . $c_status . ', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'comments' . $c_img . '.png" border="0" alt="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" title="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" /></a></div> ';
// Post revisions
if (function_exists('wp_list_post_revisions') && wp_get_post_revisions($ame_id)) {
echo '<div class="amehasrev" id="amerevisionwrap' . $ame_id . '" style="width:300px;height:165px;overflow:auto;display:none;">';
wp_list_post_revisions($ame_id);
echo '</div>';
}
echo '</div>';
}
}
示例6: revisions_meta_box
function revisions_meta_box()
{
$post = $this->get_js_post();
$args = array('numberposts' => 5, 'orderby' => 'ID', 'order' => 'DESC');
if (isset($_GET['show_all_rev'])) {
unset($args['numberposts']);
}
wp_list_post_revisions($post['ID'], $args);
}
示例7: revisions_meta_box
/**
* post_revisions_meta_box function.
*
* @access public
* @param mixed $safecss_post
* @return void
*/
public static function revisions_meta_box($post)
{
wp_list_post_revisions($post->ID);
}
示例8: revisions_meta_box
/**
* post_revisions_meta_box function.
*
* @access public
* @param mixed $safecss_post
* @return void
*/
function revisions_meta_box($post)
{
// Specify numberposts and ordering args
$args = array('format' => 'list', 'type' => 'revision');
// Remove numberposts from args if show_all_rev is specified
if (isset($_GET['show_all_rev'])) {
unset($args['numberposts']);
}
wp_list_post_revisions($post->ID, $args);
}