本文整理汇总了PHP中wp_dashboard_primary函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_dashboard_primary函数的具体用法?PHP wp_dashboard_primary怎么用?PHP wp_dashboard_primary使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_dashboard_primary函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wp_ajax_dashboard_widgets
function wp_ajax_dashboard_widgets()
{
require ABSPATH . 'wp-admin/includes/dashboard.php';
switch ($_GET['widget']) {
case 'dashboard_incoming_links':
wp_dashboard_incoming_links();
break;
case 'dashboard_primary':
wp_dashboard_primary();
break;
case 'dashboard_secondary':
wp_dashboard_secondary();
break;
case 'dashboard_plugins':
wp_dashboard_plugins();
break;
}
wp_die();
}
示例2: wp_ajax_dashboard_widgets
/**
* Ajax handler for dashboard widgets.
*
* @since 3.4.0
*/
function wp_ajax_dashboard_widgets()
{
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
$pagenow = $_GET['pagenow'];
if ($pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard') {
set_current_screen($pagenow);
}
switch ($_GET['widget']) {
case 'dashboard_primary':
wp_dashboard_primary();
break;
}
wp_die();
}
示例3: define
<?php
/**
* Handle default dashboard widgets options AJAX.
*
* @package WordPress
* @subpackage Administration
*/
define('DOING_AJAX', true);
/** Load WordPress Bootstrap */
require_once './admin.php';
/** Load WordPress Administration Dashboard API */
require ABSPATH . 'wp-admin/includes/dashboard.php';
@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
send_nosniff_header();
switch ($_GET['jax']) {
case 'dashboard_incoming_links':
wp_dashboard_incoming_links();
break;
case 'dashboard_primary':
wp_dashboard_primary();
break;
case 'dashboard_secondary':
wp_dashboard_secondary();
break;
case 'dashboard_plugins':
wp_dashboard_plugins();
break;
}