wp_dashboard_quick_press example

        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' );

        // Wrap Quick Draft content in the Paragraph block.         if ( ! str_contains( $_POST['content'], '<!-- wp:paragraph -->' ) ) {
            $_POST['content'] = sprintf(
                


/** * Output the QuickPress dashboard widget. * * @since 3.0.0 * @deprecated 3.2.0 Use wp_dashboard_quick_press() * @see wp_dashboard_quick_press() */
function wp_dashboard_quick_press_output() {
    _deprecated_function( __FUNCTION__, '3.2.0', 'wp_dashboard_quick_press()' );
    wp_dashboard_quick_press();
}

/** * Outputs the TinyMCE editor. * * @since 2.7.0 * @deprecated 3.3.0 Use wp_editor() * @see wp_editor() */
function wp_tiny_mce( $teeny = false, $settings = false ) {
    _deprecated_function( __FUNCTION__, '3.3.0', 'wp_editor()' );

    
Home | Imprint | This part of the site doesn't use cookies.