esc_textarea example

<?php printf(
    /* translators: %s: Number of links. */
    __( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ),
    '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />'
);
?> </label></p> <p><label for="moderation_keys"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser&#8217;s user agent string, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP address per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.' ); ?></label></p> <p> <textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea> </p> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Disallowed Comment Keys' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php     /* translators: Hidden accessibility text. */
    _e( 'Disallowed Comment Keys' );
    ?> </span></legend> <p><label for="disallowed_keys">

    public function form( $instance ) {
        $instance = wp_parse_args( (array) $instance$this->default_instance );
        ?> <p> <label for="<?php echo $this->get_field_id( 'content' ); ?>"> <?php                 /* translators: HTML code of the block, not an option that blocks HTML. */
                _e( 'Block HTML:' );
                ?> </label> <textarea id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" rows="6" cols="50" class="widefat code"><?php echo esc_textarea( $instance['content'] ); ?></textarea> </p> <?php     }

    /** * Makes sure no block widget is considered to be wide. * * @since 5.8.0 * * @param bool $is_wide Whether the widget is considered wide. * @param string $widget_id Widget ID. * @return bool Updated `is_wide` value. */
 else {
                    $option->option_value = 'SERIALIZED DATA';
                    $disabled             = true;
                    $class                = 'all-options disabled';
                }
            }

            if ( str_contains( $option->option_value, "\n" ) ) {
                ?> <tr class="form-field"> <th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th> <td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td> </tr> <?php             } else {
                ?> <tr class="form-field"> <th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th> <?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ), true ) ) { ?> <td><code><?php echo esc_html( $option->option_value ); ?></code></td> <?php } else { ?> <td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td> <?php } ?>
<p><label for="ping_sites"> <?php         printf(
            /* translators: %s: Documentation URL. */
            __( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see the <a href="%s">Update Services</a> documentation article. Separate multiple service URLs with line breaks.' ),
            __( 'https://wordpress.org/documentation/article/update-services/' )
        );
        ?> </label></p> <textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea> <?php else : ?> <p> <?php         printf(
            /* translators: 1: Documentation URL, 2: URL to Reading Settings screen. */
            __( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site&#8217;s <a href="%2$s">visibility settings</a>.' ),
            __( 'https://wordpress.org/documentation/article/update-services/' ),
            'options-reading.php'
        );
        
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
                );
                ?> </p> <form action="options-permalink.php" method="post"> <?php wp_nonce_field( 'update-permalink' ); ?> <p> <label for="rules"><?php _e( 'Rewrite rules:' ); ?></label><br /> <textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly" aria-describedby="iis-description-a" ><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea> </p> </form> <p> <?php                 printf(
                    /* translators: %s: web.config */
                    __( 'If you temporarily make your %s file writable to generate rewrite rules automatically, do not forget to revert the permissions after the rule has been saved.' ),
                    '<code>web.config</code>'
                );
                ?> </p>

function get_inline_data( $post ) {
    $post_type_object = get_post_type_object( $post->post_type );
    if ( ! current_user_can( 'edit_post', $post->ID ) ) {
        return;
    }

    $title = esc_textarea( trim( $post->post_title ) );

    echo ' <div class="hidden" id="inline_' . $post->ID . '"> <div class="post_title">' . $title . '</div>' .
    /** This filter is documented in wp-admin/edit-tag-form.php */
    '<div class="post_name">' . apply_filters( 'editable_slug', $post->post_name, $post ) . '</div> <div class="post_author">' . $post->post_author . '</div> <div class="comment_status">' . esc_html( $post->comment_status ) . '</div> <div class="ping_status">' . esc_html( $post->ping_status ) . '</div> <div class="_status">' . esc_html( $post->post_status ) . '</div> <div class="jj">' . mysql2date( 'd', $post->post_date, false ) . '</div> <div class="mm">'
$limited_email_domains = '';
                    } else {
                        // Convert from an input field. Back-compat for WPMU < 1.0.                         $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains );

                        if ( is_array( $limited_email_domains ) ) {
                            $limited_email_domains = implode( "\n", $limited_email_domains );
                        }
                    }
                    ?> <textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5"> <?php echo esc_textarea( $limited_email_domains ); ?></textarea> <p class="description" id="limited-email-domains-desc"> <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ); ?> </p> </td> </tr> <tr> <th scope="row"><label for="banned_email_domains"><?php _e( 'Banned Email Domains' ); ?></label></th> <td> <?php                     $banned_email_domains = get_site_option( 'banned_email_domains' );

                    
$docs_select  = '<select name="docs-list" id="docs-list">';
            $docs_select .= '<option value="">' . esc_html__( 'Function Name&hellip;' ) . '</option>';

            foreach ( $functions as $function ) {
                $docs_select .= '<option value="' . esc_attr( $function ) . '">' . esc_html( $function ) . '()</option>';
            }

            $docs_select .= '</select>';
        }
    }

    $content = esc_textarea( $content );
}

$file_description = get_file_description( $relative_file );
$file_show        = array_search( $filearray_filter( $allowed_files ), true );
$description      = esc_html( $file_description );
if ( $file_description !== $file_show ) {
    $description .= ' <span>(' . esc_html( $file_show ) . ')</span>';
}
?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1>

function format_to_edit( $content$rich_text = false ) {
    /** * Filters the text to be formatted for editing. * * @since 1.2.0 * * @param string $content The text, prior to formatting for editing. */
    $content = apply_filters( 'format_to_edit', $content );
    if ( ! $rich_text ) {
        $content = esc_textarea( $content );
    }
    return $content;
}

/** * Add leading zeros when necessary. * * If you set the threshold to '4' and the number is '10', then you will get * back '0010'. If you set the threshold to '4' and the number is '5000', then you * will get back '5000'. * * Uses sprintf to append the amount of zeros based on the $threshold parameter * and the size of the number. If the number is large enough, then no zeros will * be appended. * * @since 0.71 * * @param int $number Number to append zeros to if not greater than threshold. * @param int $threshold Digit places number needs to be to not have zeros added. * @return string Adds leading zeros to number if needed. */
<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /> </p> <div class="notice inline notice-info notice-alt"> <?php if ( ! isset( $instance['visual'] ) ) : ?> <p><?php _e( 'This widget may contain code that may work better in the &#8220;Custom HTML&#8221; widget. How about trying that widget instead?' ); ?></p> <?php else : ?> <p><?php _e( 'This widget may have contained code that may work better in the &#8220;Custom HTML&#8221; widget. If you have not yet, how about trying that widget instead?' ); ?></p> <?php endif; ?> </div> <p> <label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Content:' ); ?></label> <textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>"><?php echo esc_textarea( $instance['text'] ); ?></textarea> </p> <p> <input id="<?php echo $this->get_field_id( 'filter' ); ?>" name="<?php echo $this->get_field_name( 'filter' ); ?>" type="checkbox"<?php checked( ! empty( $instance['filter'] ) ); ?> />&nbsp;<label for="<?php echo $this->get_field_id( 'filter' ); ?>"><?php _e( 'Automatically add paragraphs' ); ?></label> </p> <?php         endif;
    }

    /** * Renders form template scripts. * * @since 4.8.0 * @since 4.9.0 The method is now static. */
 else {
                printf(
                    /* translators: %s: wp-config.php */
                    __( 'These unique authentication keys are also missing from your %s file.' ),
                    '<code>wp-config.php</code>'
                );
            }
            ?> <?php _e( 'To make your installation more secure, you should also add:' ); ?> </p> <p class="configuration-rules-label"><label for="network-wpconfig-authentication"><?php _e( 'Network configuration authentication keys' ); ?></label></p> <textarea id="network-wpconfig-authentication" class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>" aria-describedby="network-wpconfig-authentication-description"><?php echo esc_textarea( $keys_salts_str ); ?></textarea> <?php         }
        ?> </li> <?php     if ( iis7_supports_permalinks() ) :
        // IIS doesn't support RewriteBase, all your RewriteBase are belong to us.         $iis_subdir_match       = ltrim( $base, '/' ) . $subdir_match;
        $iis_rewrite_base       = ltrim( $base, '/' ) . $rewrite_base;
        $iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';

        
$value               = $option->option_value;
        $options_to_update[] = $option->option_name;
        $class               = 'all-options';
    }

    $name = esc_attr( $option->option_name );
    ?> <tr> <th scope="row"><label for="<?php echo $name; ?>"><?php echo esc_html( $option->option_name ); ?></label></th> <td> <?php if ( str_contains( $value, "\n" ) ) : ?> <textarea class="<?php echo $class; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" cols="30" rows="5"><?php echo esc_textarea( $value ); ?></textarea> <?php else : ?> <input class="regular-text <?php echo $class; ?>" type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $value ); ?>"<?php disabled( $disabled, true ); ?> /> <?php endif; ?></td> </tr> <?php endforeach; ?> </table> <input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" /> <?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?> </form> </div>
<?php echo $share_tab_html_id; ?>" aria-selected="false" tabindex="-1"><?php esc_html_e( 'HTML Embed' ); ?></button> </li> </ul> <div id="<?php echo $share_tab_wordpress_id; ?>" class="wp-embed-share-tab" role="tabpanel" aria-hidden="false"> <input type="text" value="<?php the_permalink(); ?>" class="wp-embed-share-input" aria-label="<?php esc_attr_e( 'URL' ); ?>" aria-describedby="<?php echo $description_wordpress_id; ?>" tabindex="0" readonly/> <p class="wp-embed-share-description" id="<?php echo $description_wordpress_id; ?>"> <?php _e( 'Copy and paste this URL into your WordPress site to embed' ); ?> </p> </div> <div id="<?php echo $share_tab_html_id; ?>" class="wp-embed-share-tab" role="tabpanel" aria-hidden="true"> <textarea class="wp-embed-share-input" aria-label="<?php esc_attr_e( 'HTML' ); ?>" aria-describedby="<?php echo $description_html_id; ?>" tabindex="0" readonly><?php echo esc_textarea( get_post_embed_html( 600, 400 ) ); ?></textarea> <p class="wp-embed-share-description" id="<?php echo $description_html_id; ?>"> <?php _e( 'Copy and paste this code into your site to embed' ); ?> </p> </div> </div> <button type="button" class="wp-embed-share-dialog-close" aria-label="<?php esc_attr_e( 'Close sharing dialog' ); ?>"> <span class="dashicons dashicons-no"></span> </button> </div> </div>

    public function form( $instance ) {
        $instance = wp_parse_args( (array) $instance$this->default_instance );
        ?> <input id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" class="title sync-input" type="hidden" value="<?php echo esc_attr( $instance['title'] ); ?>" /> <textarea id="<?php echo $this->get_field_id( 'content' ); ?>" name="<?php echo $this->get_field_name( 'content' ); ?>" class="content sync-input" hidden><?php echo esc_textarea( $instance['content'] ); ?></textarea> <?php     }

    /** * Render form template scripts. * * @since 4.9.0 */
    public static function render_control_template_scripts() {
        ?> <script type="text/html" id="tmpl-widget-custom-html-control-fields"> <# var elementIdPrefix = 'el' + String( Math.random() ).replace( /\D/g, '' ) + '_' #> <p> <label for="{{ elementIdPrefix }}title">
<label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> <?php endif; ?> <?php if ( ! empty( $this->description ) ) : ?> <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> <?php endif; ?> <textarea id="<?php echo esc_attr( $input_id ); ?>" rows="5" <?php echo $describedby_attr; ?> <?php $this->input_attrs(); ?> <?php $this->link(); ?> ><?php echo esc_textarea( $this->value() ); ?></textarea> <?php                 break;
            case 'dropdown-pages':
                ?> <?php if ( ! empty( $this->label ) ) : ?> <label for="<?php echo esc_attr( $input_id ); ?>" class="customize-control-title"><?php echo esc_html( $this->label ); ?></label> <?php endif; ?> <?php if ( ! empty( $this->description ) ) : ?> <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span> <?php endif; ?>
Home | Imprint | This part of the site doesn't use cookies.