wp_required_field_message example

$item .= '<p><strong>' . __( 'Dimensions:' ) . "</strong> $media_dims</p>\n";
    }

    $item .= "</td></tr>\n";

    $item .= " </thead> <tbody> <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>\n <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n <tr><td colspan='2'><p class='media-types media-types-required-info'>" .
            wp_required_field_message() .
        "</p></td></tr>\n";

    $defaults = array(
        'input'      => 'text',
        'required'   => false,
        'value'      => '',
        'extra_rows' => array(),
    );

    if ( $parsed_args['send'] ) {
        $parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
    }
?> <div class="wrap"> <h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1> <?php if ( ! empty( $messages ) ) {
    foreach ( $messages as $msg ) {
        echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
    }
}
?> <p><?php echo wp_required_field_message(); ?></p> <form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate"> <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"> <label for="site-address"> <?php                     _e( 'Site Address (URL)' );
                    echo ' ' . wp_required_field_indicator();
                    ?> </label> </th> <td>
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
    ?> <div id="message" class="notice notice-error is-dismissible"> <?php         foreach ( $add_user_errors->get_error_messages() as $error ) {
            echo "<p>$error</p>";
        }
        ?> </div> <?php } ?> <form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate"> <p><?php echo wp_required_field_message(); ?></p> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="username"><?php _e( 'Username' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" required="required" /></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <?php echo wp_required_field_indicator(); ?></label></th> <td><input type="email" class="regular-text" name="user[email]" id="email" required="required" /></td> </tr> <tr class="form-field"> <td colspan="2" class="td-full"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td> </tr> </table>


    $req   = get_option( 'require_name_email' );
    $html5 = 'html5' === $args['format'];

    // Define attributes in HTML5 or XHTML syntax.     $required_attribute = ( $html5 ? ' required' : ' required="required"' );
    $checked_attribute  = ( $html5 ? ' checked' : ' checked="checked"' );

    // Identify required fields visually and create a message about the indicator.     $required_indicator = ' ' . wp_required_field_indicator();
    $required_text      = ' ' . wp_required_field_message();

    $fields = array(
        'author' => sprintf(
            '<p class="comment-form-author">%s %s</p>',
            sprintf(
                '<label for="author">%s%s</label>',
                __( 'Name' ),
                ( $req ? $required_indicator : '' )
            ),
            sprintf(
                '<input id="author" name="author" type="text" value="%s" size="30" maxlength="245" autocomplete="name"%s />',
                
Home | Imprint | This part of the site doesn't use cookies.