Php melarikan diri string untuk html

esc_attr( string   $text  ). string

Melarikan diri untuk atribut HTML

Isi


<!-- This is correct: -->
<img src="<?php echo esc_url( $src ); ?>" />

<!-- This is OK, but the esc_attr() is unnecessary: -->
<img src="<?php echo esc_attr( esc_url( $src ) ); ?>" />
 
<!-- This is *not* correct: -->
<img src="<?php echo esc_attr( $src ); ?>" />
7 string Diperlukan

rangkaian


Encodes the <, >, &, ” and ‘ (less than, greater than, ampersand, double quote and single quote) characters. Will never double encode entities.

Selalu gunakan saat keluar dari atribut HTML (terutama nilai formulir) seperti alt, nilai, judul, dll. Untuk menghindari nilai terjemahan, gunakan esc_attr__() sebagai gantinya;


Mengajukan.

<!-- This is correct: -->
<img src="<?php echo esc_url( $src ); ?>" />

<!-- This is OK, but the esc_attr() is unnecessary: -->
<img src="<?php echo esc_attr( esc_url( $src ) ); ?>" />
 
<!-- This is *not* correct: -->
<img src="<?php echo esc_attr( $src ); ?>" />
8. View all references

function esc_attr( $text ) {
	$safe_text = wp_check_invalid_utf8( $text );
	$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
	/**
	 * Filters a string cleaned and escaped for output in an HTML attribute.
	 *
	 * Text passed to esc_attr() is stripped of invalid or special characters
	 * before output.
	 *
	 * @since 2.0.6
	 *
	 * @param string $safe_text The text after it has been escaped.
	 * @param string $text      The text prior to being escaped.
	 */
	return apply_filters( 'attribute_escape', $safe_text, $text );
}


apply_filters ( 'attribute_escape', string $safe_text , string $text )

Filters a string cleaned and escaped for output in an HTML attribute


UsesUsesDescriptionwp_check_invalid_utf8() wp-includes/formatting. php

Checks for invalid UTF8 in a string

_wp_specialchars() wp-includes/formatting. php

Converts a number of special characters into their HTML entities

apply_filters() wp-includes/plugin. php

Calls the callback functions that have been added to a filter hook


Used ByUsed ByDescriptionwp_img_tag_add_decoding_attr() wp-includes/media. php

Adds

<!-- This is correct: -->
<img src="<?php echo esc_url( $src ); ?>" />

<!-- This is OK, but the esc_attr() is unnecessary: -->
<img src="<?php echo esc_attr( esc_url( $src ) ); ?>" />
 
<!-- This is *not* correct: -->
<img src="<?php echo esc_attr( $src ); ?>" />
9 attribute to an
<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
0 HTML tag

wp_preload_resources() wp-includes/general-template. php

Prints resource preloads directives to browsers

wp_list_users() wp-includes/user. php

Lists all the users of the site, with several options available

WP_Theme_JSON. remove_insecure_settings() wp-includes/class-wp-theme-json. php

Processes a setting node and returns the same node without the insecure settings

wp_robots() wp-includes/robots-template. php

Displays the robots meta tag as necessary

wp_sanitize_script_attributes() wp-includes/script-loader. php

Membersihkan larik atribut ke dalam string atribut untuk ditempatkan di dalam tag

wp_iframe_tag_add_loading_attr() wp-includes/media. php

Menambahkan atribut

<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
1 ke tag HTML
<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
2

get_block_wrapper_attributes() wp-includes/class-wp-block-supports. php

Menghasilkan serangkaian atribut dengan menerapkan ke blok saat ini yang merender semua fitur yang didukung blok

WP_Application_Passwords_List_Table. column_revoke() wp-admin/includes/class-wp-application-passwords-list-table. php

Menangani keluaran kolom pencabutan

WP_Application_Passwords_List_Table. display_tablenav() wp-admin/includes/class-wp-application-passwords-list-table. php

Menghasilkan navigasi tabel khusus untuk mencegah nonces yang bertentangan

WP_Application_Passwords_List_Table. single_row() wp-admin/includes/class-wp-application-passwords-list-table. php

Menghasilkan konten untuk satu baris tabel

WP_Application_Passwords_List_Table. print_js_template_row() wp-admin/includes/class-wp-application-passwords-list-table. php

Prints the JavaScript template for the new row item

WP_Comments_List_Table. comment_type_dropdown() wp-admin/includes/class-wp-comments-list-table. php

Displays a comment type drop-down for filtering on the Comments list table

wp_img_tag_add_loading_attr() wp-includes/media. php

Adds

<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
1 attribute to an
<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
0 HTML tag

wp_admin_viewport_meta() wp-admin/includes/misc. php

Displays the viewport meta in the admin

wp_rel_callback() wp-includes/formatting. php

Callback to add a rel attribute to HTML A element

wp_credits_section_list() wp-admin/includes/credits. php

Displays a list of contributors for a given group

WP_Privacy_Data_Removal_Requests_List_Table. column_email() wp-admin/includes/class-wp-privacy-data-removal-requests-list-table. php

Actions column

WP_Privacy_Data_Removal_Requests_List_Table. column_next_steps() wp-admin/includes/class-wp-privacy-data-removal-requests-list-table. php

Next steps column

WP_Privacy_Data_Export_Requests_List_Table. column_email() wp-admin/includes/class-wp-privacy-data-export-requests-list-table. php

Actions column

WP_Privacy_Data_Export_Requests_List_Table. column_next_steps() wp-admin/includes/class-wp-privacy-data-export-requests-list-table. php

Displays the next steps column

wp_filter_oembed_iframe_title_attribute() wp-includes/embed. php

Filters the given oEmbed HTML to make sure iframes have a title attribute

WP_Site_Health. get_test_background_updates() wp-admin/includes/class-wp-site-health. php

Tests if WordPress can run automated background updates

WP_Posts_List_Table. formats_dropdown() wp-admin/includes/class-wp-posts-list-table. php

Displays a formats drop-down for filtering items

wp_targeted_link_rel_callback() wp-includes/formatting. php

Callback to add

<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
5 string to HTML A element

WP_Scripts. print_translations() wp-includes/class-wp-scripts. php

Prints translations set for a specific handle

the_block_editor_meta_boxes() wp-admin/includes/post. php

Renders the meta boxes forms

the_block_editor_meta_box_post_form_hidden_fields() wp-admin/includes/post. php

Renders the hidden form required for the meta boxes form

wp_privacy_generate_personal_data_export_group_html() wp-admin/includes/privacy-tools. php

Buat satu grup untuk laporan ekspor data pribadi

wp_privacy_generate_personal_data_export_file() wp-admin/includes/privacy-tools. php

Hasilkan file ekspor data pribadi

WP_Privacy_Requests_Table. column_status() wp-admin/includes/class-wp-privacy-requests-table. php

Kolom status

WP_Privacy_Requests_Table. single_row() wp-admin/includes/class-wp-privacy-requests-table. php

Menghasilkan konten untuk satu baris tabel,

WP_Privacy_Requests_Table. column_cb() wp-admin/includes/class-wp-privacy-requests-table. php

kolom kotak centang

WP_Widget_Text. is_legacy_instance() wp-includes/widgets/class-wp-widget-text. php

Menentukan apakah instance yang diberikan adalah warisan dan harus dilewati menggunakan TinyMCE

WP_Widget_Media_Gallery. render_control_template_scripts() wp-include/widgets/class-wp-widget-media-gallery. php

Render skrip Templat formulir

WP_Widget_Custom_HTML. form() wp-includes/widgets/class-wp-widget-custom-html. php

Menghasilkan formulir pengaturan widget HTML Khusus

WP_Customize_Nav_Menu_Locations_Control. content_template() wp-includes/customize/class-wp-customize-nav-menu-locations-control. php

Template JS/Underscore untuk UI kontrol

WP_Customize_Themes_Section. filter_drawer_content_template() wp-includes/customize/class-wp-customize-themes-section. php

Render bagian laci filter dari bagian tema sebagai template JS

wp_load_press_this() wp-admin/tekan-ini. php wp_print_plugin_file_tree() wp-admin/includes/misc. php

Menampilkan daftar file yang diformat untuk editor file plugin

wp_print_theme_file_tree() wp-admin/includes/misc. php

Menampilkan daftar file yang diformat untuk editor file tema

WP_Widget_Media. form() wp-includes/widgets/class-wp-widget-media. php

Menghasilkan formulir pembaruan pengaturan

WP_Widget_Media. render_control_template_scripts() wp-includes/widgets/class-wp-widget-media. php

Render skrip Templat formulir

WP_Widget_Media_Image. render_media() wp-includes/widgets/class-wp-widget-media-image. php

Render media di frontend

WP_Widget_Media_Image. render_control_template_scripts() wp-includes/widgets/class-wp-widget-media-image. php

Render skrip Templat formulir

WP_Customize_Nav_Menus. print_post_type_container() wp-includes/class-wp-customize-nav-menus. php

Mencetak markup untuk item menu baru

WP_Customize_Background_Position_Control. content_template() wp-includes/customize/class-wp-customize-background-position-control. php

Render template JS untuk konten kontrol posisi

wp_resource_hints() wp-includes/general-template. php

Mencetak petunjuk sumber daya ke browser untuk pra-pengambilan, pra-render, dan pra-koneksi ke situs web

network_edit_site_nav() wp-admin/includes/ms. php

Mengeluarkan HTML untuk antarmuka tabular "Edit Situs" jaringan

WP_Plugins_List_Table. search_box() wp-admin/includes/class-wp-plugins-list-table. php

Menampilkan kotak pencarian

WP_Script. print_inline_script() wp-includes/class-wp-scripts. php

Mencetak skrip sebaris yang didaftarkan untuk pegangan tertentu

WP_Customize_Widgets. filter_dynamic_sidebar_params() wp-includes/class-wp-customize-widgets. php

Menyuntikkan atribut data penyegaran selektif ke dalam elemen penampung widget

get_post_embed_html() wp-includes/embed. php

Mengambil kode embed untuk posting tertentu

get_the_author_posts_link() wp-includes/author-template. php

Mengambil tautan HTML ke halaman penulis dari penulis posting saat ini

wp_image_add_srcset_and_sizes() wp-includes/media. php

Menambahkan atribut 'srcset' dan 'sizes' ke elemen 'img' yang ada

WP_Posts_List_Table. get_edit_link() wp-admin/includes/class-wp-posts-list-table. php

Helper untuk membuat link untuk mengedit. php dengan params

WP_Customize_Nav_Menu_Location_Control. render_content() wp-includes/customize/class-wp-customize-nav-menu-location-control. php

Render konten seperti kontrol pemilihan normal

WP_Customize_Panel. print_template() wp-includes/class-wp-customize-panel. php

Render template JS panel

get_language_attributes() wp-includes/general-template. php

Mendapatkan atribut bahasa untuk tag 'html'

WP_Customize_Nav_Menus. filter_wp_nav_menu() wp-includes/class-wp-customize-nav-menus. php

Menyiapkan panggilan wp_nav_menu() untuk penyegaran sebagian

WP_Customize_New_Menu_Section. render() wp-includes/customize/class-wp-customize-new-menu-section. php

Render bagian tersebut, dan kontrol yang telah ditambahkan ke dalamnya

WP_Posts_List_Table. handle_row_actions() wp-admin/includes/class-wp-posts-list-table. php

Menghasilkan dan menampilkan tautan tindakan baris

WP_Posts_List_Table. column_title() wp-admin/includes/class-wp-posts-list-table. php

Menangani keluaran kolom judul

WP_Links_List_Table. column_cb() wp-admin/includes/class-wp-links-list-table. php

Handles the checkbox column output

WP_Links_List_Table. column_name() wp-admin/includes/class-wp-links-list-table. php

Menangani keluaran kolom nama tautan

WP_MS_Themes_List_Table. column_name() wp-admin/includes/class-wp-ms-themes-list-table. php

Menangani keluaran kolom nama

WP_MS_Themes_List_Table. column_description() wp-admin/includes/class-wp-ms-themes-list-table. php

Menangani output kolom deskripsi

WP_MS_Themes_List_Table. column_cb() wp-admin/includes/class-wp-ms-themes-list-table. php

Handles the checkbox column output

WP_MS_Sites_List_Table. column_cb() wp-admin/includes/class-wp-ms-sites-list-table. php

Handles the checkbox column output

WP_Terms_List_Table. handle_row_actions() wp-admin/includes/class-wp-terms-list-table. php

Menghasilkan dan menampilkan tautan tindakan baris

WP_MS_Users_List_Table. column_blogs() wp-admin/includes/class-wp-ms-users-list-table. php

Menangani keluaran kolom situs

WP_MS_Users_List_Table. column_cb() wp-admin/includes/class-wp-ms-users-list-table. php

Handles the checkbox column output

WP_Media_List_Table. column_parent() wp-admin/includes/class-wp-media-list-table. php

Menangani keluaran kolom induk

WP_Media_List_Table. column_title() wp-admin/includes/class-wp-media-list-table. php

Menangani keluaran kolom judul

wp_kses_one_attr() wp-includes/kses. php

Memfilter satu atribut HTML dan memastikan nilainya diizinkan

WP_Customize_Theme_Control. content_template() wp-includes/customize/class-wp-customize-theme-control. php

Render template JS untuk tampilan tema

customize_themes_print_templates() wp-admin/includes/theme. php

Mencetak template JS untuk UI penjelajahan tema di Customizer

WP_Customize_Control. print_template() wp-includes/class-wp-customize-control. php

Render template JS kontrol

wp_dropdown_languages() wp-includes/l10n. php

Menampilkan atau mengembalikan pemilih Bahasa

WP_Customize_Control. input_attrs() wp-includes/class-wp-customize-control. php

Render atribut khusus untuk elemen input kontrol

wp_install_language_form() wp-admin/includes/translation-install. php

Keluarkan formulir pemilihan untuk pemilihan bahasa pada layar instalasi

login_footer() login-wp. php

Menghasilkan footer untuk halaman login

login_header() login-wp. php

Keluarkan header halaman login

show_user_form() pendaftaran wp. php

Menampilkan bidang untuk formulir pendaftaran akun pengguna baru

signup_blog() daftar-wp. php

Menampilkan formulir bagi pengguna atau pengunjung untuk mendaftar ke situs baru

show_blog_form() pendaftaran wp. php

Menghasilkan dan menampilkan formulir Daftar dan Buat Situs

network_step1() wp-admin/includes/network. php

Mencetak langkah 1 untuk proses instalasi Jaringan

display_setup_form() wp-admin/instal. php

Menampilkan formulir penyiapan penginstal

WP_Screen. render_screen_layout() wp-admin/includes/class-wp-screen. php

Merender opsi untuk jumlah kolom pada halaman

WP_Screen. render_per_page_options() wp-admin/includes/class-wp-screen. php

Merender item per opsi halaman

get_theme_update_available() wp-admin/includes/theme. php

Retrieves the update link if there is a theme update available

WP_Screen. render_screen_meta() wp-admin/includes/class-wp-screen. php

Renders the screen’s help section

WP_Plugins_List_Table. single_row() wp-admin/includes/class-wp-plugins-list-table. php meta_box_prefs() wp-admin/includes/screen. php

Prints the meta box preferences for screen meta

WP_Links_List_Table. display_rows() wp-admin/includes/class-wp-links-list-table. php install_theme_search_form() wp-admin/includes/theme-install. php

Displays search form for searching themes

install_themes_dashboard() wp-admin/includes/theme-install. php

Displays tags filter for themes

Bulk_Upgrader_Skin. before() wp-admin/includes/class-bulk-upgrader-skin. php Bulk_Upgrader_Skin. after() wp-admin/includes/class-bulk-upgrader-skin. php WP_List_Table. single_row_columns() wp-admin/includes/class-wp-list-table. php

Generates the columns for a single row of the table

WP_List_Table. view_switcher() wp-admin/includes/class-wp-list-table. php

Displays a view switcher

WP_List_Table. get_table_classes() wp-admin/includes/class-wp-list-table. php

Gets a list of CSS classes for the WP_List_Table table tag

WP_List_Table. display_tablenav() wp-admin/includes/class-wp-list-table. php

Generates the table navigation above or below the table

WP_List_Table. search_box() wp-admin/includes/class-wp-list-table. php

Menampilkan kotak pencarian

WP_List_Table. bulk_actions() wp-admin/includes/class-wp-list-table. php

Displays the bulk actions dropdown

WP_List_Table. months_dropdown() wp-admin/includes/class-wp-list-table. php

Displays a dropdown for filtering items in the list table by month

mu_dropdown_languages() wp-admin/includes/ms. php

Generates and displays a drop-down of available languages

wp_image_editor() wp-admin/includes/image-edit. php

Loads the WP image-editing interface

WP_MS_Themes_List_Table. single_row() wp-admin/includes/class-wp-ms-themes-list-table. php admin_color_scheme_picker() wp-admin/includes/misc. php

Displays the default admin color scheme picker (Used in user-edit. php)

WP_Theme_Install_List_Table. install_theme_info() wp-admin/includes/class-wp-theme-install-list-table. php

Prints the info for a theme (to be used in the theme installer modal)

get_terms_to_edit() wp-admin/includes/taxonomy. php

Gets comma-separated list of terms available to edit for the given post ID

WP_Theme_Install_List_Table. single_row() wp-admin/includes/class-wp-theme-install-list-table. php

Prints a theme from the WordPress. org API

wp_plugin_update_row() wp-admin/includes/update. php

Displays update information for a plugin

wp_theme_update_row() wp-admin/includes/update. php

Displays update information for a theme

install_search_form() wp-admin/includes/plugin-install. php

Displays a search form for searching plugins

install_plugins_favorites_form() wp-admin/includes/plugin-install. php

Menampilkan formulir nama pengguna untuk halaman favorit

install_plugin_information() wp-admin/includes/plugin-install. php

Menampilkan informasi plugin dalam bentuk kotak dialog

wp_dashboard_recent_posts() wp-admin/includes/dashboard. php

Menghasilkan bagian Segera Diterbitkan dan Baru Diterbitkan

wp_dashboard_browser_nag() wp-admin/includes/dashboard. php

Menampilkan cerewet pembaruan browser

wp_dashboard_plugins_output() wp-admin/includes/deprecated. php

Tampilkan teks plugin untuk widget berita WordPress

_wp_dashboard_control_callback() wp-admin/includes/dashboard. php

Kontrol output untuk widget dasbor saat ini

wp_dashboard_recent_drafts() wp-admin/includes/dashboard. php

Show recent drafts of the user on the dashboard

settings_fields() wp-admin/includes/plugin. php

Outputs nonce, action, and option_page fields for a settings page

WP_Plugin_Install_List_Table. display_rows() wp-admin/includes/class-wp-plugin-install-list-table. php get_submit_button() wp-admin/includes/template. php

Returns a submit button, with provided text and appropriate class

do_settings_sections() wp-admin/includes/template. php

Prints out all settings sections added to a particular settings page

do_settings_fields() wp-admin/includes/template. php

Prints out the settings fields for a particular settings section

settings_errors() wp-admin/includes/template. php

Displays settings errors registered by add_settings_error()

find_posts_div() wp-admin/includes/template. php

Outputs the modal window used for attaching media to posts or pages in the media-listing screen

the_post_password() wp-admin/includes/template. php

Displays the post password

_admin_search_query() wp-admin/includes/template. php

Displays the search query

wp_comment_reply() wp-admin/includes/template. php

Outputs the in-line comment reply-to form in the Comments list table

_list_meta_row() wp-admin/includes/template. php

Outputs a single row of public meta data in the Custom Fields meta box

meta_form() wp-admin/includes/template. php

Prints the form in the Custom Fields meta box

page_template_dropdown() wp-admin/includes/template. php

Prints out option HTML elements for the page templates drop-down

wp_dropdown_roles() wp-admin/includes/template. php

Prints out option HTML elements for role selectors

do_meta_boxes() wp-admin/includes/template. php

Meta-Box template function

do_accordion_sections() wp-admin/includes/template. php

Meta Box Accordion Template Function

WP_Themes_List_Table. display_rows() wp-admin/includes/class-wp-themes-list-table. php WP_Themes_List_Table. _js_vars() wp-admin/includes/class-wp-themes-list-table. php

Send required variables to JavaScript land

WP_Users_List_Table. single_row() wp-admin/includes/class-wp-users-list-table. php

Generate HTML for a single row on the users. php admin panel

media_upload_gallery_form() wp-admin/includes/media. php

Adds gallery form to upload iframe

media_upload_library_form() wp-admin/includes/media. php

Outputs the legacy media upload form for the media library

edit_form_image_editor() wp-admin/includes/media. php

Displays the image and editor in the post editor

attachment_submitbox_metadata() wp-admin/includes/media. php

Displays non-editable attachment metadata in the publish meta box

get_attachment_fields_to_edit() wp-admin/includes/media. php

Retrieves the attachment fields to edit form fields

get_media_item() wp-admin/includes/media. php

Retrieves HTML form for modifying the image attachment

get_compat_media_markup() wp-admin/includes/media. php media_upload_form_handler() wp-admin/includes/media. php

Handles form submissions for the legacy media uploader

wp_media_upload_handler() wp-admin/includes/media. php

Handles the process of uploading media

media_sideload_image() wp-admin/includes/media. php

Downloads an image from the specified URL, saves it as an attachment, and optionally attaches it to a post

image_align_input_fields() wp-admin/includes/media. php

Retrieves HTML for the image alignment radio buttons with the specified one checked

image_link_input_fields() wp-admin/includes/media. php

Retrieves HTML for the Link URL buttons with the default link type as specified

the_media_upload_tabs() wp-admin/includes/media. php

Outputs the legacy media upload tabs UI

get_image_send_to_editor() wp-admin/includes/media. php

Mengambil gambar HTML untuk dikirim ke editor

media_buttons() wp-admin/includes/media. php

Adds the media button to the editor

_wp_post_thumbnail_html() wp-admin/includes/post. php

Returns HTML for the post thumbnail meta box

wp_ajax_find_posts() wp-admin/includes/ajax-actions. php

Ajax handler for querying posts for the Find Posts modal

wp_ajax_add_link_category() wp-admin/includes/ajax-actions. php

Penangan Ajax untuk menambahkan kategori tautan

post_trackback_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan kolom formulir link trackback

post_slug_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir siput

page_attributes_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir atribut halaman

link_xfn_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir XFN

link_advanced_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir opsi tautan lanjutan

attachment_id3_data_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang untuk data ID3

post_submit_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan kolom formulir pengiriman kiriman

post_format_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan elemen formulir format posting

post_tags_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir tag pos

post_categories_meta_box() wp-admin/includes/meta-boxes. php

Menampilkan bidang formulir kategori pos

get_default_link_to_edit() wp-admin/includes/bookmark. php

Mengambil tautan default untuk diedit

WP_Media_List_Table. get_views() wp-admin/includes/class-wp-media-list-table. php WP_Media_List_Table. _get_row_actions() wp-admin/includes/class-wp-media-list-table. php WP_Terms_List_Table. column_name() wp-admin/includes/class-wp-terms-list-table. php WP_Terms_List_Table. inline_edit() wp-admin/includes/class-wp-terms-list-table. php

Menampilkan baris tersembunyi yang ditampilkan saat pengeditan sebaris

Walker_Nav_Menu_Edit. start_el() wp-admin/includes/class-walker-nav-menu-edit. php

Mulai keluaran elemen

Walker_Nav_Menu_Daftar Periksa. start_el() wp-admin/includes/class-walker-nav-menu-checklist. php

Mulai keluaran elemen

wp_nav_menu_item_post_type_meta_box() wp-admin/includes/nav-menu. php

Menampilkan kotak meta untuk item menu jenis posting

wp_nav_menu_item_taxonomy_meta_box() wp-admin/includes/nav-menu. php

Menampilkan kotak meta untuk item menu taksonomi

request_filesystem_credentials() wp-admin/includes/file. php

Menampilkan formulir kepada pengguna untuk meminta detail FTP/SSH mereka agar dapat terhubung ke sistem file

WP_Posts_List_Table. inline_edit() wp-admin/includes/class-wp-posts-list-table. php

Menampilkan baris tersembunyi yang ditampilkan saat pengeditan sebaris

wp_list_widget_controls() wp-admin/include/widgets. php

Tampilkan widget dan pengaturannya untuk sidebar

wp_widget_control() wp-admin/includes/widgets. php

Widget meta digunakan untuk menampilkan formulir kontrol untuk widget

WP_Posts_List_Table. get_table_classes() wp-admin/includes/class-wp-posts-list-table. php options_reading_blog_charset() wp-admin/includes/options. php

Render pengaturan charset situs

Custom_Image_Header. step_1() wp-admin/includes/class-custom-image-header. php

Tampilkan langkah pertama halaman gambar header khusus

Custom_Image_Header. step_2() wp-admin/includes/class-custom-image-header. php

Tampilkan langkah kedua halaman gambar header khusus

Custom_Image_Header. show_header_selector() wp-admin/includes/class-custom-image-header. php

Tampilan UI untuk memilih salah satu dari beberapa header default

confirm_delete_users() wp-admin/includes/ms. php list_core_update() wp-admin/update-core. php

Lists available core updates

list_plugin_updates() wp-admin/update-core. php

Menampilkan formulir pemutakhiran plugin

list_theme_updates() wp-admin/update-core. php

Menampilkan formulir peningkatan tema

Latar Belakang_Khusus. wp_set_background_image() wp-admin/includes/class-custom-background. php Latar Belakang_Kustom. admin_page() wp-admin/includes/class-custom-background. php

Displays the custom background page

_wp_menu_output() wp-admin/menu-header. php

Menampilkan menu

WP_Styles. print_inline_style() wp-includes/class-wp-styles. php

Mencetak gaya CSS ekstra dari lembar gaya terdaftar

WP_Styles. do_item() wp-include/class-wp-styles. php

Memproses ketergantungan gaya

Walker_CategoryDropdown. start_el() wp-includes/class-walker-category-dropdown. php

Memulai output elemen

Walker_Category. start_el() wp-includes/class-walker-category. php

Memulai output elemen

wp_generate_tag_cloud() wp-includes/category-template. php

Menghasilkan awan tag (peta panas) dari data yang disediakan

wp_dropdown_categories() wp-includes/category-template. php

Menampilkan atau mengambil daftar dropdown kategori HTML

wp_list_categories() wp-includes/category-template. php

Menampilkan atau mengambil daftar kategori HTML

esc_attr__() wp-includes/l10n. php

Mengambil terjemahan dari $text dan melepaskannya untuk penggunaan yang aman dalam sebuah atribut

esc_attr_e() wp-includes/l10n. php

Menampilkan teks terjemahan yang telah di-escape untuk penggunaan yang aman dalam sebuah atribut

esc_attr_x() wp-includes/l10n. php

Menerjemahkan string dengan konteks gettext, dan melepaskannya untuk penggunaan yang aman dalam atribut

_links_add_target() menyertakan/memformat wp. php

Callback untuk menambahkan atribut target ke semua tautan dalam konten yang diteruskan

_make_url_clickable_cb() menyertakan/memformat wp. php

Callback untuk mengonversi pencocokan URI ke elemen HTML A

_make_web_ftp_clickable_cb() menyertakan/memformat wp. php

Callback untuk mengonversi pencocokan URL ke elemen HTML A

translate_smiley() wp-includes/formatting. php

Mengonversi satu kode smiley ke file grafik ikon yang setara

get_avatar() wp-includes/pluggable. php

Retrieves the avatar

<?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
<input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
6 tag for a user, email address, MD5 hash, comment, or post

the_search_query() wp-includes/general-template. php

Menampilkan konten variabel permintaan pencarian

paginate_links() wp-includes/general-template. php

Mengambil tautan paginasi untuk mengarsipkan halaman posting

get_the_generator() wp-includes/general-template. php

Membuat generator XML atau Komentar untuk RSS, ATOM, dll

feed_links() wp-includes/general-template. php

Menampilkan link ke feed umum

feed_links_extra() wp-includes/general-template. php

Menampilkan tautan ke umpan tambahan seperti umpan kategori

get_search_query() wp-includes/general-template. php

Mengambil konten dari variabel kueri pencarian WordPress

get_archives_link() wp-includes/general-template. php

Mengambil konten tautan arsip berdasarkan kode standar atau kustom

get_calendar() wp-includes/general-template. php

Menampilkan kalender dengan hari-hari yang memiliki postingan sebagai link

wp_login_form() wp-includes/general-template. php

Menyediakan formulir login sederhana untuk digunakan di mana saja di dalam WordPress

get_search_form() wp-includes/general-template. php

Menampilkan form pencarian

get_boundary_post_rel_link() wp-include/usang. php

Dapatkan tautan relasional pos batas

get_index_rel_link() wp-include/usang. php

Dapatkan tautan relasional indeks situs

get_parent_post_rel_link() wp-include/usang. php

Dapatkan tautan relasional pos induk

get_the_attachment_link() wp-include/usang. php

Ambil konten HTML dari gambar lampiran dengan tautan

get_attachment_icon() wp-include/usang. php

Ambil konten HTML dari elemen gambar lampiran ikon

get_attachment_innerHTML() wp-include/usang. php

Ambil konten HTML dari elemen gambar

attribute_escape() wp-include/usang. php

Melarikan diri untuk atribut HTML

get_links() wp-include/usang. php

Mendapat tautan yang terkait dengan kategori berdasarkan ID

wp_timezone_choice() wp-includes/functions. php

Memberikan daftar string zona waktu yang diformat dengan baik

wp_nonce_field() wp-includes/functions. php

Mengambil atau menampilkan bidang tersembunyi untuk formulir

wp_original_referer_field() wp-includes/functions. php

Mengambil dan menampilkan bidang tersembunyi perujuk asli untuk formulir

WP_Nav_Menu_Widget. form() wp-includes/widgets/class-wp-nav-menu-widget. php

Mengeluarkan formulir pengaturan untuk widget Menu Navigasi

WP_Widget_Recent_Comments. form() wp-includes/widgets/class-wp-widget-recent-comments. php

Menampilkan formulir pengaturan untuk widget Komentar Terbaru

WP_Widget_Tag_Cloud. widget() wp-includes/widgets/class-wp-widget-tag-cloud. php

Menampilkan konten untuk instance widget Tag Cloud saat ini

WP_Widget_Tag_Cloud. form() wp-includes/widgets/class-wp-widget-tag-cloud. php

Menghasilkan formulir pengaturan widget Tag Cloud

WP_Widget_RSS. widget() wp-includes/widgets/class-wp-widget-rss. php

Mengeluarkan konten untuk instance widget RSS saat ini

WP_Widget_Recent_Comments. widget() wp-includes/widgets/class-wp-widget-recent-comments. php

Mengeluarkan konten untuk instance widget Komentar Terbaru saat ini

WP_Widget_Recent_Posts. widget() wp-includes/widgets/class-wp-widget-recent-posts. php

Mengeluarkan konten untuk instance widget Recent Posts saat ini

WP_Widget_Recent_Posts. form() wp-includes/widgets/class-wp-widget-recent-posts. php

Mengeluarkan formulir pengaturan untuk widget Tulisan Terbaru

WP_Widget_Categories. form() wp-includes/widgets/class-wp-widget-categories. php

Menampilkan formulir pengaturan untuk widget Kategori

WP_Widget_Categories. widget() wp-includes/widgets/class-wp-widget-categories. php

Outputs the content for the current Categories widget instance

WP_Widget_Text. form() wp-includes/widgets/class-wp-widget-text. php

Mengeluarkan formulir pengaturan widget Teks

WP_Widget_Calendar. form() wp-includes/widgets/class-wp-widget-calendar. php

Mengeluarkan formulir pengaturan untuk widget Kalender

WP_Widget_Meta. widget() wp-includes/widgets/class-wp-widget-meta. php

Menampilkan konten untuk instance widget Meta saat ini

WP_Widget_Meta. form() wp-includes/widgets/class-wp-widget-meta. php

Menampilkan formulir pengaturan untuk widget Meta

WP_Widget_Archives. widget() wp-includes/widgets/class-wp-widget-archives. php

Menampilkan konten untuk instance widget Arsip saat ini

WP_Widget_Archives. form() wp-includes/widgets/class-wp-widget-archives. php

Mengeluarkan formulir pengaturan untuk widget Arsip

WP_Widget_Search. form() wp-include/widgets/class-wp-widget-search. php

Menghasilkan formulir pengaturan untuk widget Pencarian

WP_Widget_Pages. widget() wp-includes/widgets/class-wp-widget-pages. php

Mengeluarkan konten untuk instance widget Pages saat ini

WP_Widget_Pages. form() wp-includes/widgets/class-wp-widget-pages. php

Menghasilkan formulir pengaturan untuk widget Pages

wp_widget_rss_output() wp-includes/widgets. php

Tampilkan entri RSS dalam daftar

wp_widget_rss_form() wp-include/widget. php

Tampilkan formulir opsi widget RSS

get_the_taxonomies() wp-includes/taxonomy. php

Mengambil semua taksonomi yang terkait dengan pos

sanitize_term_field() wp-includes/taxonomy. php

Membersihkan nilai bidang dalam istilah berdasarkan konteks

get_adjacent_post_rel_link() wp-includes/link-template. php

Mengambil tautan pos relasional yang berdekatan

edit_post_link() wp-includes/link-template. php

Menampilkan tautan edit posting untuk posting

WP_Admin_Bar. _render_container() wp-includes/class-wp-admin-bar. php WP_Admin_Bar. _render_group() wp-includes/class-wp-admin-bar. php WP_Admin_Bar. _render_item() wp-includes/class-wp-admin-bar. php WP_Admin_Bar. add_node() wp-includes/class-wp-admin-bar. php

Menambahkan node ke menu

wp_get_update_data() wp-includes/update. php

Mengumpulkan jumlah dan string UI untuk pembaruan yang tersedia

WP_oEmbed. data2html() wp-includes/class-wp-oembed. php

Mengonversi objek data dari WP_oEmbed. fetch() dan mengembalikan HTML

wp_admin_bar_shortlink_menu() wp-includes/admin-bar. php

Menyediakan tautan pendek

get_the_category_rss() wp-includes/feed. php

Mengambil semua kategori posting, diformat untuk digunakan dalam umpan

rss_enclosure() wp-includes/feed. php

Menampilkan kandang rss untuk posting saat ini

atom_enclosure() wp-includes/feed. php

Menampilkan kandang atom untuk posting saat ini

form_option() wp-includes/option. php

Mencetak nilai opsi setelah membersihkan formulir

wp_dropdown_users() wp-includes/pengguna. php

Membuat konten HTML dropdown pengguna

sanitize_user_field() wp-includes/pengguna. php

Membersihkan bidang pengguna berdasarkan konteks

_walk_bookmarks() wp-includes/bookmark-template. php

Output yang diformat dari daftar bookmark

load_template() wp-includes/template. php

Membutuhkan file template dengan lingkungan WordPress

Walker_Nav_Menu. start_el() wp-includes/class-walker-nav-menu. php

Memulai output elemen

Walker_Nav_Menu. start_lvl() wp-includes/class-walker-nav-menu. php

Mulai daftar sebelum elemen ditambahkan

Walker_PageDropdown. start_el() wp-includes/class-walker-page-dropdown. php

Memulai output elemen

wp_nav_menu() wp-includes/nav-menu-template. php

Menampilkan menu navigasi

Walker_Page. start_el() wp-includes/class-walker-page. php

Menghasilkan awal elemen saat ini di pohon

wp_link_pages() wp-includes/post-template. php

Output yang diformat dari daftar halaman

wp_dropdown_pages() wp-includes/post-template. php

Mengambil atau menampilkan daftar halaman sebagai dropdown (pilih daftar)

wp_page_menu() wp-includes/post-template. php

Menampilkan atau mengambil daftar halaman dengan tautan beranda opsional

post_class() wp-includes/post-template. php

Menampilkan kelas untuk elemen wadah pos

body_class() wp-includes/post-template. php

Menampilkan nama class untuk elemen body

the_title_attribute() wp-includes/post-template. php

Membersihkan judul saat ini saat mengambil atau menampilkan

wp_video_shortcode() wp-includes/media. php

Membuat keluaran kode pendek Video

wp_playlist_shortcode() wp-includes/media. php

Membuat keluaran kode pendek Daftar Putar

wp_audio_shortcode() wp-includes/media. php

Membuat keluaran kode pendek Audio

get_image_tag() wp-includes/media. php

Mendapat tag img untuk lampiran gambar, menurunkannya jika diminta

img_caption_shortcode() wp-includes/media. php

Membuat output shortcode Caption

sanitize_post_field() wp-includes/posting. php

Membersihkan bidang pos berdasarkan konteks

WP_Tulis ulang. iis7_url_rewrite_rules() wp-includes/class-wp-rewrite. php

Retrieves IIS7 URL Rewrite formatted rewrite rules to write to web. config file

sanitize_bookmark_field() wp-includes/bookmark. php

Sanitizes a bookmark field

WP_Scripts. print_extra_script() wp-includes/class-wp-scripts. php

Prints extra scripts of a registered script

WP_Scripts. do_item() wp-includes/class-wp-scripts. php

Processes a script dependency

get_the_author_link() wp-includes/author-template. php

Retrieves either author’s link or author’s name

wp_list_authors() wp-includes/author-template. php

Lists all the authors of the site, with several options available

wp_rss() wp-includes/rss. php

Display all RSS items in a HTML ordered list

WP_Widget_Area_Customize_Control. render_content() wp-includes/customize/class-wp-widget-area-customize-control. php

Renders the control’s content

WP_Customize_Control. render() wp-includes/class-wp-customize-control. php

Renders the control wrapper and calls $this->render_content() for the internals

WP_Customize_Control. get_link() wp-includes/class-wp-customize-control. php

Get the data link attribute for a setting

WP_Customize_Control. render_content() wp-includes/class-wp-customize-control. php

Render the control’s content

comment_form() wp-includes/comment-template. php

Outputs a complete commenting form for use within a template

comments_popup_link() wp-includes/comment-template. php

Displays the link to the comments for the current post ID

get_comment_reply_link() wp-includes/comment-template. php

Retrieves HTML content for reply to comment link

WP_Customize_Widgets. output_widget_control_templates() wp-includes/class-wp-customize-widgets. php

Renders the widget form control templates into the DOM

sanitize_comment_cookies() wp-includes/komentar. php

Sanitizes the cookies sent to the user already

_WP_Editors. editor() wp-includes/class-wp-editor. php

Outputs the HTML for a single instance of the editor

wp_print_media_templates() wp-includes/media-template. php

Prints the templates used in the media manager


ChangelogVersionDescription2. 8. 0Introduced

  1. You must log in to vote on the helpfulness of this noteVote results for this note. 14You must log in to vote on the helpfulness of this note

    Contributed by J. D. Grimes

    When escaping the values of attributes that accept URIs (like

    <?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
    <input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
    7 and
    <?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
    <input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
    8), it is important to pass the value through
    <?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
    <input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
    9. If you only use
    <input type="text" value="<?php echo esc_attr($value);?>">
    0, the code may still be vulnerable to XSS. (Note also, that when using
    <?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
    <input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">
    9, you don’t need to also use
    <input type="text" value="<?php echo esc_attr($value);?>">
    0. )

    <!-- This is correct: -->
    <img src="<?php echo esc_url( $src ); ?>" />
    
    <!-- This is OK, but the esc_attr() is unnecessary: -->
    <img src="<?php echo esc_attr( esc_url( $src ) ); ?>" />
     
    <!-- This is *not* correct: -->
    <img src="<?php echo esc_attr( $src ); ?>" />

    More info

    • html5sec. org examples of XSS using javascript. URIs

    Log in to add feedback
  2. You must log in to vote on the helpfulness of this noteVote results for this note. 5You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Example of escaping

    <input type="text" value="<?php echo esc_attr($value);?>">
    3 data on output

    <?php $fname = ( isset( $_POST['fname'] ) ) ? $_POST['fname'] : ''; ?>
    <input type="text" name="fname" value="<?php echo esc_attr( $fname ); ?>">

    Log in to add feedback
  3. You must log in to vote on the helpfulness of this noteVote results for this note. 5You must log in to vote on the helpfulness of this note

    Contributed by Michael Nelson

    I’m not sure if

    <input type="text" value="<?php echo esc_attr($value);?>">
    0 is what you should use if you’re echoing out the value for a form input that is allowed to contain HTML entities because they get lost. yaitu, Anda dapat memulai dengan string yang berisi entitas HTML (misalnya
    <input type="text" value="<?php echo esc_attr($value);?>">
    5), dan menemukannya menghilang (berubah menjadi
    <input type="text" value="<?php echo esc_attr($value);?>">
    5)

    Paling mudah dijelaskan dengan sebuah contoh

    1. Anda memiliki nilai dalam database yaitu

    <input type="text" value="<?php echo esc_attr($value);?>">
    7

    2. Anda menampilkan nilai itu di halaman di dalam nilai masukan formulir dengan kode seperti ini

    <input type="text" value="<?php echo esc_attr($value);?>">

    Itu akan menghasilkan HTML seperti

    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">

    3. Ketika itu ditampilkan oleh browser, itu akan DECODE entitas HTML, menampilkan pengguna

    <input type="text" value="<?php echo esc_attr($value);?>">
    8
    4. Saat formulir itu dikirimkan kembali ke server, browser akan mengirimkan nilai USER SAW, yaitu
    <input type="text" value="<?php echo esc_attr($value);?>">
    8
    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    0
    <input type="text" value="<?php echo esc_attr($value);?>">
    8

    Perhatikan kami kehilangan entitas HTML? . Aduh

    Untuk memperbaikinya, ________14

    <!-- This is correct: -->
    <img src="<?php echo esc_url( $src ); ?>" />
    
    <!-- This is OK, but the esc_attr() is unnecessary: -->
    <img src="<?php echo esc_attr( esc_url( $src ) ); ?>" />
     
    <!-- This is *not* correct: -->
    <img src="<?php echo esc_attr( $src ); ?>" />
    _25_______5

    <input value="Want to do a &quot;br&quot; tag? Do this: &amp;lt;br&amp;gt;">

    Notice the

    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    6
    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    7
    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    8
    <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    9

    So what function should you use for inputs that are allowed to have HTML entities?

    <input value="Want to do a &quot;br&quot; tag? Do this: &amp;lt;br&amp;gt;">
    0
    <input value="Want to do a &quot;br&quot; tag? Do this: &amp;lt;br&amp;gt;">
    1

    Here's a code snippet showing the difference

    <?php
    $string_with_html_entities = 'Want to do a "br" tag? Do this: &lt;br&gt;';
    ?>
    esc_attr: <input value="<?php echo esc_attr($string_with_html_entities);?>">
    esc_textarea: <input value="<?php echo esc_textarea($string_with_html_entities);?>">

    Which produces the following HTML

    esc_attr: <input value="Want to do a &quot;br&quot; tag? Do this: &lt;br&gt;">
    esc_textarea: <input value="Want to do a &quot;br&quot; tag? Do this: &amp;lt;br&amp;gt;">

    Try it and you'll see the second is actually what you want, if you want to allow HTML entities in the value

    Log in to add feedback
  4. You must log in to vote on the helpfulness of this noteVote results for this note. 3You must log in to vote on the helpfulness of this note

    Contributed by J. D. Grimes

    It is important to always use quotes around your attribute’s value when it is being escaped with

    <input type="text" value="<?php echo esc_attr($value);?>">
    0. Otherwise, your code will still be vulnerable to XSS

    How to escape HTML in PHP?

    PHP Escaping From HTML .
    Definition and Usage. PHP file can have mixed content with code within tags embedded in a HTML document. .
    Syntax.

    HTML block

    PHP Version. This description is applicable to all versions of PHP. .
    Example
    Output. .
    Example
    Output

    How to escape strings in PHP?

    Escape Sequences In PHP, an escape sequence starts with a backslash \ . Escape sequences apply to double-quoted strings. A single-quoted string only uses the escape sequences for a single quote or a backslash.

    How to display HTML string in PHP?

    Method 1. Using htmlspecialchars() function . The htmlspecialchars() function is an inbuilt function in PHP which is used to convert all predefined characters to HTML entities. $string. This parameter is used to hold the input string. $flags. This parameter is used to hold the flags.

    How to encode HTML in PHP?

    The htmlentities() function converts characters to HTML entities . Tip. To convert HTML entities back to characters, use the html_entity_decode() function. Tip. Use the get_html_translation_table() function to return the translation table used by htmlentities().