' . __( 'This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they will not all fit here! :) Use the documentation links to get information on what each discussion setting does.' ) . '
' .
'
' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '
PK (Z3vri i options-media.phpnu [ ' . __( 'You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.' ) . '';
if ( ! is_multisite()
&& ( get_option( 'upload_url_path' )
|| get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) )
) {
$media_options_help .= '
' . __( 'Uploading Files allows you to choose the folder and path for storing your uploaded files.' ) . '
';
}
$media_options_help .= '
' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '
PK (Z' ' post.phpnu [ post_type;
$post_type_object = get_post_type_object( $post_type );
}
if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) {
wp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 );
}
if ( isset( $_POST['deletepost'] ) ) {
$action = 'delete';
} elseif ( isset( $_POST['wp-preview'] ) && 'dopreview' === $_POST['wp-preview'] ) {
$action = 'preview';
}
$sendback = wp_get_referer();
if ( ! $sendback ||
str_contains( $sendback, 'post.php' ) ||
str_contains( $sendback, 'post-new.php' ) ) {
if ( 'attachment' === $post_type ) {
$sendback = admin_url( 'upload.php' );
} else {
$sendback = admin_url( 'edit.php' );
if ( ! empty( $post_type ) ) {
$sendback = add_query_arg( 'post_type', $post_type, $sendback );
}
}
} else {
$sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), $sendback );
}
switch ( $action ) {
case 'post-quickdraft-save':
// Check nonce and capabilities.
$nonce = $_REQUEST['_wpnonce'];
$error_msg = false;
// For output of the Quick Draft dashboard widget.
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) {
$error_msg = __( 'Unable to submit this form, please refresh and try again.' );
}
if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) {
exit;
}
if ( $error_msg ) {
return wp_dashboard_quick_press( $error_msg );
}
$post = get_post( $_REQUEST['post_ID'] );
check_admin_referer( 'add-' . $post->post_type );
$_POST['comment_status'] = get_default_comment_status( $post->post_type );
$_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' );
// Wrap Quick Draft content in the Paragraph block.
if ( ! str_contains( $_POST['content'], '' ) ) {
$_POST['content'] = sprintf(
'%s',
str_replace( array( "\r\n", "\r", "\n" ), ' ', $_POST['content'] )
);
}
edit_post();
wp_dashboard_quick_press();
exit;
case 'postajaxpost':
case 'post':
check_admin_referer( 'add-' . $post_type );
$post_id = 'postajaxpost' === $action ? edit_post() : write_post();
redirect_post( $post_id );
exit;
case 'edit':
$editing = true;
if ( empty( $post_id ) ) {
wp_redirect( admin_url( 'post.php' ) );
exit;
}
if ( ! $post ) {
wp_die( __( 'You attempted to edit an item that does not exist. Perhaps it was deleted?' ) );
}
if ( ! $post_type_object ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ), true ) ) {
wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this item.' ) );
}
if ( 'trash' === $post->post_status ) {
wp_die( __( 'You cannot edit this item because it is in the Trash. Please restore it and try again.' ) );
}
if ( ! empty( $_GET['get-post-lock'] ) ) {
check_admin_referer( 'lock-post_' . $post_id );
wp_set_post_lock( $post_id );
wp_redirect( get_edit_post_link( $post_id, 'url' ) );
exit;
}
$post_type = $post->post_type;
if ( 'post' === $post_type ) {
$parent_file = 'edit.php';
$submenu_file = 'edit.php';
$post_new_file = 'post-new.php';
} elseif ( 'attachment' === $post_type ) {
$parent_file = 'upload.php';
$submenu_file = 'upload.php';
$post_new_file = 'media-new.php';
} else {
if ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) {
$parent_file = $post_type_object->show_in_menu;
} else {
$parent_file = "edit.php?post_type=$post_type";
}
$submenu_file = "edit.php?post_type=$post_type";
$post_new_file = "post-new.php?post_type=$post_type";
}
$title = $post_type_object->labels->edit_item;
/**
* Allows replacement of the editor.
*
* @since 4.9.0
*
* @param bool $replace Whether to replace the editor. Default false.
* @param WP_Post $post Post object.
*/
if ( true === apply_filters( 'replace_editor', false, $post ) ) {
break;
}
if ( use_block_editor_for_post( $post ) ) {
require ABSPATH . 'wp-admin/edit-form-blocks.php';
break;
}
if ( ! wp_check_post_lock( $post->ID ) ) {
$active_post_lock = wp_set_post_lock( $post->ID );
if ( 'attachment' !== $post_type ) {
wp_enqueue_script( 'autosave' );
}
}
$post = get_post( $post_id, OBJECT, 'edit' );
if ( post_type_supports( $post_type, 'comments' ) ) {
wp_enqueue_script( 'admin-comments' );
enqueue_comment_hotkeys_js();
}
require ABSPATH . 'wp-admin/edit-form-advanced.php';
break;
case 'editattachment':
check_admin_referer( 'update-post_' . $post_id );
// Don't let these be changed.
unset( $_POST['guid'] );
$_POST['post_type'] = 'attachment';
// Update the thumbnail filename.
$newmeta = wp_get_attachment_metadata( $post_id, true );
$newmeta['thumb'] = wp_basename( $_POST['thumb'] );
wp_update_attachment_metadata( $post_id, $newmeta );
// Intentional fall-through to trigger the edit_post() call.
case 'editpost':
check_admin_referer( 'update-post_' . $post_id );
$post_id = edit_post();
// Session cookie flag that the post was saved.
if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {
setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() );
}
redirect_post( $post_id ); // Send user on their way while we keep working.
exit;
case 'trash':
check_admin_referer( 'trash-post_' . $post_id );
if ( ! $post ) {
wp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );
}
if ( ! $post_type_object ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! current_user_can( 'delete_post', $post_id ) ) {
wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) );
}
$user_id = wp_check_post_lock( $post_id );
if ( $user_id ) {
$user = get_userdata( $user_id );
/* translators: %s: User's display name. */
wp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );
}
if ( ! wp_trash_post( $post_id ) ) {
wp_die( __( 'Error in moving the item to Trash.' ) );
}
wp_redirect(
add_query_arg(
array(
'trashed' => 1,
'ids' => $post_id,
),
$sendback
)
);
exit;
case 'untrash':
check_admin_referer( 'untrash-post_' . $post_id );
if ( ! $post ) {
wp_die( __( 'The item you are trying to restore from the Trash no longer exists.' ) );
}
if ( ! $post_type_object ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! current_user_can( 'delete_post', $post_id ) ) {
wp_die( __( 'Sorry, you are not allowed to restore this item from the Trash.' ) );
}
if ( ! wp_untrash_post( $post_id ) ) {
wp_die( __( 'Error in restoring the item from Trash.' ) );
}
$sendback = add_query_arg(
array(
'untrashed' => 1,
'ids' => $post_id,
),
$sendback
);
wp_redirect( $sendback );
exit;
case 'delete':
check_admin_referer( 'delete-post_' . $post_id );
if ( ! $post ) {
wp_die( __( 'This item has already been deleted.' ) );
}
if ( ! $post_type_object ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! current_user_can( 'delete_post', $post_id ) ) {
wp_die( __( 'Sorry, you are not allowed to delete this item.' ) );
}
if ( 'attachment' === $post->post_type ) {
$force = ( ! MEDIA_TRASH );
if ( ! wp_delete_attachment( $post_id, $force ) ) {
wp_die( __( 'Error in deleting the attachment.' ) );
}
} else {
if ( ! wp_delete_post( $post_id, true ) ) {
wp_die( __( 'Error in deleting the item.' ) );
}
}
wp_redirect( add_query_arg( 'deleted', 1, $sendback ) );
exit;
case 'preview':
check_admin_referer( 'update-post_' . $post_id );
$url = post_preview();
wp_redirect( $url );
exit;
case 'toggle-custom-fields':
check_admin_referer( 'toggle-custom-fields', 'toggle-custom-fields-nonce' );
$current_user_id = get_current_user_id();
if ( $current_user_id ) {
$enable_custom_fields = (bool) get_user_meta( $current_user_id, 'enable_custom_fields', true );
update_user_meta( $current_user_id, 'enable_custom_fields', ! $enable_custom_fields );
}
wp_safe_redirect( wp_get_referer() );
exit;
default:
/**
* Fires for a given custom post action request.
*
* The dynamic portion of the hook name, `$action`, refers to the custom post action.
*
* @since 4.6.0
*
* @param int $post_id Post ID sent with the request.
*/
do_action( "post_action_{$action}", $post_id );
wp_redirect( admin_url( 'edit.php' ) );
exit;
} // End switch.
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK (ZE E setup-config.phpnu [ wp-config-sample.php'
)
);
}
// Check if wp-config.php has been created.
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
wp_die(
'
' . sprintf(
/* translators: 1: wp-config.php, 2: install.php */
__( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php',
'install.php'
) . '
',
409
);
}
// Check if wp-config.php exists above the root directory but is not part of another installation.
if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) {
wp_die(
'
' . sprintf(
/* translators: 1: wp-config.php, 2: install.php */
__( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try installing now.' ),
'wp-config.php',
'install.php'
) . '
',
409
);
}
$step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1;
/**
* Display setup wp-config.php file header.
*
* @ignore
* @since 2.3.0
*
* @param string|string[] $body_classes Class attribute values for the body tag.
*/
function setup_config_display_header( $body_classes = array() ) {
$body_classes = (array) $body_classes;
$body_classes[] = 'wp-core-ui';
$dir_attr = '';
if ( is_rtl() ) {
$body_classes[] = 'rtl';
$dir_attr = ' dir="rtl"';
}
header( 'Content-Type: text/html; charset=utf-8' );
?>
>
Select a default language';
echo '';
break;
}
}
// Deliberately fall through if we can't reach the translations API.
case 0:
if ( ! empty( $language ) ) {
$loaded_language = wp_download_language_pack( $language );
if ( $loaded_language ) {
load_default_textdomain( $loaded_language );
$GLOBALS['wp_locale'] = new WP_Locale();
}
}
setup_config_display_header();
$step_1 = 'setup-config.php?step=1';
if ( isset( $_REQUEST['noapi'] ) ) {
$step_1 .= '&noapi';
}
if ( ! empty( $loaded_language ) ) {
$step_1 .= '&language=' . $loaded_language;
}
?>
wp-config.php'
);
?>
wp-config-sample.php',
'wp-config.php'
);
?>
Read the support article on %2$s.' ),
__( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ),
'wp-config.php'
);
?>
' . __( 'Try Again' ) . '';
if ( empty( $prefix ) ) {
wp_die( __( 'Error: "Table Prefix" must not be empty.' ) . $tryagain_link );
}
// Validate $prefix: it can only contain letters, numbers and underscores.
if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) {
wp_die( __( 'Error: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link );
}
// Test the DB connection.
/**#@+
*
* @ignore
*/
define( 'DB_NAME', $dbname );
define( 'DB_USER', $uname );
define( 'DB_PASSWORD', $pwd );
define( 'DB_HOST', $dbhost );
/**#@-*/
// Re-construct $wpdb with these new values.
unset( $wpdb );
require_wp_db();
/*
* The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must
* fire this manually. We'll fail here if the values are no good.
*/
$wpdb->db_connect();
if ( ! empty( $wpdb->error ) ) {
wp_die( $wpdb->error->get_error_message() . $tryagain_link );
}
$errors = $wpdb->suppress_errors();
$wpdb->query( "SELECT $prefix" );
$wpdb->suppress_errors( $errors );
if ( ! $wpdb->last_error ) {
// MySQL was able to parse the prefix as a value, which we don't want. Bail.
wp_die( __( 'Error: "Table Prefix" is invalid.' ) );
}
// Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password().
try {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
$max = strlen( $chars ) - 1;
for ( $i = 0; $i < 8; $i++ ) {
$key = '';
for ( $j = 0; $j < 64; $j++ ) {
$key .= substr( $chars, random_int( 0, $max ), 1 );
}
$secret_keys[] = $key;
}
} catch ( Exception $ex ) {
$no_api = isset( $_POST['noapi'] );
if ( ! $no_api ) {
$secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
}
if ( $no_api || is_wp_error( $secret_keys ) ) {
$secret_keys = array();
for ( $i = 0; $i < 8; $i++ ) {
$secret_keys[] = wp_generate_password( 64, true, true );
}
} else {
$secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) );
foreach ( $secret_keys as $k => $v ) {
$secret_keys[ $k ] = substr( $v, 28, 64 );
}
}
}
$key = 0;
foreach ( $config_file as $line_num => $line ) {
if ( str_starts_with( $line, '$table_prefix =' ) ) {
$config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
continue;
}
if ( ! preg_match( '/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) {
continue;
}
$constant = $match[1];
$padding = $match[2];
switch ( $constant ) {
case 'DB_NAME':
case 'DB_USER':
case 'DB_PASSWORD':
case 'DB_HOST':
$config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n";
break;
case 'DB_CHARSET':
if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset ) ) {
$config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n";
}
break;
case 'AUTH_KEY':
case 'SECURE_AUTH_KEY':
case 'LOGGED_IN_KEY':
case 'NONCE_KEY':
case 'AUTH_SALT':
case 'SECURE_AUTH_SALT':
case 'LOGGED_IN_SALT':
case 'NONCE_SALT':
$config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . $secret_keys[ $key++ ] . "' );\r\n";
break;
}
}
unset( $line );
if ( ! is_writable( ABSPATH ) ) :
setup_config_display_header();
?>
');
val = $('.name', rowData);
val.find( 'img' ).replaceWith( function() { return this.alt; } );
val = val.text();
$(':input[name="name"]', editRow).val( val );
val = $('.slug', rowData);
val.find( 'img' ).replaceWith( function() { return this.alt; } );
val = val.text();
$(':input[name="slug"]', editRow).val( val );
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
$('.ptitle', editRow).eq(0).trigger( 'focus' );
return false;
},
/**
* Saves the quick edit data.
*
* Saves the quick edit data to the server and replaces the table row with the
* HTML retrieved from the server.
*
* @since 2.7.0
*
* @this inlineEditTax
* @memberof inlineEditTax
*
* @param {string|HTMLElement} id The ID of the term we want to quick edit or an
* element within the table row or the
* table row itself.
* @return {boolean} Always returns false.
*/
save : function(id) {
var params, fields, tax = $('input[name="taxonomy"]').val() || '';
// Makes sure we can pass an HTMLElement as the ID.
if( typeof(id) === 'object' ) {
id = this.getId(id);
}
$( 'table.widefat .spinner' ).addClass( 'is-active' );
params = {
action: 'inline-save-tax',
tax_type: this.type,
tax_ID: id,
taxonomy: tax
};
fields = $('#edit-'+id).find(':input').serialize();
params = fields + '&' + $.param(params);
// Do the Ajax request to save the data to the server.
$.post( ajaxurl, params,
/**
* Handles the response from the server
*
* Handles the response from the server, replaces the table row with the response
* from the server.
*
* @param {string} r The string with which to replace the table row.
*/
function(r) {
var row, new_id, option_value,
$errorNotice = $( '#edit-' + id + ' .inline-edit-save .notice-error' ),
$error = $errorNotice.find( '.error' );
$( 'table.widefat .spinner' ).removeClass( 'is-active' );
if (r) {
if ( -1 !== r.indexOf( '