本文整理汇总了PHP中wp_dashboard_quick_press函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_dashboard_quick_press函数的具体用法?PHP wp_dashboard_quick_press怎么用?PHP wp_dashboard_quick_press使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_dashboard_quick_press函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_dashboard_quick_press_output
/**
* Output the QuickPress dashboard widget.
*
* @since 3.0.0
* @deprecated 3.2.0
* @deprecated Use wp_dashboard_quick_press()
* @see wp_dashboard_quick_press()
*/
function wp_dashboard_quick_press_output()
{
_deprecated_function(__FUNCTION__, '3.2', 'wp_dashboard_quick_press()');
wp_dashboard_quick_press();
}
示例2: __
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
if (!wp_verify_nonce($nonce, 'add-post')) {
$error_msg = __('Unable to submit this form, please refresh and try again.');
}
if (!current_user_can(get_post_type_object('post')->cap->create_posts)) {
exit;
}
if ($error_msg) {
return wp_dashboard_quick_press($error_msg);
}
$post = get_post($_REQUEST['post_ID']);
check_admin_referer('add-' . $post->post_type);
$_POST['comment_status'] = get_default_comment_status($post->post_type);
$_POST['ping_status'] = get_default_comment_status($post->post_type, 'pingback');
edit_post();
wp_dashboard_quick_press();
exit;
case 'postajaxpost':
case 'post':
check_admin_referer('add-' . $post_type);
$post_id = 'postajaxpost' == $action ? edit_post() : write_post();
redirect_post($post_id);
exit;
case 'edit':
$editing = true;
if (empty($post_id)) {
wp_redirect(admin_url('post.php'));
exit;
}
if (!$post) {
wp_die(__('You attempted to edit an item that doesn’t exist. Perhaps it was deleted?'));