esc_attr_x example


function twenty_twenty_one_password_form( $output$post = 0 ) {
    $post   = get_post( $post );
    $label  = 'pwbox-' . ( empty( $post->ID ) ? wp_rand() : $post->ID );
    $output = '<p class="post-password-message">' . esc_html__( 'This content is password protected. Please enter a password to view.', 'twentytwentyone' ) . '</p> <form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <label class="post-password-form__label" for="' . esc_attr( $label ) . '">' . esc_html_x( 'Password', 'Post password form', 'twentytwentyone' ) . '</label><input class="post-password-form__input" name="post_password" id="' . esc_attr( $label ) . '" type="password" spellcheck="false" size="20" /><input type="submit" class="post-password-form__submit" name="' . esc_attr_x( 'Submit', 'Post password form', 'twentytwentyone' ) . '" value="' . esc_attr_x( 'Enter', 'Post password form', 'twentytwentyone' ) . '" /></form> ';
    return $output;
}
add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2 );

/** * Filters the list of attachment image attributes. * * @since Twenty Twenty-One 1.0 * * @param string[] $attr Array of attribute values for the image markup, keyed by attribute name. * See wp_get_attachment_image(). * @param WP_Post $attachment Image attachment post. * @param string|int[] $size Requested image size. Can be any registered image size name, or * an array of width and height values in pixels (in that order). * @return string[] The filtered attributes for the image markup. */
</p> </div> </div> <div id="customize-theme-controls"> <ul class="customize-pane-parent"><?php // Panels and sections are managed here via JavaScript ?></ul> </div> </div> </div> <div id="customize-footer-actions" class="wp-full-overlay-footer"> <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php echo esc_attr_x( 'Hide Controls', 'label for hide controls button without length constraints' ); ?>"> <span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-label"><?php _ex( 'Hide Controls', 'short (~12 characters) label for hide controls button' ); ?></span> </button> <?php $previewable_devices = $wp_customize->get_previewable_devices(); ?> <?php if ( ! empty( $previewable_devices ) ) : ?> <div class="devices-wrapper"> <div class="devices"> <?php foreach ( (array) $previewable_devices as $device => $settings ) : ?> <?php                         if ( empty( $settings['label'] ) ) {
                            continue;
                        }
<?php echo esc_html_x( '404', 'Error code for a webpage that is not found.', 'twentytwentythree' ); ?></h1> <!-- /wp:heading --> <!-- wp:group {"align":"wide","layout":{"type":"default"},"style":{"spacing":{"margin":{"top":"5px"}}}} --> <div class="wp-block-group alignwide" style="margin-top:5px"> <!-- wp:paragraph --> <p><?php echo esc_html_x( 'This page could not be found.', 'Message to convey that a webpage could not be found', 'twentytwentythree' ); ?></p> <!-- /wp:paragraph --> <!-- wp:search {"label":"<?php echo esc_html_x( 'Search', 'label', 'twentytwentythree' ); ?>","placeholder":"<?php echo esc_attr_x( 'Search...', 'placeholder for search field', 'twentytwentythree' ); ?>","showLabel":false,"width":100,"widthUnit":"%","buttonText":"<?php esc_attr_e( 'Search', 'twentytwentythree' ); ?>","buttonUseIcon":true,"align":"center"} /--> </div> <!-- /wp:group --> <!-- wp:spacer {"height":"var(--wp--preset--spacing--70)"} --> <div style="height:var(--wp--preset--spacing--70)" aria-hidden="true" class="wp-block-spacer"></div> <!-- /wp:spacer -->

function get_the_password_form( $post = 0 ) {
    $post   = get_post( $post );
    $label  = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
    $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form" method="post"> <p>' . __( 'This content is password protected. To view it please enter your password below:' ) . '</p> <p><label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" spellcheck="false" size="20" /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form> ';

    /** * Filters the HTML output for the protected post password form. * * If modifying the password field, please note that the core database schema * limits the password field to 20 characters regardless of the value of the * size attribute in the form input. * * @since 2.7.0 * @since 5.8.0 Added the `$post` parameter. * * @param string $output The password form HTML output. * @param WP_Post $post Post object. */

return array(
    'title'      => __( 'Page layout with image and text', 'twentytwentytwo' ),
    'categories' => array( 'pages' ),
    'content'    => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","bottom":"2rem"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--spacing--large, 8rem);padding-bottom:2rem"><!-- wp:heading {"align":"wide","style":{"typography":{"fontSize":"clamp(4rem, 8vw, 7.5rem)","lineHeight":"1.15","fontWeight":"300"}}} --> <h2 class="alignwide" style="font-size:clamp(4rem, 8vw, 7.5rem);font-weight:300;line-height:1.15">' . wp_kses_post( __( '<em>Watching Birds </em><br><em>in the Garden</em>', 'twentytwentytwo' ) ) . '</h2> <!-- /wp:heading --></div> <!-- /wp:group --> <!-- wp:image {"align":"full","style":{"color":{}}} --> <figure class="wp-block-image alignfull"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/flight-path-on-transparent-b.png" alt="' . esc_attr_x( 'TBD', 'Short for to be determined', 'twentytwentytwo' ) . '"/></figure> <!-- /wp:image --> <!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"2rem","bottom":"var(--wp--custom--spacing--large, 8rem)"}}},"layout":{"inherit":true}} --> <div class="wp-block-group alignfull" style="padding-top:2rem;padding-bottom:var(--wp--custom--spacing--large, 8rem)"> <!-- wp:columns {"align":"wide"} --> <div class="wp-block-columns alignwide"><!-- wp:column {"verticalAlignment":"bottom","style":{"spacing":{"padding":{"bottom":"1em"}}}} --> <div class="wp-block-column is-vertically-aligned-bottom" style="padding-bottom:1em"><!-- wp:site-logo {"width":60} /--></div> <!-- /wp:column --> <!-- wp:column {"verticalAlignment":"bottom"} --> <div class="wp-block-column is-vertically-aligned-bottom"><!-- wp:paragraph --> <p>'

            $aria_label = '';
        }

        if ( 'html5' === $format ) {
            $form = '<form role="search" ' . $aria_label . 'method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '"> <label> <span class="screen-reader-text">' .
                    /* translators: Hidden accessibility text. */
                    _x( 'Search for:', 'label' ) .
                    '</span> <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" /> </label> <input type="submit" class="search-submit" value="' . esc_attr_x( 'Search', 'submit button' ) . '" /> </form>';
        } else {
            $form = '<form role="search" ' . $aria_label . 'method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> <div> <label class="screen-reader-text" for="s">' .
                    /* translators: Hidden accessibility text. */
                    _x( 'Search for:', 'label' ) .
                    '</label> <input type="text" value="' . get_search_query() . '" name="s" id="s" /> <input type="submit" id="searchsubmit" value="'
/* * Generate a unique ID for each form and a string containing an aria-label * if one was passed to get_search_form() in the args array. */
$twentytwentyone_unique_id = wp_unique_id( 'search-form-' );

$twentytwentyone_aria_label = ! empty( $args['aria_label'] ) ? 'aria-label="' . esc_attr( $args['aria_label'] ) . '"' : '';
?> <form role="search" <?php echo $twentytwentyone_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>"> <label for="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>"><?php _e( 'Search&hellip;', 'twentytwentyone' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></label> <input type="search" id="<?php echo esc_attr( $twentytwentyone_unique_id ); ?>" class="search-field" value="<?php echo get_search_query(); ?>" name="s" /> <input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwentyone' ); ?>" /> </form>

        }
    }

    $translations_available = ( ! empty( $translations ) && $parsed_args['show_available_translations'] );

    // Holds the HTML markup.     $structure = array();

    // List installed languages.     if ( $translations_available ) {
        $structure[] = '<optgroup label="' . esc_attr_x( 'Installed', 'translations' ) . '">';
    }

    // Site default.     if ( $parsed_args['show_option_site_default'] ) {
        $structure[] = sprintf(
            '<option value="site-default" data-installed="1"%s>%s</option>',
            selected( 'site-default', $parsed_args['selected'], false ),
            _x( 'Site Default', 'default site language' )
        );
    }

    

?> <!-- wp:paragraph --> <p> <?php echo esc_html_x( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'Message explaining that there are no results returned from a search', 'twentytwentythree' ); ?> </p> <!-- /wp:paragraph --> <!-- wp:search {"label":"<?php echo esc_html_x( 'Search', 'label', 'twentytwentythree' ); ?>","placeholder":"<?php echo esc_attr_x( 'Search...', 'placeholder for search field', 'twentytwentythree' ); ?>","showLabel":false,"buttonText":"<?php esc_attr_e( 'Search', 'twentytwentythree' ); ?>","buttonUseIcon":true} /-->
        }
        ?> </div> <div id="publishing-action"> <span class="spinner"></span> <?php         if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 === $post_id ) {
            if ( $can_publish ) :
                if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
                    ?> <input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" /> <?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?> <?php                 else :
                    ?> <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" /> <?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?> <?php                 endif;
            else :
                ?> <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />

function wp_print_revision_templates() {
    global $post;
    ?><script id="tmpl-revisions-frame" type="text/html"> <div class="revisions-control-frame"></div> <div class="revisions-diff-frame"></div> </script> <script id="tmpl-revisions-buttons" type="text/html"> <div class="revisions-previous"> <input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" /> </div> <div class="revisions-next"> <input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" /> </div> </script> <script id="tmpl-revisions-checkbox" type="text/html"> <div class="revision-toggle-compare-mode"> <label> <input type="checkbox" class="compare-two-revisions" <# if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) { #> checked="checked"<# } #> />
Home | Imprint | This part of the site doesn't use cookies.