: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<input type="text" id="author-url" name="newcomment_author_url" class="code" size="103" value="" />
<div id="replysubmit" class="submit">
<p class="reply-submit-buttons">
<button type="button" class="save button button-primary">
<span id="addbtn" style="display: none;"><?php _e( 'Add Comment' ); ?></span>
<span id="savebtn" style="display: none;"><?php _e( 'Update Comment' ); ?></span>
<span id="replybtn" style="display: none;"><?php _e( 'Submit Reply' ); ?></span>
<button type="button" class="cancel button"><?php _e( 'Cancel' ); ?></button>
<span class="waiting spinner"></span>
'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),
'paragraph_wrap' => false,
<input type="hidden" name="action" id="action" value="" />
<input type="hidden" name="comment_ID" id="comment_ID" value="" />
<input type="hidden" name="comment_post_ID" id="comment_post_ID" value="" />
<input type="hidden" name="status" id="status" value="" />
<input type="hidden" name="position" id="position" value="<?php echo $position; ?>" />
<input type="hidden" name="checkbox" id="checkbox" value="<?php echo $checkbox ? 1 : 0; ?>" />
<input type="hidden" name="mode" id="mode" value="<?php echo esc_attr( $mode ); ?>" />
wp_nonce_field( 'replyto-comment', '_ajax_nonce-replyto-comment', false );
if ( current_user_can( 'unfiltered_html' ) ) {
wp_nonce_field( 'unfiltered-html-comment', '_wp_unfiltered_html_comment', false );
<?php if ( $table_row ) : ?>
</td></tr></tbody></table>
* Outputs 'undo move to Trash' text for comments.
function wp_comment_trashnotice() {
<div class="hidden" id="trash-undo-holder">
<div class="trash-undo-inside">
/* translators: %s: Comment author, filled by Ajax. */
printf( __( 'Comment by %s moved to the Trash.' ), '<strong></strong>' );
<span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span>
<div class="hidden" id="spam-undo-holder">
<div class="spam-undo-inside">
/* translators: %s: Comment author, filled by Ajax. */
printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' );
<span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span>
* Outputs a post's public meta data in the Custom Fields meta box.
* @param array[] $meta An array of meta data arrays keyed on 'meta_key' and 'meta_value'.
function list_meta( $meta ) {
<table id="list-table" style="display: none;">
<th class="left">' . _x( 'Name', 'meta name' ) . '</th>
<th>' . __( 'Value' ) . '</th>
<tbody id="the-list" data-wp-lists="list:meta">
</table>'; // TBODY needed for list-manipulation JS.
<th class="left"><?php _ex( 'Name', 'meta name' ); ?></th>
<th><?php _e( 'Value' ); ?></th>
<tbody id='the-list' data-wp-lists='list:meta'>
foreach ( $meta as $entry ) {
echo _list_meta_row( $entry, $count );
* Outputs a single row of public meta data in the Custom Fields meta box.
* @param array $entry An array of meta data keyed on 'meta_key' and 'meta_value'.
* @param int $count Reference to the row number.
* @return string A single row of public meta data.
function _list_meta_row( $entry, &$count ) {
static $update_nonce = '';
if ( is_protected_meta( $entry['meta_key'], 'post' ) ) {
$update_nonce = wp_create_nonce( 'add-meta' );
if ( is_serialized( $entry['meta_value'] ) ) {
if ( is_serialized_string( $entry['meta_value'] ) ) {
// This is a serialized string, so we should display it.
$entry['meta_value'] = maybe_unserialize( $entry['meta_value'] );
// This is a serialized array/object so we should NOT display it.
$entry['meta_key'] = esc_attr( $entry['meta_key'] );
$entry['meta_value'] = esc_textarea( $entry['meta_value'] ); // Using a <textarea />.
$entry['meta_id'] = (int) $entry['meta_id'];
$delete_nonce = wp_create_nonce( 'delete-meta_' . $entry['meta_id'] );
$r .= "\n\t<tr id='meta-{$entry['meta_id']}'>";
$r .= "\n\t\t<td class='left'><label class='screen-reader-text' for='meta-{$entry['meta_id']}-key'>" .
/* translators: Hidden accessibility text. */
"</label><input name='meta[{$entry['meta_id']}][key]' id='meta-{$entry['meta_id']}-key' type='text' size='20' value='{$entry['meta_key']}' />";
$r .= "\n\t\t<div class='submit'>";
$r .= get_submit_button( __( 'Delete' ), 'deletemeta small', "deletemeta[{$entry['meta_id']}]", false, array( 'data-wp-lists' => "delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce" ) );
$r .= get_submit_button( __( 'Update' ), 'updatemeta small', "meta-{$entry['meta_id']}-submit", false, array( 'data-wp-lists' => "add:the-list:meta-{$entry['meta_id']}::_ajax_nonce-add-meta=$update_nonce" ) );
$r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
$r .= "\n\t\t<td><label class='screen-reader-text' for='meta-{$entry['meta_id']}-value'>" .
/* translators: Hidden accessibility text. */
"</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta-{$entry['meta_id']}-value' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
* Prints the form in the Custom Fields meta box.
* @global wpdb $wpdb WordPress database abstraction object.
* @param WP_Post $post Optional. The post being edited.
function meta_form( $post = null ) {
$post = get_post( $post );
* Filters values for the meta key dropdown in the Custom Fields meta box.
* Returning a non-null value will effectively short-circuit and avoid a
* potentially expensive query against postmeta.
* @param array|null $keys Pre-defined meta keys to be used in place of a postmeta query. Default null.
* @param WP_Post $post The current post object.
$keys = apply_filters( 'postmeta_form_keys', null, $post );
* Filters the number of custom fields to retrieve for the drop-down
* in the Custom Fields meta box.
* @param int $limit Number of custom fields to retrieve. Default 30.
$limit = apply_filters( 'postmeta_form_limit', 30 );
"SELECT DISTINCT meta_key
WHERE meta_key NOT BETWEEN '_' AND '_z'
HAVING meta_key NOT LIKE %s
$wpdb->esc_like( '_' ) . '%',
<p><strong><?php _e( 'Add New Custom Field:' ); ?></strong></p>
<th class="left"><label for="metakeyselect"><?php _ex( 'Name', 'meta name' ); ?></label></th>
<th><label for="metavalue"><?php _e( 'Value' ); ?></label></th>
<td id="newmetaleft" class="left">
<select id="metakeyselect" name="metakeyselect">
<option value="#NONE#"><?php _e( '— Select —' ); ?></option>
foreach ( $keys as $key ) {
if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {
echo "\n<option value='" . esc_attr( $key ) . "'>" . esc_html( $key ) . '</option>';
<input class="hidden" type="text" id="metakeyinput" name="metakeyinput" value="" aria-label="<?php _e( 'New custom field name' ); ?>" />
<button type="button" id="newmeta-button" class="button button-small hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggleClass('hidden');jQuery('#metakeyinput, #metakeyselect').filter(':visible').trigger('focus');">
<span id="enternew"><?php _e( 'Enter new' ); ?></span>
<span id="cancelnew" class="hidden"><?php _e( 'Cancel' ); ?></span></button>
<input type="text" id="metakeyinput" name="metakeyinput" value="" />
<td><textarea id="metavalue" name="metavalue" rows="2" cols="25"></textarea>
<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
<div class="submit add-custom-field">
__( 'Add Custom Field' ),
'id' => 'newmeta-submit',
'data-wp-lists' => 'add:the-list:newmeta',
* Prints out HTML form date elements for editing post or comment publish date.
* @since 4.4.0 Converted to use get_comment() instead of the global `$comment`.
* @global WP_Locale $wp_locale WordPress date and time locale object.
* @param int|bool $edit Accepts 1|true for editing the date, 0|false for adding the date.
* @param int|bool $for_post Accepts 1|true for applying the date to a post, 0|false for a comment.
* @param int $tab_index The tabindex attribute to add. Default 0.
* @param int|bool $multi Optional. Whether the additional fields and buttons should be added.
function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$edit = ! ( in_array( $post->post_status, array( 'draft', 'pending' ), true ) && ( ! $post->post_date_gmt || '0000-00-00 00:00:00' === $post->post_date_gmt ) );
$tab_index_attribute = '';
if ( (int) $tab_index > 0 ) {
$tab_index_attribute = " tabindex=\"$tab_index\"";
// echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
$post_date = ( $for_post ) ? $post->post_date : get_comment()->comment_date;
$jj = ( $edit ) ? mysql2date( 'd', $post_date, false ) : current_time( 'd' );
$mm = ( $edit ) ? mysql2date( 'm', $post_date, false ) : current_time( 'm' );
$aa = ( $edit ) ? mysql2date( 'Y', $post_date, false ) : current_time( 'Y' );
$hh = ( $edit ) ? mysql2date( 'H', $post_date, false ) : current_time( 'H' );
$mn = ( $edit ) ? mysql2date( 'i', $post_date, false ) : current_time( 'i' );
$ss = ( $edit ) ? mysql2date( 's', $post_date, false ) : current_time( 's' );
$cur_jj = current_time( 'd' );
$cur_mm = current_time( 'm' );
$cur_aa = current_time( 'Y' );
$cur_hh = current_time( 'H' );
$cur_mn = current_time( 'i' );
$month = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
'</span><select class="form-required" ' . ( $multi ? '' : 'id="mm" ' ) . 'name="mm"' . $tab_index_attribute . ">\n";
for ( $i = 1; $i < 13; $i = $i + 1 ) {
$monthnum = zeroise( $i, 2 );
$monthtext = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
$month .= "\t\t\t" . '<option value="' . $monthnum . '" data-text="' . $monthtext . '" ' . selected( $monthnum, $mm, false ) . '>';
/* translators: 1: Month number (01, 02, etc.), 2: Month abbreviation. */
$month .= sprintf( __( '%1$s-%2$s' ), $monthnum, $monthtext ) . "</option>\n";
$month .= '</select></label>';
$day = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
'</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
$year = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
'</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
$hour = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
'</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
$minute = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
'</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
echo '<div class="timestamp-wrap">';
/* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
printf( __( '%1$s %2$s, %3$s at %4$s:%5$s' ), $month, $day, $year, $hour, $minute );
echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
'mm' => array( $mm, $cur_mm ),
'jj' => array( $jj, $cur_jj ),
'aa' => array( $aa, $cur_aa ),
'hh' => array( $hh, $cur_hh ),
'mn' => array( $mn, $cur_mn ),
foreach ( $map as $timeunit => $value ) {
list( $unit, $curr ) = $value;
echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $unit . '" />' . "\n";
$cur_timeunit = 'cur_' . $timeunit;
echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e( 'OK' ); ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
* Prints out option HTML elements for the page templates drop-down.
* @since 4.7.0 Added the `$post_type` parameter.
* @param string $default_template Optional. The template file name. Default empty.
* @param string $post_type Optional. Post type to get templates for. Default 'page'.
function page_template_dropdown( $default_template = '', $post_type = 'page' ) {
$templates = get_page_templates( null, $post_type );
foreach ( array_keys( $templates ) as $template ) {
$selected = selected( $default_template, $templates[ $template ], false );
echo "\n\t<option value='" . esc_attr( $templates[ $template ] ) . "' $selected>" . esc_html( $template ) . '</option>';
* Prints out option HTML elements for the page parents drop-down.
* @since 4.4.0 `$post` argument was added.
* @global wpdb $wpdb WordPress database abstraction object.
* @param int $default_page Optional. The default page ID to be pre-selected. Default 0.
* @param int $parent_page Optional. The parent page ID. Default 0.
* @param int $level Optional. Page depth level. Default 0.
* @param int|WP_Post $post Post ID or WP_Post object.
* @return void|false Void on success, false if the page has no children.
function parent_dropdown( $default_page = 0, $parent_page = 0, $level = 0, $post = null ) {
$post = get_post( $post );
$items = $wpdb->get_results(
"SELECT ID, post_parent, post_title
WHERE post_parent = %d AND post_type = 'page'
foreach ( $items as $item ) {
// A page cannot be its own parent.
if ( $post && $post->ID && (int) $item->ID === $post->ID ) {
$pad = str_repeat( ' ', $level * 3 );
$selected = selected( $default_page, $item->ID, false );
echo "\n\t<option class='level-$level' value='$item->ID' $selected>$pad " . esc_html( $item->post_title ) . '</option>';
parent_dropdown( $default_page, $item->ID, $level + 1 );
* Prints out option HTML elements for role selectors.
* @param string $selected Slug for the role that should be already selected.
function wp_dropdown_roles( $selected = '' ) {
$editable_roles = array_reverse( get_editable_roles() );
foreach ( $editable_roles as $role => $details ) {
$name = translate_user_role( $details['name'] );
// Preselect specified role.
if ( $selected === $role ) {
$r .= "\n\t<option selected='selected' value='" . esc_attr( $role ) . "'>$name</option>";
$r .= "\n\t<option value='" . esc_attr( $role ) . "'>$name</option>";
* Outputs the form used by the importers to accept the data to be imported.
* @param string $action The action attribute for the form.