wp_dashboard_primary example


function wp_ajax_dashboard_widgets() {
    require_once ABSPATH . 'wp-admin/includes/dashboard.php';

    $pagenow = $_GET['pagenow'];
    if ( 'dashboard-user' === $pagenow || 'dashboard-network' === $pagenow || 'dashboard' === $pagenow ) {
        set_current_screen( $pagenow );
    }

    switch ( $_GET['widget'] ) {
        case 'dashboard_primary':
            wp_dashboard_primary();
            break;
    }
    wp_die();
}

/** * Handles Customizer preview logged-in status via AJAX. * * @since 3.4.0 */
function wp_ajax_logged_in() {
    
/** * Renders the Events and News dashboard widget. * * @since 4.8.0 */
function wp_dashboard_events_news() {
    wp_print_community_events_markup();

    ?> <div class="wordpress-news hide-if-no-js"> <?php wp_dashboard_primary(); ?> </div> <p class="community-events-footer"> <?php             printf(
                '<a href="%1$s" target="_blank">%2$s <span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
                'https://make.wordpress.org/community/meetups-landing-page',
                __( 'Meetups' ),
                /* translators: Hidden accessibility text. */
                __( '(opens in a new tab)' )
            );
        
Home | Imprint | This part of the site doesn't use cookies.