File manager - Edit - /home/u478019808/domains/bestandroidphones.store/public_html/static/img/logo/wp-admin.tar
Back
privacy.php 0000644 00000004756 15024324530 0006744 0 ustar 00 <?php /** * Privacy administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; // Used in the HTML title tag. $title = __( 'Privacy' ); list( $display_version ) = explode( '-', get_bloginfo( 'version' ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap about__container"> <div class="about__header"> <div class="about__header-title"> <h1> <?php _e( 'Privacy' ); ?> </h1> </div> <div class="about__header-text"> <?php _e( 'We take privacy and transparency very seriously' ); ?> </div> </div> <nav class="about__header-navigation nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> <a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a> <a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a> <a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a> <a href="privacy.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Privacy' ); ?></a> <a href="contribute.php" class="nav-tab"><?php _e( 'Get Involved' ); ?></a> </nav> <div class="about__section has-2-columns is-wider-right"> <div class="column about__image"> <img class="privacy-image" src="<?php echo esc_url( admin_url( 'images/privacy.svg?ver=6.5' ) ); ?>" alt="" /> </div> <div class="column is-vertically-aligned-center"> <p><?php _e( 'From time to time, your WordPress site may send data to WordPress.org — including, but not limited to — the version you are using, and a list of installed plugins and themes.' ); ?></p> <p> <?php printf( /* translators: %s: https://wordpress.org/about/stats/ */ __( 'This data is used to provide general enhancements to WordPress, which includes helping to protect your site by finding and automatically installing new updates. It is also used to calculate statistics, such as those shown on the <a href="%s">WordPress.org stats page</a>.' ), __( 'https://wordpress.org/about/stats/' ) ); ?> </p> <p> <?php printf( /* translators: %s: https://wordpress.org/about/privacy/ */ __( 'We take privacy and transparency very seriously. To learn more about what data we collect, and how we use it, please visit <a href="%s">our Privacy Policy</a>.' ), __( 'https://wordpress.org/about/privacy/' ) ); ?> </p> </div> </div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> options.php 0000644 00000032710 15024324530 0006751 0 ustar 00 <?php /** * Options Management Administration Screen. * * If accessed directly in a browser this page shows a list of all saved options * along with editable fields for their values. Serialized data is not supported * and there is no way to remove options via this page. It is not linked to from * anywhere else in the admin. * * This file is also the target of the forms in core and custom options pages * that use the Settings API. In this case it saves the new option values * and returns the user to their page of origin. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; // Used in the HTML title tag. $title = __( 'Settings' ); $this_file = 'options.php'; $parent_file = 'options-general.php'; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; $option_page = ! empty( $_REQUEST['option_page'] ) ? sanitize_text_field( $_REQUEST['option_page'] ) : ''; $capability = 'manage_options'; // This is for back compat and will eventually be removed. if ( empty( $option_page ) ) { $option_page = 'options'; } else { /** * Filters the capability required when using the Settings API. * * By default, the options groups for all registered settings require the manage_options capability. * This filter is required to change the capability required for a certain options page. * * @since 3.2.0 * * @param string $capability The capability used for the page, which is manage_options by default. */ $capability = apply_filters( "option_page_capability_{$option_page}", $capability ); } if ( ! current_user_can( $capability ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to manage options for this site.' ) . '</p>', 403 ); } // Handle admin email change requests. if ( ! empty( $_GET['adminhash'] ) ) { $new_admin_details = get_option( 'adminhash' ); $redirect = 'options-general.php?updated=false'; if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash'], $_GET['adminhash'] ) && ! empty( $new_admin_details['newemail'] ) ) { update_option( 'admin_email', $new_admin_details['newemail'] ); delete_option( 'adminhash' ); delete_option( 'new_admin_email' ); $redirect = 'options-general.php?updated=true'; } wp_redirect( admin_url( $redirect ) ); exit; } elseif ( ! empty( $_GET['dismiss'] ) && 'new_admin_email' === $_GET['dismiss'] ) { check_admin_referer( 'dismiss-' . get_current_blog_id() . '-new_admin_email' ); delete_option( 'adminhash' ); delete_option( 'new_admin_email' ); wp_redirect( admin_url( 'options-general.php?updated=true' ) ); exit; } if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update' !== $action ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to delete these items.' ) . '</p>', 403 ); } $allowed_options = array( 'general' => array( 'blogname', 'blogdescription', 'site_icon', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string', 'WPLANG', 'new_admin_email', ), 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_previously_approved', 'comment_max_links', 'moderation_keys', 'disallowed_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration', 'show_comments_cookies_opt_in', ), 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', ), 'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'show_on_front', 'page_on_front', 'page_for_posts', 'blog_public', ), 'writing' => array( 'default_category', 'default_email_category', 'default_link_category', 'default_post_format', ), ); $allowed_options['misc'] = array(); $allowed_options['options'] = array(); $allowed_options['privacy'] = array(); /** * Filters whether the post-by-email functionality is enabled. * * @since 3.0.0 * * @param bool $enabled Whether post-by-email configuration is enabled. Default true. */ if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { $allowed_options['writing'][] = 'mailserver_url'; $allowed_options['writing'][] = 'mailserver_port'; $allowed_options['writing'][] = 'mailserver_login'; $allowed_options['writing'][] = 'mailserver_pass'; } if ( ! is_utf8_charset() ) { $allowed_options['reading'][] = 'blog_charset'; } if ( get_site_option( 'initial_db_version' ) < 32453 ) { $allowed_options['writing'][] = 'use_smilies'; $allowed_options['writing'][] = 'use_balanceTags'; } if ( ! is_multisite() ) { if ( ! defined( 'WP_SITEURL' ) ) { $allowed_options['general'][] = 'siteurl'; } if ( ! defined( 'WP_HOME' ) ) { $allowed_options['general'][] = 'home'; } $allowed_options['general'][] = 'users_can_register'; $allowed_options['general'][] = 'default_role'; if ( '1' === get_option( 'blog_public' ) ) { $allowed_options['writing'][] = 'ping_sites'; } $allowed_options['media'][] = 'uploads_use_yearmonth_folders'; /* * If upload_url_path is not the default (empty), * or upload_path is not the default ('wp-content/uploads' or empty), * they can be edited, otherwise they're locked. */ if ( get_option( 'upload_url_path' ) || get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) ) { $allowed_options['media'][] = 'upload_path'; $allowed_options['media'][] = 'upload_url_path'; } } /** * Filters the allowed options list. * * @since 2.7.0 * @deprecated 5.5.0 Use {@see 'allowed_options'} instead. * * @param array $allowed_options The allowed options list. */ $allowed_options = apply_filters_deprecated( 'whitelist_options', array( $allowed_options ), '5.5.0', 'allowed_options', __( 'Please consider writing more inclusive code.' ) ); /** * Filters the allowed options list. * * @since 5.5.0 * * @param array $allowed_options The allowed options list. */ $allowed_options = apply_filters( 'allowed_options', $allowed_options ); if ( 'update' === $action ) { // We are saving settings sent from a settings page. if ( 'options' === $option_page && ! isset( $_POST['option_page'] ) ) { // This is for back compat and will eventually be removed. $unregistered = true; check_admin_referer( 'update-options' ); } else { $unregistered = false; check_admin_referer( $option_page . '-options' ); } if ( ! isset( $allowed_options[ $option_page ] ) ) { wp_die( sprintf( /* translators: %s: The options page name. */ __( '<strong>Error:</strong> The %s options page is not in the allowed options list.' ), '<code>' . esc_html( $option_page ) . '</code>' ) ); } if ( 'options' === $option_page ) { if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) { wp_die( __( 'Sorry, you are not allowed to modify unregistered settings for this site.' ) ); } $options = isset( $_POST['page_options'] ) ? explode( ',', wp_unslash( $_POST['page_options'] ) ) : null; } else { $options = $allowed_options[ $option_page ]; } if ( 'general' === $option_page ) { // Handle custom date/time formats. if ( ! empty( $_POST['date_format'] ) && isset( $_POST['date_format_custom'] ) && '\c\u\s\t\o\m' === wp_unslash( $_POST['date_format'] ) ) { $_POST['date_format'] = $_POST['date_format_custom']; } if ( ! empty( $_POST['time_format'] ) && isset( $_POST['time_format_custom'] ) && '\c\u\s\t\o\m' === wp_unslash( $_POST['time_format'] ) ) { $_POST['time_format'] = $_POST['time_format_custom']; } // Map UTC+- timezones to gmt_offsets and set timezone_string to empty. if ( ! empty( $_POST['timezone_string'] ) && preg_match( '/^UTC[+-]/', $_POST['timezone_string'] ) ) { $_POST['gmt_offset'] = $_POST['timezone_string']; $_POST['gmt_offset'] = preg_replace( '/UTC\+?/', '', $_POST['gmt_offset'] ); $_POST['timezone_string'] = ''; } elseif ( isset( $_POST['timezone_string'] ) && ! in_array( $_POST['timezone_string'], timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) { // Reset to the current value. $current_timezone_string = get_option( 'timezone_string' ); if ( ! empty( $current_timezone_string ) ) { $_POST['timezone_string'] = $current_timezone_string; } else { $_POST['gmt_offset'] = get_option( 'gmt_offset' ); $_POST['timezone_string'] = ''; } add_settings_error( 'general', 'settings_updated', __( 'The timezone you have entered is not valid. Please select a valid timezone.' ), 'error' ); } // Handle translation installation. if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) { require_once ABSPATH . 'wp-admin/includes/translation-install.php'; if ( wp_can_install_language_pack() ) { $language = wp_download_language_pack( $_POST['WPLANG'] ); if ( $language ) { $_POST['WPLANG'] = $language; } } } } if ( $options ) { $user_language_old = get_user_locale(); foreach ( $options as $option ) { if ( $unregistered ) { _deprecated_argument( 'options.php', '2.7.0', sprintf( /* translators: 1: The option/setting, 2: Documentation URL. */ __( 'The %1$s setting is unregistered. Unregistered settings are deprecated. See <a href="%2$s">documentation on the Settings API</a>.' ), '<code>' . esc_html( $option ) . '</code>', __( 'https://developer.wordpress.org/plugins/settings/settings-api/' ) ) ); } $option = trim( $option ); $value = null; if ( isset( $_POST[ $option ] ) ) { $value = $_POST[ $option ]; if ( ! is_array( $value ) ) { $value = trim( $value ); } $value = wp_unslash( $value ); } update_option( $option, $value ); } /* * Switch translation in case WPLANG was changed. * The global $locale is used in get_locale() which is * used as a fallback in get_user_locale(). */ unset( $GLOBALS['locale'] ); $user_language_new = get_user_locale(); if ( $user_language_old !== $user_language_new ) { load_default_textdomain( $user_language_new ); } } else { add_settings_error( 'general', 'settings_updated', __( 'Settings save failed.' ), 'error' ); } /* * Handle settings errors and return to options page. */ // If no settings errors were registered add a general 'updated' message. if ( ! count( get_settings_errors() ) ) { add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); } set_transient( 'settings_errors', get_settings_errors(), 30 ); // 30 seconds. // Redirect back to the settings page that was submitted. $goback = add_query_arg( 'settings-updated', 'true', wp_get_referer() ); wp_redirect( $goback ); exit; } require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php esc_html_e( 'All Settings' ); ?></h1> <?php wp_admin_notice( '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ), array( 'type' => 'warning', ) ); ?> <form name="form" action="options.php" method="post" id="all-options"> <?php wp_nonce_field( 'options-options' ); ?> <input type="hidden" name="action" value="update" /> <input type="hidden" name="option_page" value="options" /> <table class="form-table" role="presentation"> <?php $options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" ); foreach ( (array) $options as $option ) : $disabled = false; if ( '' === $option->option_name ) { continue; } if ( is_serialized( $option->option_value ) ) { if ( is_serialized_string( $option->option_value ) ) { // This is a serialized string, so we should display it. $value = maybe_unserialize( $option->option_value ); $options_to_update[] = $option->option_name; $class = 'all-options'; } else { $value = 'SERIALIZED DATA'; $disabled = true; $class = 'all-options disabled'; } } else { $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 require_once ABSPATH . 'wp-admin/admin-footer.php'; edit-form-comment.php 0000644 00000020540 15024324530 0010602 0 ustar 00 <?php /** * Edit comment form for inclusion in another file. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * @global WP_Comment $comment Global comment object. */ global $comment; ?> <form name="post" action="comment.php" method="post" id="post"> <?php wp_nonce_field( 'update-comment_' . $comment->comment_ID ); ?> <div class="wrap"> <h1><?php _e( 'Edit Comment' ); ?></h1> <div id="poststuff"> <input type="hidden" name="action" value="editedcomment" /> <input type="hidden" name="comment_ID" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> <input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" /> <div id="post-body" class="metabox-holder columns-2"> <div id="post-body-content" class="edit-form-section edit-comment-section"> <?php if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) : $comment_link = get_comment_link( $comment ); ?> <div class="inside"> <div id="comment-link-box"> <strong><?php _ex( 'Permalink:', 'comment' ); ?></strong> <span id="sample-permalink"> <a href="<?php echo esc_url( $comment_link ); ?>"> <?php echo esc_html( $comment_link ); ?> </a> </span> </div> </div> <?php endif; ?> <div id="namediv" class="stuffbox"> <div class="inside"> <h2 class="edit-comment-author"><?php _e( 'Author' ); ?></h2> <fieldset> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Comment Author' ); ?> </legend> <table class="form-table editcomment" role="presentation"> <tbody> <tr> <td class="first"><label for="name"><?php _e( 'Name' ); ?></label></td> <td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" id="name" /></td> </tr> <tr> <td class="first"><label for="email"><?php _e( 'Email' ); ?></label></td> <td> <input type="text" name="newcomment_author_email" size="30" value="<?php echo esc_attr( $comment->comment_author_email ); ?>" id="email" /> </td> </tr> <tr> <td class="first"><label for="newcomment_author_url"><?php _e( 'URL' ); ?></label></td> <td> <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr( $comment->comment_author_url ); ?>" /> </td> </tr> </tbody> </table> </fieldset> </div> </div> <div id="postdiv" class="postarea"> <label for="content" class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Comment' ); ?> </label> <?php $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' ); wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings, ) ); wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> </div> </div><!-- /post-body-content --> <div id="postbox-container-1" class="postbox-container"> <div id="submitdiv" class="stuffbox" > <h2><?php _e( 'Save' ); ?></h2> <div class="inside"> <div class="submitbox" id="submitcomment"> <div id="minor-publishing"> <div id="misc-publishing-actions"> <div class="misc-pub-section misc-pub-comment-status" id="comment-status"> <?php _e( 'Status:' ); ?> <span id="comment-status-display"> <?php switch ( $comment->comment_approved ) { case '1': _e( 'Approved' ); break; case '0': _e( 'Pending' ); break; case 'spam': _e( 'Spam' ); break; } ?> </span> <fieldset id="comment-status-radio"> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Comment status' ); ?> </legend> <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _ex( 'Approved', 'comment status' ); ?></label><br /> <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _ex( 'Pending', 'comment status' ); ?></label><br /> <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _ex( 'Spam', 'comment status' ); ?></label> </fieldset> </div><!-- .misc-pub-section --> <div class="misc-pub-section curtime misc-pub-curtime"> <?php $submitted = sprintf( /* translators: 1: Comment date, 2: Comment time. */ __( '%1$s at %2$s' ), /* translators: Publish box date format, see https://www.php.net/manual/datetime.format.php */ date_i18n( _x( 'M j, Y', 'publish box date format' ), strtotime( $comment->comment_date ) ), /* translators: Publish box time format, see https://www.php.net/manual/datetime.format.php */ date_i18n( _x( 'H:i', 'publish box time format' ), strtotime( $comment->comment_date ) ) ); ?> <span id="timestamp"> <?php /* translators: %s: Comment date. */ printf( __( 'Submitted on: %s' ), '<b>' . $submitted . '</b>' ); ?> </span> <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Edit date and time' ); ?> </span></a> <fieldset id='timestampdiv' class='hide-if-js'> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Date and time' ); ?> </legend> <?php /** * @global string $action */ global $action; touch_time( ( 'editcomment' === $action ), 0 ); ?> </fieldset> </div> <?php $post_id = $comment->comment_post_ID; if ( current_user_can( 'edit_post', $post_id ) ) { $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>"; $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>'; } else { $post_link = esc_html( get_the_title( $post_id ) ); } ?> <div class="misc-pub-section misc-pub-response-to"> <?php printf( /* translators: %s: Post link. */ __( 'In response to: %s' ), '<b>' . $post_link . '</b>' ); ?> </div> <?php if ( $comment->comment_parent ) : $parent = get_comment( $comment->comment_parent ); if ( $parent ) : $parent_link = esc_url( get_comment_link( $parent ) ); $name = get_comment_author( $parent ); ?> <div class="misc-pub-section misc-pub-reply-to"> <?php printf( /* translators: %s: Comment link. */ __( 'In reply to: %s' ), '<b><a href="' . $parent_link . '">' . $name . '</a></b>' ); ?> </div> <?php endif; endif; ?> <?php /** * Filters miscellaneous actions for the edit comment form sidebar. * * @since 4.3.0 * * @param string $html Output HTML to display miscellaneous action. * @param WP_Comment $comment Current comment object. */ echo apply_filters( 'edit_comment_misc_actions', '', $comment ); ?> </div> <!-- misc actions --> <div class="clear"></div> </div> <div id="major-publishing-actions"> <div id="delete-action"> <?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url( 'comment.php?action=' . ( ! EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode( wp_get_referer() ), 'delete-comment_' . $comment->comment_ID ) . "'>" . ( ! EMPTY_TRASH_DAYS ? __( 'Delete Permanently' ) : __( 'Move to Trash' ) ) . "</a>\n"; ?> </div> <div id="publishing-action"> <?php submit_button( __( 'Update' ), 'primary large', 'save', false ); ?> </div> <div class="clear"></div> </div> </div> </div> </div><!-- /submitdiv --> </div> <div id="postbox-container-2" class="postbox-container"> <?php /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'add_meta_boxes', 'comment', $comment ); /** * Fires when comment-specific meta boxes are added. * * @since 3.0.0 * * @param WP_Comment $comment Comment object. */ do_action( 'add_meta_boxes_comment', $comment ); do_meta_boxes( null, 'normal', $comment ); $referer = wp_get_referer(); ?> </div> <input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> <input type="hidden" name="p" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" /> <input name="referredby" type="hidden" id="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" /> <?php wp_original_referer_field( true, 'previous' ); ?> <input type="hidden" name="noredir" value="1" /> </div><!-- /post-body --> </div> </div> </form> <?php if ( ! wp_is_mobile() ) : ?> <script type="text/javascript"> try{document.post.name.focus();}catch(e){} </script> <?php endif; async-upload.php 0000644 00000011370 15024324530 0007654 0 ustar 00 <?php /** * Server-side file upload handler from wp-plupload or other asynchronous upload methods. * * @package WordPress * @subpackage Administration */ if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { define( 'DOING_AJAX', true ); } if ( ! defined( 'WP_ADMIN' ) ) { define( 'WP_ADMIN', true ); } if ( defined( 'ABSPATH' ) ) { require_once ABSPATH . 'wp-load.php'; } else { require_once dirname( __DIR__ ) . '/wp-load.php'; } require_once ABSPATH . 'wp-admin/admin.php'; header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) ); if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { require ABSPATH . 'wp-admin/includes/ajax-actions.php'; send_nosniff_header(); nocache_headers(); wp_ajax_upload_attachment(); die( '0' ); } if ( ! current_user_can( 'upload_files' ) ) { wp_die( __( 'Sorry, you are not allowed to upload files.' ) ); } // Just fetch the detail form for that attachment. if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) { $id = (int) $_REQUEST['attachment_id']; $post = get_post( $id ); if ( 'attachment' !== $post->post_type ) { wp_die( __( 'Invalid post type.' ) ); } switch ( $_REQUEST['fetch'] ) { case 3: ?> <div class="media-item-wrapper"> <div class="attachment-details"> <?php $thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true ); if ( $thumb_url ) { echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />'; } // Title shouldn't ever be empty, but use filename just in case. $file = get_attached_file( $post->ID ); $file_url = wp_get_attachment_url( $post->ID ); $title = $post->post_title ? $post->post_title : wp_basename( $file ); ?> <div class="filename new"> <span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '…' ) ); ?></strong></span> <span class="media-list-subtitle"><?php echo esc_html( wp_basename( $file ) ); ?></span> <div class="attachment-tools"> <?php if ( current_user_can( 'edit_post', $id ) ) { echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '">' . _x( 'Edit', 'media item' ) . '</a>'; } else { echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>'; } ?> <span class="media-item-copy-container copy-to-clipboard-container edit-attachment"> <button type="button" class="button button-small copy-attachment-url" data-clipboard-text="<?php echo esc_url( $file_url ); ?>" ><?php _e( 'Copy URL to clipboard' ); ?></button> <span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span> </span> </div> </div> </div> </div> <?php break; case 2: add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 ); echo get_media_item( $id, array( 'send' => false, 'delete' => true, ) ); break; default: add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); echo get_media_item( $id ); break; } exit; } check_admin_referer( 'media-form' ); $post_id = 0; if ( isset( $_REQUEST['post_id'] ) ) { $post_id = absint( $_REQUEST['post_id'] ); if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) { $post_id = 0; } } $id = media_handle_upload( 'async-upload', $post_id ); if ( is_wp_error( $id ) ) { $message = sprintf( '%s <strong>%s</strong><br />%s', sprintf( '<button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">%s</button>', __( 'Dismiss' ) ), sprintf( /* translators: %s: Name of the file that failed to upload. */ __( '“%s” has failed to upload.' ), esc_html( $_FILES['async-upload']['name'] ) ), esc_html( $id->get_error_message() ) ); wp_admin_notice( $message, array( 'additional_classes' => array( 'error-div', 'error' ), 'paragraph_wrap' => false, ) ); exit; } if ( $_REQUEST['short'] ) { // Short form response - attachment ID only. echo $id; } else { // Long form response - big chunk of HTML. $type = $_REQUEST['type']; /** * Filters the returned ID of an uploaded attachment. * * The dynamic portion of the hook name, `$type`, refers to the attachment type. * * Possible hook names include: * * - `async_upload_audio` * - `async_upload_file` * - `async_upload_image` * - `async_upload_video` * * @since 2.5.0 * * @param int $id Uploaded attachment ID. */ echo apply_filters( "async_upload_{$type}", $id ); } term.php 0000644 00000004311 15024324530 0006221 0 ustar 00 <?php /** * Edit Term Administration Screen. * * @package WordPress * @subpackage Administration * @since 4.5.0 */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( empty( $_REQUEST['tag_ID'] ) ) { $sendback = admin_url( 'edit-tags.php' ); if ( ! empty( $taxnow ) ) { $sendback = add_query_arg( array( 'taxonomy' => $taxnow ), $sendback ); } if ( 'post' !== get_current_screen()->post_type ) { $sendback = add_query_arg( 'post_type', get_current_screen()->post_type, $sendback ); } wp_redirect( sanitize_url( $sendback ) ); exit; } $tag_ID = absint( $_REQUEST['tag_ID'] ); $tag = get_term( $tag_ID, $taxnow, OBJECT, 'edit' ); if ( ! $tag instanceof WP_Term ) { wp_die( __( 'You attempted to edit an item that does not exist. Perhaps it was deleted?' ) ); } $tax = get_taxonomy( $tag->taxonomy ); $taxonomy = $tax->name; $title = $tax->labels->edit_item; if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ), true ) || ! current_user_can( 'edit_term', $tag->term_id ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>', 403 ); } $post_type = get_current_screen()->post_type; // Default to the first object_type associated with the taxonomy if no post type was passed. if ( empty( $post_type ) ) { $post_type = reset( $tax->object_type ); } if ( 'post' !== $post_type ) { $parent_file = ( 'attachment' === $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type"; $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; } elseif ( 'link_category' === $taxonomy ) { $parent_file = 'link-manager.php'; $submenu_file = 'edit-tags.php?taxonomy=link_category'; } else { $parent_file = 'edit.php'; $submenu_file = "edit-tags.php?taxonomy=$taxonomy"; } get_current_screen()->set_screen_reader_content( array( 'heading_pagination' => $tax->labels->items_list_navigation, 'heading_list' => $tax->labels->items_list, ) ); wp_enqueue_script( 'admin-tags' ); require_once ABSPATH . 'wp-admin/admin-header.php'; require ABSPATH . 'wp-admin/edit-tag-form.php'; require_once ABSPATH . 'wp-admin/admin-footer.php'; post.php 0000644 00000023741 15024324530 0006247 0 ustar 00 <?php /** * Edit post administration panel. * * Manage Post actions: post, edit, delete, etc. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; $parent_file = 'edit.php'; $submenu_file = 'edit.php'; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) { wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 ); } elseif ( isset( $_GET['post'] ) ) { $post_id = (int) $_GET['post']; } elseif ( isset( $_POST['post_ID'] ) ) { $post_id = (int) $_POST['post_ID']; } else { $post_id = 0; } $post_ID = $post_id; /** * @global string $post_type Global post type. * @global WP_Post_Type $post_type_object Global post type object. * @global WP_Post $post Global post object. */ global $post_type, $post_type_object, $post; if ( $post_id ) { $post = get_post( $post_id ); } if ( $post ) { $post_type = $post->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'], '<!-- wp:paragraph -->' ) ) { $_POST['content'] = sprintf( '<!-- wp:paragraph -->%s<!-- /wp:paragraph -->', str_replace( array( "\r\n", "\r", "\n" ), '<br />', $_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'; theme-install.php 0000644 00000056572 15024324530 0010040 0 ustar 00 <?php /** * Install theme administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/includes/theme-install.php'; $tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : ''; if ( ! current_user_can( 'install_themes' ) ) { wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) ); } if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'theme-install.php' ) ); exit; } // Used in the HTML title tag. $title = __( 'Add Themes' ); $parent_file = 'themes.php'; if ( ! is_network_admin() ) { $submenu_file = 'themes.php'; } $installed_themes = search_theme_directories(); if ( false === $installed_themes ) { $installed_themes = array(); } foreach ( $installed_themes as $theme_slug => $theme_data ) { // Ignore child themes. if ( str_contains( $theme_slug, '/' ) ) { unset( $installed_themes[ $theme_slug ] ); } } wp_localize_script( 'theme', '_wpThemeSettings', array( 'themes' => false, 'settings' => array( 'isInstall' => true, 'canInstall' => current_user_can( 'install_themes' ), 'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), ), 'l10n' => array( 'addNew' => __( 'Add New Theme' ), 'search' => __( 'Search Themes' ), 'upload' => __( 'Upload Theme' ), 'back' => __( 'Back' ), 'error' => sprintf( /* translators: %s: Support forums URL. */ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ), __( 'https://wordpress.org/support/forums/' ) ), 'tryAgain' => __( 'Try Again' ), /* translators: %d: Number of themes. */ 'themesFound' => __( 'Number of Themes found: %d' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ), 'collapseSidebar' => __( 'Collapse Sidebar' ), 'expandSidebar' => __( 'Expand Sidebar' ), /* translators: Hidden accessibility text. */ 'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ), ), 'installedThemes' => array_keys( $installed_themes ), 'activeTheme' => get_stylesheet(), ) ); wp_enqueue_script( 'theme' ); wp_enqueue_script( 'updates' ); if ( $tab ) { /** * Fires before each of the tabs are rendered on the Install Themes page. * * The dynamic portion of the hook name, `$tab`, refers to the current * theme installation tab. * * Possible hook names include: * * - `install_themes_pre_block-themes` * - `install_themes_pre_dashboard` * - `install_themes_pre_featured` * - `install_themes_pre_new` * - `install_themes_pre_search` * - `install_themes_pre_updated` * - `install_themes_pre_upload` * * @since 2.8.0 * @since 6.1.0 Added the `install_themes_pre_block-themes` hook name. */ do_action( "install_themes_pre_{$tab}" ); } $help_overview = '<p>' . sprintf( /* translators: %s: Theme Directory URL. */ __( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ), __( 'https://wordpress.org/themes/' ) ) . '</p>' . '<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' . '<p>' . __( 'Alternately, you can browse the themes that are Popular or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' . '<p>' . sprintf( /* translators: %s: /wp-content/themes */ __( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your %s directory.' ), '<code>/wp-content/themes</code>' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help_overview, ) ); $help_installing = '<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you are interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' . '<p>' . __( 'To install the theme so you can preview it with your site’s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme’s thumbnail image.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'installing', 'title' => __( 'Previewing and Installing' ), 'content' => $help_installing, ) ); // Help tab: Block themes. $help_block_themes = '<p>' . __( 'A block theme is a theme that uses blocks for all parts of a site including navigation menus, header, content, and site footer. These themes are built for the features that allow you to edit and customize all parts of your site.' ) . '</p>' . '<p>' . __( 'With a block theme, you can place and edit blocks without affecting your content by customizing or creating new templates.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'block_themes', 'title' => __( 'Block themes' ), 'content' => $help_block_themes, ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/#install-themes">Documentation on Adding New Themes</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/block-themes/">Documentation on Block Themes</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php /** * Filters the tabs shown on the Add Themes screen. * * This filter is for backward compatibility only, for the suppression of the upload tab. * * @since 2.8.0 * * @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'. */ $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) ); if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) { echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>'; } ?> <hr class="wp-header-end"> <?php wp_admin_notice( __( 'The Theme Installer screen requires JavaScript.' ), array( 'additional_classes' => array( 'error', 'hide-if-js' ), ) ); ?> <div class="upload-theme"> <?php install_themes_upload(); ?> </div> <h2 class="screen-reader-text hide-if-no-js"> <?php /* translators: Hidden accessibility text. */ _e( 'Filter themes list' ); ?> </h2> <div class="wp-filter hide-if-no-js"> <div class="filter-count"> <span class="count theme-count"></span> </div> <ul class="filter-links"> <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li> <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li> <li><a href="#" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li> <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li> </ul> <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button> <form class="search-form"><p class="search-box"></p></form> <div class="favorites-form"> <?php $action = 'save_wporg_username_' . get_current_user_id(); if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) { $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' ); update_user_meta( get_current_user_id(), 'wporg_favorites', $user ); } else { $user = get_user_option( 'wporg_favorites' ); } ?> <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p> <p class="favorites-username"> <label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label> <input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" /> <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" /> <input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" /> </p> </div> <div class="filter-drawer"> <div class="buttons"> <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> </div> <?php // Use the core list, rather than the .org API, due to inconsistencies // and to ensure tags are translated. $feature_list = get_theme_feature_list( false ); foreach ( $feature_list as $feature_group => $features ) { echo '<fieldset class="filter-group">'; echo '<legend>' . esc_html( $feature_group ) . '</legend>'; echo '<div class="filter-group-feature">'; foreach ( $features as $feature => $feature_name ) { $feature = esc_attr( $feature ); echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> '; echo '<label for="filter-id-' . $feature . '">' . esc_html( $feature_name ) . '</label>'; } echo '</div>'; echo '</fieldset>'; } ?> <div class="buttons"> <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> </div> <div class="filtered-by"> <span><?php _e( 'Filtering by:' ); ?></span> <div class="tags"></div> <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button> </div> </div> </div> <h2 class="screen-reader-text hide-if-no-js"> <?php /* translators: Hidden accessibility text. */ _e( 'Themes list' ); ?> </h2> <div class="theme-browser content-filterable"></div> <div class="theme-install-overlay wp-full-overlay expanded"></div> <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> <span class="spinner"></span> <?php if ( $tab ) { /** * Fires at the top of each of the tabs on the Install Themes page. * * The dynamic portion of the hook name, `$tab`, refers to the current * theme installation tab. * * Possible hook names include: * * - `install_themes_block-themes` * - `install_themes_dashboard` * - `install_themes_featured` * - `install_themes_new` * - `install_themes_search` * - `install_themes_updated` * - `install_themes_upload` * * @since 2.8.0 * @since 6.1.0 Added the `install_themes_block-themes` hook name. * * @param int $paged Number of the current page of results being viewed. */ do_action( "install_themes_{$tab}", $paged ); } ?> </div> <script id="tmpl-theme" type="text/template"> <# if ( data.screenshot_url ) { #> <div class="theme-screenshot"> <img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" /> </div> <# } else { #> <div class="theme-screenshot blank"></div> <# } #> <# if ( data.installed ) { #> <?php wp_admin_notice( _x( 'Installed', 'theme' ), array( 'type' => 'success', 'additional_classes' => array( 'notice-alt' ), ) ); ?> <# } #> <# if ( ! data.compatible_wp || ! data.compatible_php ) { #> <div class="notice notice-error notice-alt"><p> <# if ( ! data.compatible_wp && ! data.compatible_php ) { #> <?php _e( 'This theme does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { printf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } elseif ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } ?> <# } else if ( ! data.compatible_wp ) { #> <?php _e( 'This theme does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } ?> <# } else if ( ! data.compatible_php ) { #> <?php _e( 'This theme does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } ?> <# } #> </p></div> <# } #> <span class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></span> <div class="theme-author"> <?php /* translators: %s: Theme author name. */ printf( __( 'By %s' ), '{{ data.author }}' ); ?> </div> <div class="theme-id-container"> <h3 class="theme-name">{{ data.name }}</h3> <div class="theme-actions"> <# if ( data.installed ) { #> <# if ( data.compatible_wp && data.compatible_php ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <# if ( data.activate_url ) { #> <# if ( ! data.active ) { #> <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> <# } else { #> <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button> <# } #> <# } #> <# if ( data.customize_url ) { #> <# if ( ! data.active ) { #> <# if ( ! data.block_theme ) { #> <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a> <# } #> <# } else { #> <a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a> <# } #> <# } else { #> <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> <# } #> <# } else { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> <# if ( data.activate_url ) { #> <a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a> <# } #> <# if ( data.customize_url ) { #> <a class="button disabled"><?php _e( 'Live Preview' ); ?></a> <# } else { #> <button class="button disabled"><?php _e( 'Preview' ); ?></button> <# } #> <# } #> <# } else { #> <# if ( data.compatible_wp && data.compatible_php ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a> <button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button> <# } else { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a> <button class="button disabled"><?php _e( 'Preview' ); ?></button> <# } #> <# } #> </div> </div> </script> <script id="tmpl-theme-preview" type="text/template"> <div class="wp-full-overlay-sidebar"> <div class="wp-full-overlay-header"> <button class="close-full-overlay"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Close' ); ?> </span></button> <button class="previous-theme"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Previous theme' ); ?> </span></button> <button class="next-theme"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Next theme' ); ?> </span></button> <# if ( data.installed ) { #> <# if ( data.compatible_wp && data.compatible_php ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <# if ( ! data.active ) { #> <a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> <# } else { #> <button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button> <# } #> <# } else { #> <a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> <# } #> <# } else { #> <# if ( data.compatible_wp && data.compatible_php ) { #> <a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a> <# } else { #> <a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a> <# } #> <# } #> </div> <div class="wp-full-overlay-sidebar-content"> <div class="install-theme-info"> <h3 class="theme-name">{{ data.name }}</h3> <span class="theme-by"> <?php /* translators: %s: Theme author name. */ printf( __( 'By %s' ), '{{ data.author }}' ); ?> </span> <div class="theme-screenshot"> <img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" /> </div> <div class="theme-details"> <# if ( data.rating ) { #> <div class="theme-rating"> {{{ data.stars }}} <a class="num-ratings" href="{{ data.reviews_url }}"> <?php /* translators: %s: Number of ratings. */ printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' ); ?> </a> </div> <# } else { #> <span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span> <# } #> <div class="theme-version"> <?php /* translators: %s: Theme version. */ printf( __( 'Version: %s' ), '{{ data.version }}' ); ?> </div> <# if ( ! data.compatible_wp || ! data.compatible_php ) { #> <div class="notice notice-error notice-alt notice-large"><p> <# if ( ! data.compatible_wp && ! data.compatible_php ) { #> <?php _e( 'This theme does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { printf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), self_admin_url( 'update-core.php' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } elseif ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } elseif ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } ?> <# } else if ( ! data.compatible_wp ) { #> <?php _e( 'This theme does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { printf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } ?> <# } else if ( ! data.compatible_php ) { #> <?php _e( 'This theme does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { printf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); wp_update_php_annotation( '</p><p><em>', '</em>' ); } ?> <# } #> </p></div> <# } #> <div class="theme-description">{{{ data.description }}}</div> </div> </div> </div> <div class="wp-full-overlay-footer"> <button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>"> <span class="collapse-sidebar-arrow"></span> <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span> </button> </div> </div> <div class="wp-full-overlay-main"> <iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe> </div> </script> <?php wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); require_once ABSPATH . 'wp-admin/admin-footer.php'; options-privacy.php 0000644 00000023716 15024324530 0010432 0 ustar 00 <?php /** * Privacy Settings Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_privacy_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage privacy options on this site.' ) ); } if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { require_once __DIR__ . '/privacy-policy-guide.php'; return; } // Used in the HTML title tag. $title = __( 'Privacy' ); add_filter( 'admin_body_class', static function ( $body_class ) { $body_class .= ' privacy-settings '; return $body_class; } ); $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'The Privacy screen lets you either build a new privacy-policy page or choose one you already have to show.' ) . '</p>' . '<p>' . __( 'This screen includes suggestions to help you write your own privacy policy. However, it is your responsibility to use these resources correctly, to provide the information required by your privacy policy, and to keep this information current and accurate.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-privacy-screen/">Documentation on Privacy Settings</a>' ) . '</p>' ); if ( ! empty( $action ) ) { check_admin_referer( $action ); if ( 'set-privacy-page' === $action ) { $privacy_policy_page_id = isset( $_POST['page_for_privacy_policy'] ) ? (int) $_POST['page_for_privacy_policy'] : 0; update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); $privacy_page_updated_message = __( 'Privacy Policy page updated successfully.' ); if ( $privacy_policy_page_id ) { /* * Don't always link to the menu customizer: * * - Unpublished pages can't be selected by default. * - `WP_Customize_Nav_Menus::__construct()` checks the user's capabilities. * - Themes might not "officially" support menus. */ if ( 'publish' === get_post_status( $privacy_policy_page_id ) && current_user_can( 'edit_theme_options' ) && current_theme_supports( 'menus' ) ) { $privacy_page_updated_message = sprintf( /* translators: %s: URL to Customizer -> Menus. */ __( 'Privacy Policy page setting updated successfully. Remember to <a href="%s">update your menus</a>!' ), esc_url( add_query_arg( 'autofocus[panel]', 'nav_menus', admin_url( 'customize.php' ) ) ) ); } } add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', $privacy_page_updated_message, 'success' ); } elseif ( 'create-privacy-page' === $action ) { if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; } $privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content(); $privacy_policy_page_id = wp_insert_post( array( 'post_title' => __( 'Privacy Policy' ), 'post_status' => 'draft', 'post_type' => 'page', 'post_content' => $privacy_policy_page_content, ), true ); if ( is_wp_error( $privacy_policy_page_id ) ) { add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', __( 'Unable to create a Privacy Policy page.' ), 'error' ); } else { update_option( 'wp_page_for_privacy_policy', $privacy_policy_page_id ); wp_redirect( admin_url( 'post.php?post=' . $privacy_policy_page_id . '&action=edit' ) ); exit; } } } // If a Privacy Policy page ID is available, make sure the page actually exists. If not, display an error. $privacy_policy_page_exists = false; $privacy_policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); if ( ! empty( $privacy_policy_page_id ) ) { $privacy_policy_page = get_post( $privacy_policy_page_id ); if ( ! $privacy_policy_page instanceof WP_Post ) { add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', __( 'The currently selected Privacy Policy page does not exist. Please create or select a new page.' ), 'error' ); } else { if ( 'trash' === $privacy_policy_page->post_status ) { add_settings_error( 'page_for_privacy_policy', 'page_for_privacy_policy', sprintf( /* translators: %s: URL to Pages Trash. */ __( 'The currently selected Privacy Policy page is in the Trash. Please create or select a new Privacy Policy page or <a href="%s">restore the current page</a>.' ), 'edit.php?post_status=trash&post_type=page' ), 'error' ); } else { $privacy_policy_page_exists = true; } } } $parent_file = 'options-general.php'; wp_enqueue_script( 'privacy-tools' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="privacy-settings-header"> <div class="privacy-settings-title-section"> <h1> <?php _e( 'Privacy' ); ?> </h1> </div> <nav class="privacy-settings-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>"> <a href="<?php echo esc_url( admin_url( 'options-privacy.php' ) ); ?>" class="privacy-settings-tab active" aria-current="true"> <?php /* translators: Tab heading for Site Health Status page. */ _ex( 'Settings', 'Privacy Settings' ); ?> </a> <a href="<?php echo esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ); ?>" class="privacy-settings-tab"> <?php /* translators: Tab heading for Site Health Status page. */ _ex( 'Policy Guide', 'Privacy Settings' ); ?> </a> </nav> </div> <hr class="wp-header-end"> <?php wp_admin_notice( __( 'The Privacy Settings require JavaScript.' ), array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> <div class="privacy-settings-body hide-if-no-js"> <h2><?php _e( 'Privacy Settings' ); ?></h2> <p> <?php _e( 'As a website owner, you may need to follow national or international privacy laws. For example, you may need to create and display a privacy policy.' ); ?> <?php _e( 'If you already have a Privacy Policy page, please select it below. If not, please create one.' ); ?> </p> <p> <?php _e( 'The new page will include help and suggestions for your privacy policy.' ); ?> <?php _e( 'However, it is your responsibility to use those resources correctly, to provide the information that your privacy policy requires, and to keep that information current and accurate.' ); ?> </p> <p> <?php _e( 'After your Privacy Policy page is set, you should edit it.' ); ?> <?php _e( 'You should also review your privacy policy from time to time, especially after installing or updating any themes or plugins. There may be changes or new suggested information for you to consider adding to your policy.' ); ?> </p> <p> <?php if ( $privacy_policy_page_exists ) { $edit_href = add_query_arg( array( 'post' => $privacy_policy_page_id, 'action' => 'edit', ), admin_url( 'post.php' ) ); $view_href = get_permalink( $privacy_policy_page_id ); ?> <strong> <?php if ( 'publish' === get_post_status( $privacy_policy_page_id ) ) { printf( /* translators: 1: URL to edit Privacy Policy page, 2: URL to view Privacy Policy page. */ __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your Privacy Policy page content.' ), esc_url( $edit_href ), esc_url( $view_href ) ); } else { printf( /* translators: 1: URL to edit Privacy Policy page, 2: URL to preview Privacy Policy page. */ __( '<a href="%1$s">Edit</a> or <a href="%2$s">preview</a> your Privacy Policy page content.' ), esc_url( $edit_href ), esc_url( $view_href ) ); } ?> </strong> <?php } printf( /* translators: 1: Privacy Policy guide URL, 2: Additional link attributes, 3: Accessibility text. */ __( 'Need help putting together your new Privacy Policy page? <a href="%1$s" %2$s>Check out our privacy policy guide%3$s</a> for recommendations on what content to include, along with policies suggested by your plugins and theme.' ), esc_url( admin_url( 'options-privacy.php?tab=policyguide' ) ), '', '' ); ?> </p> <hr> <?php $has_pages = (bool) get_posts( array( 'post_type' => 'page', 'posts_per_page' => 1, 'post_status' => array( 'publish', 'draft', ), ) ); ?> <table class="form-table tools-privacy-policy-page" role="presentation"> <tr> <th scope="row"> <label for="create-page"> <?php if ( $has_pages ) { _e( 'Create a new Privacy Policy page' ); } else { _e( 'There are no pages.' ); } ?> </label> </th> <td> <form class="wp-create-privacy-page" method="post"> <input type="hidden" name="action" value="create-privacy-page" /> <?php wp_nonce_field( 'create-privacy-page' ); submit_button( __( 'Create' ), 'secondary', 'submit', false, array( 'id' => 'create-page' ) ); ?> </form> </td> </tr> <?php if ( $has_pages ) : ?> <tr> <th scope="row"> <label for="page_for_privacy_policy"> <?php if ( $privacy_policy_page_exists ) { _e( 'Change your Privacy Policy page' ); } else { _e( 'Select a Privacy Policy page' ); } ?> </label> </th> <td> <form method="post"> <input type="hidden" name="action" value="set-privacy-page" /> <?php wp_dropdown_pages( array( 'name' => 'page_for_privacy_policy', 'show_option_none' => __( '— Select —' ), 'option_none_value' => '0', 'selected' => $privacy_policy_page_id, 'post_status' => array( 'draft', 'publish' ), ) ); wp_nonce_field( 'set-privacy-page' ); submit_button( __( 'Use This Page' ), 'primary', 'submit', false, array( 'id' => 'set-page' ) ); ?> </form> </td> </tr> <?php endif; ?> </table> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; admin-header.php 0000644 00000021563 15024324530 0007600 0 ustar 00 <?php /** * WordPress Administration Template Header * * @package WordPress * @subpackage Administration */ header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); if ( ! defined( 'WP_ADMIN' ) ) { require_once __DIR__ . '/admin.php'; } /** * In case admin-header.php is included in a function. * * @global string $title The title of the current screen. * @global string $hook_suffix * @global WP_Screen $current_screen WordPress current screen object. * @global WP_Locale $wp_locale WordPress date and time locale object. * @global string $pagenow The filename of the current screen. * @global string $update_title * @global int $total_update_count * @global string $parent_file * @global string $typenow The post type of the current screen. */ global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $update_title, $total_update_count, $parent_file, $typenow; // Catch plugins that include admin-header.php before admin.php completes. if ( empty( $current_screen ) ) { set_current_screen(); } get_admin_page_title(); $title = strip_tags( $title ); if ( is_network_admin() ) { /* translators: Network admin screen title. %s: Network title. */ $admin_title = sprintf( __( 'Network Admin: %s' ), get_network()->site_name ); } elseif ( is_user_admin() ) { /* translators: User dashboard screen title. %s: Network title. */ $admin_title = sprintf( __( 'User Dashboard: %s' ), get_network()->site_name ); } else { $admin_title = get_bloginfo( 'name' ); } if ( $admin_title === $title ) { /* translators: Admin screen title. %s: Admin screen name. */ $admin_title = sprintf( __( '%s — WordPress' ), $title ); } else { $screen_title = $title; if ( 'post' === $current_screen->base && 'add' !== $current_screen->action ) { $post_title = get_the_title(); if ( ! empty( $post_title ) ) { $post_type_obj = get_post_type_object( $typenow ); $screen_title = sprintf( /* translators: Editor admin screen title. 1: "Edit item" text for the post type, 2: Post title. */ __( '%1$s “%2$s”' ), $post_type_obj->labels->edit_item, $post_title ); } } /* translators: Admin screen title. 1: Admin screen name, 2: Network or site name. */ $admin_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $screen_title, $admin_title ); } if ( wp_is_recovery_mode() ) { /* translators: %s: Admin screen title. */ $admin_title = sprintf( __( 'Recovery Mode — %s' ), $admin_title ); } /** * Filters the title tag content for an admin page. * * @since 3.1.0 * * @param string $admin_title The page title, with extra context added. * @param string $title The original page title. */ $admin_title = apply_filters( 'admin_title', $admin_title, $title ); wp_user_settings(); _wp_admin_html_begin(); ?> <title><?php echo esc_html( $admin_title ); ?></title> <?php wp_enqueue_style( 'colors' ); wp_enqueue_script( 'utils' ); wp_enqueue_script( 'svg-painter' ); $admin_body_class = preg_replace( '/[^a-z0-9_-]+/i', '-', $hook_suffix ); ?> <script type="text/javascript"> addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(function(){func();});else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php', 'relative' ) ); ?>', pagenow = '<?php echo esc_js( $current_screen->id ); ?>', typenow = '<?php echo esc_js( $current_screen->post_type ); ?>', adminpage = '<?php echo esc_js( $admin_body_class ); ?>', thousandsSeparator = '<?php echo esc_js( $wp_locale->number_format['thousands_sep'] ); ?>', decimalPoint = '<?php echo esc_js( $wp_locale->number_format['decimal_point'] ); ?>', isRtl = <?php echo (int) is_rtl(); ?>; </script> <?php /** * Fires when enqueuing scripts for all admin pages. * * @since 2.8.0 * * @param string $hook_suffix The current admin page. */ do_action( 'admin_enqueue_scripts', $hook_suffix ); /** * Fires when styles are printed for a specific admin page based on $hook_suffix. * * @since 2.6.0 */ do_action( "admin_print_styles-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires when styles are printed for all admin pages. * * @since 2.6.0 */ do_action( 'admin_print_styles' ); /** * Fires when scripts are printed for a specific admin page based on $hook_suffix. * * @since 2.1.0 */ do_action( "admin_print_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires when scripts are printed for all admin pages. * * @since 2.1.0 */ do_action( 'admin_print_scripts' ); /** * Fires in head section for a specific admin page. * * The dynamic portion of the hook name, `$hook_suffix`, refers to the hook suffix * for the admin page. * * @since 2.1.0 */ do_action( "admin_head-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Fires in head section for all admin pages. * * @since 2.1.0 */ do_action( 'admin_head' ); if ( 'f' === get_user_setting( 'mfold' ) ) { $admin_body_class .= ' folded'; } if ( ! get_user_setting( 'unfold' ) ) { $admin_body_class .= ' auto-fold'; } if ( is_admin_bar_showing() ) { $admin_body_class .= ' admin-bar'; } if ( is_rtl() ) { $admin_body_class .= ' rtl'; } if ( $current_screen->post_type ) { $admin_body_class .= ' post-type-' . $current_screen->post_type; } if ( $current_screen->taxonomy ) { $admin_body_class .= ' taxonomy-' . $current_screen->taxonomy; } $admin_body_class .= ' branch-' . str_replace( array( '.', ',' ), '-', (float) get_bloginfo( 'version' ) ); $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', get_bloginfo( 'version' ) ) ); $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) ); if ( wp_is_mobile() ) { $admin_body_class .= ' mobile'; } if ( is_multisite() ) { $admin_body_class .= ' multisite'; } if ( is_network_admin() ) { $admin_body_class .= ' network-admin'; } $admin_body_class .= ' no-customize-support svg'; if ( $current_screen->is_block_editor() ) { $admin_body_class .= ' block-editor-page wp-embed-responsive'; } $error_get_last = error_get_last(); // Print a CSS class to make PHP errors visible. if ( $error_get_last && WP_DEBUG && WP_DEBUG_DISPLAY && ini_get( 'display_errors' ) // Don't print the class for PHP notices in wp-config.php, as they happen before WP_DEBUG takes effect, // and should not be displayed with the `error_reporting` level previously set in wp-load.php. && ( E_NOTICE !== $error_get_last['type'] || 'wp-config.php' !== wp_basename( $error_get_last['file'] ) ) ) { $admin_body_class .= ' php-error'; } unset( $error_get_last ); ?> </head> <?php /** * Filters the CSS classes for the body tag in the admin. * * This filter differs from the {@see 'post_class'} and {@see 'body_class'} filters * in two important ways: * * 1. `$classes` is a space-separated string of class names instead of an array. * 2. Not all core admin classes are filterable, notably: wp-admin, wp-core-ui, * and no-js cannot be removed. * * @since 2.3.0 * * @param string $classes Space-separated list of CSS classes. */ $admin_body_classes = apply_filters( 'admin_body_class', '' ); $admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class ); ?> <body class="wp-admin wp-core-ui no-js <?php echo esc_attr( $admin_body_classes ); ?>"> <script type="text/javascript"> document.body.className = document.body.className.replace('no-js','js'); </script> <?php // Make sure the customize body classes are correct as early as possible. if ( current_user_can( 'customize' ) ) { wp_customize_support_script(); } ?> <div id="wpwrap"> <?php require ABSPATH . 'wp-admin/menu-header.php'; ?> <div id="wpcontent"> <?php /** * Fires at the beginning of the content section in an admin page. * * @since 3.0.0 */ do_action( 'in_admin_header' ); ?> <div id="wpbody" role="main"> <?php unset( $blog_name, $total_update_count, $update_title ); $current_screen->set_parentage( $parent_file ); ?> <div id="wpbody-content"> <?php $current_screen->render_screen_meta(); if ( is_network_admin() ) { /** * Prints network admin screen notices. * * @since 3.1.0 */ do_action( 'network_admin_notices' ); } elseif ( is_user_admin() ) { /** * Prints user admin screen notices. * * @since 3.1.0 */ do_action( 'user_admin_notices' ); } else { /** * Prints admin screen notices. * * @since 3.1.0 */ do_action( 'admin_notices' ); } /** * Prints generic admin screen notices. * * @since 3.1.0 */ do_action( 'all_admin_notices' ); if ( 'options-general.php' === $parent_file ) { require ABSPATH . 'wp-admin/options-head.php'; } ms-upgrade-network.php 0000644 00000000333 15024324530 0011005 0 ustar 00 <?php /** * Multisite upgrade administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'upgrade.php' ) ); exit; admin-ajax.php 0000644 00000012032 15024324530 0007262 0 ustar 00 <?php /** * WordPress Ajax Process Execution * * @package WordPress * @subpackage Administration * * @link https://developer.wordpress.org/plugins/javascript/ajax */ /** * Executing Ajax process. * * @since 2.1.0 */ define( 'DOING_AJAX', true ); if ( ! defined( 'WP_ADMIN' ) ) { define( 'WP_ADMIN', true ); } /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; /** Allow for cross-domain requests (from the front end). */ send_origin_headers(); header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); header( 'X-Robots-Tag: noindex' ); // Require a valid action parameter. if ( empty( $_REQUEST['action'] ) || ! is_scalar( $_REQUEST['action'] ) ) { wp_die( '0', 400 ); } /** Load WordPress Administration APIs */ require_once ABSPATH . 'wp-admin/includes/admin.php'; /** Load Ajax Handlers for WordPress Core */ require_once ABSPATH . 'wp-admin/includes/ajax-actions.php'; send_nosniff_header(); nocache_headers(); /** This action is documented in wp-admin/admin.php */ do_action( 'admin_init' ); $core_actions_get = array( 'fetch-list', 'ajax-tag-search', 'wp-compression-test', 'imgedit-preview', 'oembed-cache', 'autocomplete-user', 'dashboard-widgets', 'logged-in', 'rest-nonce', ); $core_actions_post = array( 'oembed-cache', 'image-editor', 'delete-comment', 'delete-tag', 'delete-link', 'delete-meta', 'delete-post', 'trash-post', 'untrash-post', 'delete-page', 'dim-comment', 'add-link-category', 'add-tag', 'get-tagcloud', 'get-comments', 'replyto-comment', 'edit-comment', 'add-menu-item', 'add-meta', 'add-user', 'closed-postboxes', 'hidden-columns', 'update-welcome-panel', 'menu-get-metabox', 'wp-link-ajax', 'menu-locations-save', 'menu-quick-search', 'meta-box-order', 'get-permalink', 'sample-permalink', 'inline-save', 'inline-save-tax', 'find_posts', 'widgets-order', 'save-widget', 'delete-inactive-widgets', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment', 'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor', 'send-attachment-to-editor', 'save-attachment-order', 'media-create-image-subsizes', 'heartbeat', 'get-revision-diffs', 'save-user-color-scheme', 'update-widget', 'query-themes', 'parse-embed', 'set-attachment-thumbnail', 'parse-media-shortcode', 'destroy-sessions', 'install-plugin', 'activate-plugin', 'update-plugin', 'crop-image', 'generate-password', 'save-wporg-username', 'delete-plugin', 'search-plugins', 'search-install-plugins', 'activate-plugin', 'update-theme', 'delete-theme', 'install-theme', 'get-post-thumbnail-html', 'get-community-events', 'edit-theme-plugin-file', 'wp-privacy-export-personal-data', 'wp-privacy-erase-personal-data', 'health-check-site-status-result', 'health-check-dotorg-communication', 'health-check-is-in-debug-mode', 'health-check-background-updates', 'health-check-loopback-requests', 'health-check-get-sizes', 'toggle-auto-updates', 'send-password-reset', ); // Deprecated. $core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category', 'health-check-dotorg-communication', 'health-check-is-in-debug-mode', 'health-check-background-updates', 'health-check-loopback-requests', ); $core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated ); // Register core Ajax calls. if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get, true ) ) { add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 ); } if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post, true ) ) { add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 ); } add_action( 'wp_ajax_nopriv_generate-password', 'wp_ajax_nopriv_generate_password' ); add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 ); // Register Plugin Dependencies Ajax calls. add_action( 'wp_ajax_check_plugin_dependencies', array( 'WP_Plugin_Dependencies', 'check_plugin_dependencies_during_ajax' ) ); $action = $_REQUEST['action']; if ( is_user_logged_in() ) { // If no action is registered, return a Bad Request response. if ( ! has_action( "wp_ajax_{$action}" ) ) { wp_die( '0', 400 ); } /** * Fires authenticated Ajax actions for logged-in users. * * The dynamic portion of the hook name, `$action`, refers * to the name of the Ajax action callback being fired. * * @since 2.1.0 */ do_action( "wp_ajax_{$action}" ); } else { // If no action is registered, return a Bad Request response. if ( ! has_action( "wp_ajax_nopriv_{$action}" ) ) { wp_die( '0', 400 ); } /** * Fires non-authenticated Ajax actions for logged-out users. * * The dynamic portion of the hook name, `$action`, refers * to the name of the Ajax action callback being fired. * * @since 2.8.0 */ do_action( "wp_ajax_nopriv_{$action}" ); } // Default status. wp_die( '0' ); menu.php 0000644 00000041261 15024324530 0006223 0 ustar 00 <?php /** * Build Administration Menu. * * @package WordPress * @subpackage Administration */ /** * Constructs the admin menu. * * The elements in the array are: * 0: Menu item name. * 1: Minimum level or capability required. * 2: The URL of the item's file. * 3: Page title. * 4: Classes. * 5: ID. * 6: Icon for top level menu. * * @global array $menu */ $menu[2] = array( __( 'Dashboard' ), 'read', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' ); if ( is_multisite() ) { $submenu['index.php'][5] = array( __( 'My Sites' ), 'read', 'my-sites.php' ); } if ( ! is_multisite() || current_user_can( 'update_core' ) ) { $update_data = wp_get_update_data(); } if ( ! is_multisite() ) { if ( current_user_can( 'update_core' ) ) { $cap = 'update_core'; } elseif ( current_user_can( 'update_plugins' ) ) { $cap = 'update_plugins'; } elseif ( current_user_can( 'update_themes' ) ) { $cap = 'update_themes'; } else { $cap = 'update_languages'; } $submenu['index.php'][10] = array( sprintf( /* translators: %s: Number of pending updates. */ __( 'Updates %s' ), sprintf( '<span class="update-plugins count-%s"><span class="update-count">%s</span></span>', $update_data['counts']['total'], number_format_i18n( $update_data['counts']['total'] ) ) ), $cap, 'update-core.php', ); unset( $cap ); } $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' ); // $menu[5] = Posts. $menu[10] = array( __( 'Media' ), 'upload_files', 'upload.php', '', 'menu-top menu-icon-media', 'menu-media', 'dashicons-admin-media' ); $submenu['upload.php'][5] = array( __( 'Library' ), 'upload_files', 'upload.php' ); $submenu['upload.php'][10] = array( __( 'Add New Media File' ), 'upload_files', 'media-new.php' ); $i = 15; foreach ( get_taxonomies_for_attachments( 'objects' ) as $tax ) { if ( ! $tax->show_ui || ! $tax->show_in_menu ) { continue; } $submenu['upload.php'][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name . '&post_type=attachment' ); } unset( $tax, $i ); $menu[15] = array( __( 'Links' ), 'manage_links', 'link-manager.php', '', 'menu-top menu-icon-links', 'menu-links', 'dashicons-admin-links' ); $submenu['link-manager.php'][5] = array( _x( 'All Links', 'admin menu' ), 'manage_links', 'link-manager.php' ); $submenu['link-manager.php'][10] = array( __( 'Add New Link' ), 'manage_links', 'link-add.php' ); $submenu['link-manager.php'][15] = array( __( 'Link Categories' ), 'manage_categories', 'edit-tags.php?taxonomy=link_category' ); // $menu[20] = Pages. // Avoid the comment count query for users who cannot edit_posts. if ( current_user_can( 'edit_posts' ) ) { $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $awaiting_mod_i18n = number_format_i18n( $awaiting_mod ); /* translators: %s: Number of comments. */ $awaiting_mod_text = sprintf( _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), $awaiting_mod_i18n ); $menu[25] = array( /* translators: %s: Number of comments. */ sprintf( __( 'Comments %s' ), '<span class="awaiting-mod count-' . absint( $awaiting_mod ) . '"><span class="pending-count" aria-hidden="true">' . $awaiting_mod_i18n . '</span><span class="comments-in-moderation-text screen-reader-text">' . $awaiting_mod_text . '</span></span>' ), 'edit_posts', 'edit-comments.php', '', 'menu-top menu-icon-comments', 'menu-comments', 'dashicons-admin-comments', ); unset( $awaiting_mod ); } $submenu['edit-comments.php'][0] = array( __( 'All Comments' ), 'edit_posts', 'edit-comments.php' ); $_wp_last_object_menu = 25; // The index of the last top-level menu in the object menu group. $types = (array) get_post_types( array( 'show_ui' => true, '_builtin' => false, 'show_in_menu' => true, ) ); $builtin = array( 'post', 'page' ); foreach ( array_merge( $builtin, $types ) as $ptype ) { $ptype_obj = get_post_type_object( $ptype ); // Check if it should be a submenu. if ( true !== $ptype_obj->show_in_menu ) { continue; } $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. $ptype_for_id = sanitize_html_class( $ptype ); $menu_icon = 'dashicons-admin-post'; if ( is_string( $ptype_obj->menu_icon ) ) { // Special handling for an empty div.wp-menu-image, data:image/svg+xml, and Dashicons. if ( 'none' === $ptype_obj->menu_icon || 'div' === $ptype_obj->menu_icon || str_starts_with( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || str_starts_with( $ptype_obj->menu_icon, 'dashicons-' ) ) { $menu_icon = $ptype_obj->menu_icon; } else { $menu_icon = esc_url( $ptype_obj->menu_icon ); } } elseif ( in_array( $ptype, $builtin, true ) ) { $menu_icon = 'dashicons-admin-' . $ptype; } $menu_class = 'menu-top menu-icon-' . $ptype_for_id; // 'post' special case. if ( 'post' === $ptype ) { $menu_class .= ' open-if-no-js'; $ptype_file = 'edit.php'; $post_new_file = 'post-new.php'; $edit_tags_file = 'edit-tags.php?taxonomy=%s'; } else { $ptype_file = "edit.php?post_type=$ptype"; $post_new_file = "post-new.php?post_type=$ptype"; $edit_tags_file = "edit-tags.php?taxonomy=%s&post_type=$ptype"; } if ( in_array( $ptype, $builtin, true ) ) { $ptype_menu_id = 'menu-' . $ptype_for_id . 's'; } else { $ptype_menu_id = 'menu-posts-' . $ptype_for_id; } /* * If $ptype_menu_position is already populated or will be populated * by a hard-coded value below, increment the position. */ $core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 ); while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) { ++$ptype_menu_position; } $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon ); $submenu[ $ptype_file ][5] = array( $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, $ptype_file ); $submenu[ $ptype_file ][10] = array( $ptype_obj->labels->add_new_item, $ptype_obj->cap->create_posts, $post_new_file ); $i = 15; foreach ( get_taxonomies( array(), 'objects' ) as $tax ) { if ( ! $tax->show_ui || ! $tax->show_in_menu || ! in_array( $ptype, (array) $tax->object_type, true ) ) { continue; } $submenu[ $ptype_file ][ $i++ ] = array( esc_attr( $tax->labels->menu_name ), $tax->cap->manage_terms, sprintf( $edit_tags_file, $tax->name ) ); } } unset( $ptype, $ptype_obj, $ptype_for_id, $ptype_menu_position, $menu_icon, $i, $tax, $post_new_file ); $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' ); $appearance_cap = current_user_can( 'switch_themes' ) ? 'switch_themes' : 'edit_theme_options'; $menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); $count = ''; if ( ! is_multisite() && current_user_can( 'update_themes' ) ) { if ( ! isset( $update_data ) ) { $update_data = wp_get_update_data(); } $count = sprintf( '<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>', $update_data['counts']['themes'], number_format_i18n( $update_data['counts']['themes'] ) ); } /* translators: %s: Number of available theme updates. */ $submenu['themes.php'][5] = array( sprintf( __( 'Themes %s' ), $count ), $appearance_cap, 'themes.php' ); if ( wp_is_block_theme() ) { $submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' ); } else { $submenu['themes.php'][6] = array( _x( 'Patterns', 'patterns menu item' ), 'edit_theme_options', 'site-editor.php?path=/patterns' ); } $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' ); // Hide Customize link on block themes unless a plugin or theme // is using 'customize_register' to add a setting. if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) { $submenu['themes.php'][7] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { $submenu['themes.php'][10] = array( __( 'Menus' ), 'edit_theme_options', 'nav-menus.php' ); } if ( current_theme_supports( 'custom-header' ) && current_user_can( 'customize' ) ) { $customize_header_url = add_query_arg( array( 'autofocus' => array( 'control' => 'header_image' ) ), $customize_url ); $submenu['themes.php'][15] = array( _x( 'Header', 'custom image header' ), $appearance_cap, esc_url( $customize_header_url ), '', 'hide-if-no-customize' ); } if ( current_theme_supports( 'custom-background' ) && current_user_can( 'customize' ) ) { $customize_background_url = add_query_arg( array( 'autofocus' => array( 'control' => 'background_image' ) ), $customize_url ); $submenu['themes.php'][20] = array( _x( 'Background', 'custom background' ), $appearance_cap, esc_url( $customize_background_url ), '', 'hide-if-no-customize' ); } unset( $customize_url ); unset( $appearance_cap ); // Add 'Theme File Editor' to the bottom of the Appearance (non-block themes) or Tools (block themes) menu. if ( ! is_multisite() ) { // Must use API on the admin_menu hook, direct modification is only possible on/before the _admin_menu hook. add_action( 'admin_menu', '_add_themes_utility_last', 101 ); } /** * Adds the 'Theme File Editor' menu item to the bottom of the Appearance (non-block themes) * or Tools (block themes) menu. * * @access private * @since 3.0.0 * @since 5.9.0 Renamed 'Theme Editor' to 'Theme File Editor'. * Relocates to Tools for block themes. */ function _add_themes_utility_last() { add_submenu_page( wp_is_block_theme() ? 'tools.php' : 'themes.php', __( 'Theme File Editor' ), __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' ); } /** * Adds the 'Plugin File Editor' menu item after the 'Themes File Editor' in Tools * for block themes. * * @access private * @since 5.9.0 */ function _add_plugin_file_editor_to_tools() { if ( ! wp_is_block_theme() ) { return; } add_submenu_page( 'tools.php', __( 'Plugin File Editor' ), __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); } $count = ''; if ( ! is_multisite() && current_user_can( 'update_plugins' ) ) { if ( ! isset( $update_data ) ) { $update_data = wp_get_update_data(); } $count = sprintf( '<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>', $update_data['counts']['plugins'], number_format_i18n( $update_data['counts']['plugins'] ) ); } /* translators: %s: Number of available plugin updates. */ $menu[65] = array( sprintf( __( 'Plugins %s' ), $count ), 'activate_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' ); $submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'activate_plugins', 'plugins.php' ); if ( ! is_multisite() ) { $submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' ); if ( wp_is_block_theme() ) { // Place the menu item below the Theme File Editor menu item. add_action( 'admin_menu', '_add_plugin_file_editor_to_tools', 101 ); } else { $submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' ); } } unset( $update_data ); if ( current_user_can( 'list_users' ) ) { $menu[70] = array( __( 'Users' ), 'list_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); } else { $menu[70] = array( __( 'Profile' ), 'read', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); } if ( current_user_can( 'list_users' ) ) { $_wp_real_parent_file['profile.php'] = 'users.php'; // Back-compat for plugins adding submenus to profile.php. $submenu['users.php'][5] = array( __( 'All Users' ), 'list_users', 'users.php' ); if ( current_user_can( 'create_users' ) ) { $submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' ); } elseif ( is_multisite() ) { $submenu['users.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' ); } $submenu['users.php'][15] = array( __( 'Profile' ), 'read', 'profile.php' ); } else { $_wp_real_parent_file['users.php'] = 'profile.php'; $submenu['profile.php'][5] = array( __( 'Profile' ), 'read', 'profile.php' ); if ( current_user_can( 'create_users' ) ) { $submenu['profile.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' ); } elseif ( is_multisite() ) { $submenu['profile.php'][10] = array( __( 'Add New User' ), 'promote_users', 'user-new.php' ); } } $site_health_count = ''; if ( ! is_multisite() && current_user_can( 'view_site_health_checks' ) ) { $get_issues = get_transient( 'health-check-site-status-result' ); $issue_counts = array(); if ( false !== $get_issues ) { $issue_counts = json_decode( $get_issues, true ); } if ( ! is_array( $issue_counts ) || ! $issue_counts ) { $issue_counts = array( 'good' => 0, 'recommended' => 0, 'critical' => 0, ); } $site_health_count = sprintf( '<span class="menu-counter site-health-counter count-%s"><span class="count">%s</span></span>', $issue_counts['critical'], number_format_i18n( $issue_counts['critical'] ) ); } $menu[75] = array( __( 'Tools' ), 'edit_posts', 'tools.php', '', 'menu-top menu-icon-tools', 'menu-tools', 'dashicons-admin-tools' ); $submenu['tools.php'][5] = array( __( 'Available Tools' ), 'edit_posts', 'tools.php' ); $submenu['tools.php'][10] = array( __( 'Import' ), 'import', 'import.php' ); $submenu['tools.php'][15] = array( __( 'Export' ), 'export', 'export.php' ); /* translators: %s: Number of critical Site Health checks. */ $submenu['tools.php'][20] = array( sprintf( __( 'Site Health %s' ), $site_health_count ), 'view_site_health_checks', 'site-health.php' ); $submenu['tools.php'][25] = array( __( 'Export Personal Data' ), 'export_others_personal_data', 'export-personal-data.php' ); $submenu['tools.php'][30] = array( __( 'Erase Personal Data' ), 'erase_others_personal_data', 'erase-personal-data.php' ); if ( is_multisite() && ! is_main_site() ) { $submenu['tools.php'][35] = array( __( 'Delete Site' ), 'delete_site', 'ms-delete-site.php' ); } if ( ! is_multisite() && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) { $submenu['tools.php'][50] = array( __( 'Network Setup' ), 'setup_network', 'network.php' ); } $menu[80] = array( __( 'Settings' ), 'manage_options', 'options-general.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' ); $submenu['options-general.php'][10] = array( _x( 'General', 'settings screen' ), 'manage_options', 'options-general.php' ); $submenu['options-general.php'][15] = array( __( 'Writing' ), 'manage_options', 'options-writing.php' ); $submenu['options-general.php'][20] = array( __( 'Reading' ), 'manage_options', 'options-reading.php' ); $submenu['options-general.php'][25] = array( __( 'Discussion' ), 'manage_options', 'options-discussion.php' ); $submenu['options-general.php'][30] = array( __( 'Media' ), 'manage_options', 'options-media.php' ); $submenu['options-general.php'][40] = array( __( 'Permalinks' ), 'manage_options', 'options-permalink.php' ); $submenu['options-general.php'][45] = array( __( 'Privacy' ), 'manage_privacy_options', 'options-privacy.php' ); $_wp_last_utility_menu = 80; // The index of the last top-level menu in the utility menu group. $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator' ); // Back-compat for old top-levels. $_wp_real_parent_file['post.php'] = 'edit.php'; $_wp_real_parent_file['post-new.php'] = 'edit.php'; $_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page'; $_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page'; $_wp_real_parent_file['wpmu-admin.php'] = 'tools.php'; $_wp_real_parent_file['ms-admin.php'] = 'tools.php'; // Ensure backward compatibility. $compat = array( 'index' => 'dashboard', 'edit' => 'posts', 'post' => 'posts', 'upload' => 'media', 'link-manager' => 'links', 'edit-pages' => 'pages', 'page' => 'pages', 'edit-comments' => 'comments', 'options-general' => 'settings', 'themes' => 'appearance', ); require_once ABSPATH . 'wp-admin/includes/menu.php'; plugin-install.php 0000644 00000015724 15024324530 0010226 0 ustar 00 <?php /** * Install plugin administration panel. * * @package WordPress * @subpackage Administration */ // TODO: Route this page via a specific iframe handler instead of the do_action below. if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) { define( 'IFRAME_REQUEST', true ); } /** * WordPress Administration Bootstrap. */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'install_plugins' ) ) { wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) ); } if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'plugin-install.php' ) ); exit; } $wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { $location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) ); if ( ! empty( $_REQUEST['paged'] ) ) { $location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location ); } wp_redirect( $location ); exit; } $wp_list_table->prepare_items(); $total_pages = $wp_list_table->get_pagination_arg( 'total_pages' ); if ( $pagenum > $total_pages && $total_pages > 0 ) { wp_redirect( add_query_arg( 'paged', $total_pages ) ); exit; } // Used in the HTML title tag. $title = __( 'Add Plugins' ); $parent_file = 'plugins.php'; wp_enqueue_script( 'plugin-install' ); if ( 'plugin-information' !== $tab ) { add_thickbox(); } $body_id = $tab; wp_enqueue_script( 'updates' ); /** * Fires before each tab on the Install Plugins screen is loaded. * * The dynamic portion of the hook name, `$tab`, allows for targeting * individual tabs. * * Possible hook names include: * * - `install_plugins_pre_beta` * - `install_plugins_pre_favorites` * - `install_plugins_pre_featured` * - `install_plugins_pre_plugin-information` * - `install_plugins_pre_popular` * - `install_plugins_pre_recommended` * - `install_plugins_pre_search` * - `install_plugins_pre_upload` * * @since 2.7.0 */ do_action( "install_plugins_pre_{$tab}" ); /* * Call the pre upload action on every non-upload plugin installation screen * because the form is always displayed on these screens. */ if ( 'upload' !== $tab ) { /** This action is documented in wp-admin/plugin-install.php */ do_action( 'install_plugins_pre_upload' ); } get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . sprintf( /* translators: %s: https://wordpress.org/plugins/ */ __( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ), __( 'https://wordpress.org/plugins/' ) ) . '</p>' . '<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'adding-plugins', 'title' => __( 'Adding Plugins' ), 'content' => '<p>' . __( 'If you know what you are looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.' ) . '</p>' . '<p>' . __( 'If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' . '<p>' . __( 'You can also browse a user’s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' . '<p>' . __( 'If you want to install a plugin that you’ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); get_current_screen()->set_screen_reader_content( array( 'heading_views' => __( 'Filter plugins list' ), 'heading_pagination' => __( 'Plugins list navigation' ), 'heading_list' => __( 'Plugins list' ), ) ); /** * WordPress Administration Template Header. */ require_once ABSPATH . 'wp-admin/admin-header.php'; WP_Plugin_Dependencies::initialize(); WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies(); WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies(); ?> <div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <?php if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) { printf( ' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>', ( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ), __( 'Upload Plugin' ), __( 'Browse Plugins' ) ); } ?> <hr class="wp-header-end"> <?php /* * Output the upload plugin form on every non-upload plugin installation screen, so it can be * displayed via JavaScript rather then opening up the devoted upload plugin page. */ if ( 'upload' !== $tab ) { ?> <div class="upload-plugin-wrap"> <?php /** This action is documented in wp-admin/plugin-install.php */ do_action( 'install_plugins_upload' ); ?> </div> <?php $wp_list_table->views(); } /** * Fires after the plugins list table in each tab of the Install Plugins screen. * * The dynamic portion of the hook name, `$tab`, allows for targeting * individual tabs. * * Possible hook names include: * * - `install_plugins_beta` * - `install_plugins_favorites` * - `install_plugins_featured` * - `install_plugins_plugin-information` * - `install_plugins_popular` * - `install_plugins_recommended` * - `install_plugins_search` * - `install_plugins_upload` * * @since 2.7.0 * * @param int $paged The current page number of the plugins list table. */ do_action( "install_plugins_{$tab}", $paged ); ?> <span class="spinner"></span> </div> <?php wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); /** * WordPress Administration Template Footer. */ require_once ABSPATH . 'wp-admin/admin-footer.php'; admin-footer.php 0000644 00000005422 15024324530 0007642 0 ustar 00 <?php /** * WordPress Administration Template Footer * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * @global string $hook_suffix */ global $hook_suffix; ?> <div class="clear"></div></div><!-- wpbody-content --> <div class="clear"></div></div><!-- wpbody --> <div class="clear"></div></div><!-- wpcontent --> <div id="wpfooter" role="contentinfo"> <?php /** * Fires after the opening tag for the admin footer. * * @since 2.5.0 */ do_action( 'in_admin_footer' ); ?> <p id="footer-left" class="alignleft"> <?php $text = sprintf( /* translators: %s: https://wordpress.org/ */ __( 'Thank you for creating with <a href="%s">WordPress</a>.' ), esc_url( __( 'https://wordpress.org/' ) ) ); /** * Filters the "Thank you" text displayed in the admin footer. * * @since 2.8.0 * * @param string $text The content that will be printed. */ echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . $text . '</span>' ); ?> </p> <p id="footer-upgrade" class="alignright"> <?php /** * Filters the version/update text displayed in the admin footer. * * WordPress prints the current version and update information, * using core_update_footer() at priority 10. * * @since 2.3.0 * * @see core_update_footer() * * @param string $content The content that will be printed. */ echo apply_filters( 'update_footer', '' ); ?> </p> <div class="clear"></div> </div> <?php /** * Prints scripts or data before the default footer scripts. * * @since 1.2.0 * * @param string $data The data to print. */ do_action( 'admin_footer', '' ); /** * Prints scripts and data queued for the footer. * * The dynamic portion of the hook name, `$hook_suffix`, * refers to the global hook suffix of the current page. * * @since 4.6.0 */ do_action( "admin_print_footer_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores /** * Prints any scripts and data queued for the footer. * * @since 2.8.0 */ do_action( 'admin_print_footer_scripts' ); /** * Prints scripts or data after the default footer scripts. * * The dynamic portion of the hook name, `$hook_suffix`, * refers to the global hook suffix of the current page. * * @since 2.8.0 */ do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores // get_site_option() won't exist when auto upgrading from <= 2.7. if ( function_exists( 'get_site_option' ) && false === get_site_option( 'can_compress_scripts' ) ) { compression_test(); } ?> <div class="clear"></div></div><!-- wpwrap --> <script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script> </body> </html> load-scripts.php 0000644 00000004026 15024324530 0007661 0 ustar 00 <?php /* * The error_reporting() function can be disabled in php.ini. On systems where that is the case, * it's best to add a dummy function to the wp-config.php file, but as this call to the function * is run prior to wp-config.php loading, it is wrapped in a function_exists() check. */ if ( function_exists( 'error_reporting' ) ) { /* * Disable error reporting. * * Set this to error_reporting( -1 ) for debugging. */ error_reporting( 0 ); } // Set ABSPATH for execution. if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } define( 'WPINC', 'wp-includes' ); $protocol = $_SERVER['SERVER_PROTOCOL']; if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) { $protocol = 'HTTP/1.0'; } $load = $_GET['load']; if ( is_array( $load ) ) { ksort( $load ); $load = implode( '', $load ); } $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load ); $load = array_unique( explode( ',', $load ) ); if ( empty( $load ) ) { header( "$protocol 400 Bad Request" ); exit; } require ABSPATH . 'wp-admin/includes/noop.php'; require ABSPATH . WPINC . '/script-loader.php'; require ABSPATH . WPINC . '/version.php'; $expires_offset = 31536000; // 1 year. $out = ''; $wp_scripts = new WP_Scripts(); wp_default_scripts( $wp_scripts ); wp_default_packages_vendor( $wp_scripts ); wp_default_packages_scripts( $wp_scripts ); $etag = $wp_scripts->get_etag( $load ); if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) { header( "$protocol 304 Not Modified" ); exit; } foreach ( $load as $handle ) { if ( ! array_key_exists( $handle, $wp_scripts->registered ) ) { continue; } $path = ABSPATH . $wp_scripts->registered[ $handle ]->src; $out .= get_file( $path ) . "\n"; } header( "Etag: $etag" ); header( 'Content-Type: application/javascript; charset=UTF-8' ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); header( "Cache-Control: public, max-age=$expires_offset" ); echo $out; exit; widgets-form.php 0000644 00000046251 15024324530 0007672 0 ustar 00 <?php /** * The classic widget administration screen, for use in widgets.php. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } $widgets_access = get_user_setting( 'widgets_access' ); if ( isset( $_GET['widgets-access'] ) ) { check_admin_referer( 'widgets-access' ); $widgets_access = 'on' === $_GET['widgets-access'] ? 'on' : 'off'; set_user_setting( 'widgets_access', $widgets_access ); } if ( 'on' === $widgets_access ) { add_filter( 'admin_body_class', 'wp_widgets_access_body_class' ); } else { wp_enqueue_script( 'admin-widgets' ); if ( wp_is_mobile() ) { wp_enqueue_script( 'jquery-touch-punch' ); } } /** * Fires early before the Widgets administration screen loads, * after scripts are enqueued. * * @since 2.2.0 */ do_action( 'sidebar_admin_setup' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p> <p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'removing-reusing', 'title' => __( 'Removing and Reusing' ), 'content' => '<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p> <p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.' ) . '</p> <p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'missing-widgets', 'title' => __( 'Missing Widgets' ), 'content' => '<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' . '<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-widgets-screen-classic-editor/">Documentation on Widgets</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); // These are the widgets grouped by sidebar. $sidebars_widgets = wp_get_sidebars_widgets(); if ( empty( $sidebars_widgets ) ) { $sidebars_widgets = wp_get_widget_defaults(); } foreach ( $sidebars_widgets as $sidebar_id => $widgets ) { if ( 'wp_inactive_widgets' === $sidebar_id ) { continue; } if ( ! is_registered_sidebar( $sidebar_id ) ) { if ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar. register_sidebar( array( 'name' => __( 'Inactive Sidebar (not used)' ), 'id' => $sidebar_id, 'class' => 'inactive-sidebar orphan-sidebar', 'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); } else { unset( $sidebars_widgets[ $sidebar_id ] ); } } } // Register the inactive_widgets area as sidebar. register_sidebar( array( 'name' => __( 'Inactive Widgets' ), 'id' => 'wp_inactive_widgets', 'class' => 'inactive-sidebar', 'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); retrieve_widgets(); // We're saving a widget without JS. if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) { $widget_id = $_POST['widget-id']; check_admin_referer( "save-delete-widget-$widget_id" ); $number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : ''; if ( $number ) { foreach ( $_POST as $key => $val ) { if ( is_array( $val ) && preg_match( '/__i__|%i%/', key( $val ) ) ) { $_POST[ $key ] = array( $number => array_shift( $val ) ); break; } } } $sidebar_id = $_POST['sidebar']; $position = isset( $_POST[ $sidebar_id . '_position' ] ) ? (int) $_POST[ $sidebar_id . '_position' ] - 1 : 0; $id_base = $_POST['id_base']; $sidebar = isset( $sidebars_widgets[ $sidebar_id ] ) ? $sidebars_widgets[ $sidebar_id ] : array(); // Delete. if ( isset( $_POST['removewidget'] ) && $_POST['removewidget'] ) { if ( ! in_array( $widget_id, $sidebar, true ) ) { wp_redirect( admin_url( 'widgets.php?error=0' ) ); exit; } $sidebar = array_diff( $sidebar, array( $widget_id ) ); $_POST = array( 'sidebar' => $sidebar_id, 'widget-' . $id_base => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1', ); /** * Fires immediately after a widget has been marked for deletion. * * @since 4.4.0 * * @param string $widget_id ID of the widget marked for deletion. * @param string $sidebar_id ID of the sidebar the widget was deleted from. * @param string $id_base ID base for the widget. */ do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base ); } $_POST['widget-id'] = $sidebar; foreach ( (array) $wp_registered_widget_updates as $name => $control ) { if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) { continue; } ob_start(); call_user_func_array( $control['callback'], $control['params'] ); ob_end_clean(); break; } $sidebars_widgets[ $sidebar_id ] = $sidebar; // Remove old position. if ( ! isset( $_POST['delete_widget'] ) ) { foreach ( $sidebars_widgets as $key => $sb ) { if ( is_array( $sb ) ) { $sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) ); } } array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id ); } wp_set_sidebars_widgets( $sidebars_widgets ); wp_redirect( admin_url( 'widgets.php?message=0' ) ); exit; } // Remove inactive widgets without JS. if ( isset( $_POST['removeinactivewidgets'] ) ) { check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); if ( $_POST['removeinactivewidgets'] ) { foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) { $pieces = explode( '-', $widget_id ); $multi_number = array_pop( $pieces ); $id_base = implode( '-', $pieces ); $widget = get_option( 'widget_' . $id_base ); unset( $widget[ $multi_number ] ); update_option( 'widget_' . $id_base, $widget ); unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] ); } wp_set_sidebars_widgets( $sidebars_widgets ); } wp_redirect( admin_url( 'widgets.php?message=0' ) ); exit; } // Output the widget form without JS. if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) { $widget_id = $_GET['editwidget']; if ( isset( $_GET['addnew'] ) ) { // Default to the first sidebar. $keys = array_keys( $wp_registered_sidebars ); $sidebar = reset( $keys ); if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // Multi-widget. // Copy minimal info from an existing instance of this widget to a new instance. foreach ( $wp_registered_widget_controls as $control ) { if ( $_GET['base'] === $control['id_base'] ) { $control_callback = $control['callback']; $multi_number = (int) $_GET['num']; $control['params'][0]['number'] = -1; $control['id'] = $control['id_base'] . '-' . $multi_number; $widget_id = $control['id']; $wp_registered_widget_controls[ $control['id'] ] = $control; break; } } } } if ( isset( $wp_registered_widget_controls[ $widget_id ] ) && ! isset( $control ) ) { $control = $wp_registered_widget_controls[ $widget_id ]; $control_callback = $control['callback']; } elseif ( ! isset( $wp_registered_widget_controls[ $widget_id ] ) && isset( $wp_registered_widgets[ $widget_id ] ) ) { $name = esc_html( strip_tags( $wp_registered_widgets[ $widget_id ]['name'] ) ); } if ( ! isset( $name ) ) { $name = esc_html( strip_tags( $control['name'] ) ); } if ( ! isset( $sidebar ) ) { $sidebar = isset( $_GET['sidebar'] ) ? $_GET['sidebar'] : 'wp_inactive_widgets'; } if ( ! isset( $multi_number ) ) { $multi_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : ''; } $id_base = isset( $control['id_base'] ) ? $control['id_base'] : $control['id']; // Show the widget form. $width = ' style="width:' . max( $control['width'], 350 ) . 'px"'; $key = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0; require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <div class="editwidget"<?php echo $width; ?>> <h2> <?php /* translators: %s: Widget name. */ printf( __( 'Widget %s' ), $name ); ?> </h2> <form action="widgets.php" method="post"> <div class="widget-inside"> <?php if ( is_callable( $control_callback ) ) { call_user_func_array( $control_callback, $control['params'] ); } else { echo '<p>' . __( 'There are no options for this widget.' ) . "</p>\n"; } ?> </div> <p class="describe"><?php _e( 'Select both the sidebar for this widget and the position of the widget in that sidebar.' ); ?></p> <div class="widget-position"> <table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody> <?php foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) { echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>"; if ( 'wp_inactive_widgets' === $sbname || str_starts_with( $sbname, 'orphaned_widgets' ) ) { echo ' '; } else { if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) { $j = 1; $sidebars_widgets[ $sbname ] = array(); } else { $j = count( $sidebars_widgets[ $sbname ] ); if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) { ++$j; } } $selected = ''; echo "\t\t<select name='{$sbname}_position'>\n"; echo "\t\t<option value=''>" . __( '— Select —' ) . "</option>\n"; for ( $i = 1; $i <= $j; $i++ ) { if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) { $selected = selected( $i, $key + 1, false ); } echo "\t\t<option value='$i'$selected> $i </option>\n"; } echo "\t\t</select>\n"; } echo "</td></tr>\n"; } ?> </tbody></table> </div> <div class="widget-control-actions"> <div class="alignleft"> <?php if ( ! isset( $_GET['addnew'] ) ) : ?> <input type="submit" name="removewidget" id="removewidget" class="button-link button-link-delete widget-control-remove" value="<?php esc_attr_e( 'Delete' ); ?>" /> <span class="widget-control-close-wrapper"> | <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a> </span> <?php else : ?> <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a> <?php endif; ?> </div> <div class="alignright"> <?php submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false ); ?> <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $widget_id ); ?>" /> <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" /> <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" /> <?php wp_nonce_field( "save-delete-widget-$widget_id" ); ?> </div> <br class="clear" /> </div> </form> </div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } $messages = array( __( 'Changes saved.' ), ); $errors = array( __( 'Error while saving.' ), __( 'Error in displaying the widget settings form.' ), ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <?php if ( current_user_can( 'customize' ) ) { printf( ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>', esc_url( add_query_arg( array( array( 'autofocus' => array( 'panel' => 'widgets' ) ), 'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), ), admin_url( 'customize.php' ) ) ), __( 'Manage with Live Preview' ) ); } $nonce = wp_create_nonce( 'widgets-access' ); ?> <div class="widget-access-link"> <a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Enable accessibility mode' ); ?></a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Disable accessibility mode' ); ?></a> </div> <hr class="wp-header-end"> <?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { wp_admin_notice( $messages[ $_GET['message'] ], array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { wp_admin_notice( $errors[ $_GET['error'] ], array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } /** * Fires before the Widgets administration page content loads. * * @since 3.0.0 */ do_action( 'widgets_admin_page' ); ?> <div class="widget-liquid-left"> <div id="widgets-left"> <div id="available-widgets" class="widgets-holder-wrap"> <div class="sidebar-name"> <button type="button" class="handlediv hide-if-no-js" aria-expanded="true"> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Available Widgets' ); ?> </span> <span class="toggle-indicator" aria-hidden="true"></span> </button> <h2><?php _e( 'Available Widgets' ); ?> <span id="removing-widget"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2> </div> <div class="widget-holder"> <div class="sidebar-description"> <p class="description"><?php _e( 'To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.' ); ?></p> </div> <div id="widget-list"> <?php wp_list_widgets(); ?> </div> <br class='clear' /> </div> <br class="clear" /> </div> <?php $theme_sidebars = array(); foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) { if ( str_contains( $registered_sidebar['class'], 'inactive-sidebar' ) || str_starts_with( $sidebar, 'orphaned_widgets' ) ) { $wrap_class = 'widgets-holder-wrap'; if ( ! empty( $registered_sidebar['class'] ) ) { $wrap_class .= ' ' . $registered_sidebar['class']; } $is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id']; ?> <div class="<?php echo esc_attr( $wrap_class ); ?>"> <div class="widget-holder inactive"> <?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?> <?php if ( $is_inactive_widgets ) { ?> <div class="remove-inactive-widgets"> <form method="post"> <p> <?php $attributes = array( 'id' => 'inactive-widgets-control-remove' ); if ( empty( $sidebars_widgets['wp_inactive_widgets'] ) ) { $attributes['disabled'] = ''; } submit_button( __( 'Clear Inactive Widgets' ), 'delete', 'removeinactivewidgets', false, $attributes ); ?> <span class="spinner"></span> </p> <?php wp_nonce_field( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); ?> </form> </div> <?php } ?> </div> <?php if ( $is_inactive_widgets ) { ?> <p class="description"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p> <?php } ?> </div> <?php } else { $theme_sidebars[ $sidebar ] = $registered_sidebar; } } ?> </div> </div> <?php $i = 0; $split = 0; $single_sidebar_class = ''; $sidebars_count = count( $theme_sidebars ); if ( $sidebars_count > 1 ) { $split = (int) ceil( $sidebars_count / 2 ); } else { $single_sidebar_class = ' single-sidebar'; } ?> <div class="widget-liquid-right"> <div id="widgets-right" class="wp-clearfix<?php echo $single_sidebar_class; ?>"> <div class="sidebars-column-1"> <?php foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) { $wrap_class = 'widgets-holder-wrap'; if ( ! empty( $registered_sidebar['class'] ) ) { $wrap_class .= ' sidebar-' . $registered_sidebar['class']; } if ( $i > 0 ) { $wrap_class .= ' closed'; } if ( $split && $i === $split ) { ?> </div><div class="sidebars-column-2"> <?php } ?> <div class="<?php echo esc_attr( $wrap_class ); ?>"> <?php // Show the control forms for each of the widgets in this sidebar. wp_list_widget_controls( $sidebar, $registered_sidebar['name'] ); ?> </div> <?php ++$i; } ?> </div> </div> </div> <form method="post"> <?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?> </form> <br class="clear" /> </div> <div class="widgets-chooser"> <ul class="widgets-chooser-sidebars"></ul> <div class="widgets-chooser-actions"> <button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button> <button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button> </div> </div> <?php /** * Fires after the available widgets and sidebars have loaded, before the admin footer. * * @since 2.2.0 */ do_action( 'sidebar_admin_page' ); require_once ABSPATH . 'wp-admin/admin-footer.php'; options-writing.php 0000644 00000022145 15024324530 0010433 0 ustar 00 <?php /** * Writing settings administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); } // Used in the HTML title tag. $title = __( 'Writing Settings' ); $parent_file = 'options-general.php'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can submit content in several different ways; this screen holds the settings for all of them. The top section controls the editor within the dashboard, while the rest control external publishing methods. For more information on any of these methods, use the documentation links.' ) . '</p>' . '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>', ) ); /** This filter is documented in wp-admin/options.php */ if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { get_current_screen()->add_help_tab( array( 'id' => 'options-postemail', 'title' => __( 'Post Via Email' ), 'content' => '<p>' . __( 'Post via email settings allow you to send your WordPress installation an email with the content of your post. You must set up a secret email account with POP3 access to use this, and any mail received at this address will be posted, so it’s a good idea to keep this address very secret.' ) . '</p>', ) ); } /** This filter is documented in wp-admin/options-writing.php */ if ( apply_filters( 'enable_update_services_configuration', true ) ) { get_current_screen()->add_help_tab( array( 'id' => 'options-services', 'title' => __( 'Update Services' ), 'content' => '<p>' . __( 'If desired, WordPress will automatically alert various services of your new posts.' ) . '</p>', ) ); } get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-writing-screen/">Documentation on Writing Settings</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); wp_enqueue_script( 'user-profile' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'writing' ); ?> <table class="form-table" role="presentation"> <?php if ( get_site_option( 'initial_db_version' ) < 32453 ) : ?> <tr> <th scope="row"><?php _e( 'Formatting' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Formatting' ); ?> </span></legend> <label for="use_smilies"> <input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> /> <?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br /> <label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label> </fieldset></td> </tr> <?php endif; ?> <tr> <th scope="row"><label for="default_category"><?php _e( 'Default Post Category' ); ?></label></th> <td> <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'default_category', 'orderby' => 'name', 'selected' => get_option( 'default_category' ), 'hierarchical' => true, ) ); ?> </td> </tr> <?php $post_formats = get_post_format_strings(); unset( $post_formats['standard'] ); ?> <tr> <th scope="row"><label for="default_post_format"><?php _e( 'Default Post Format' ); ?></label></th> <td> <select name="default_post_format" id="default_post_format"> <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> <?php foreach ( $post_formats as $format_slug => $format_name ) : ?> <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> <?php endforeach; ?> </select> </td> </tr> <?php if ( get_option( 'link_manager_enabled' ) ) : ?> <tr> <th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th> <td> <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'default_link_category', 'orderby' => 'name', 'selected' => get_option( 'default_link_category' ), 'hierarchical' => true, 'taxonomy' => 'link_category', ) ); ?> </td> </tr> <?php endif; ?> <?php do_settings_fields( 'writing', 'default' ); do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section. ?> </table> <?php /** This filter is documented in wp-admin/options.php */ if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { ?> <h2 class="title"><?php _e( 'Post via email' ); ?></h2> <p> <?php printf( /* translators: 1, 2, 3: Examples of random email addresses. */ __( 'To post to WordPress by email, you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it’s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ), sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ), sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ) ); ?> </p> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="mailserver_url"><?php _e( 'Mail Server' ); ?></label></th> <td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option( 'mailserver_url' ); ?>" class="regular-text code" /> <label for="mailserver_port"><?php _e( 'Port' ); ?></label> <input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option( 'mailserver_port' ); ?>" class="small-text" /> </td> </tr> <tr> <th scope="row"><label for="mailserver_login"><?php _e( 'Login Name' ); ?></label></th> <td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option( 'mailserver_login' ); ?>" class="regular-text ltr" /></td> </tr> <tr class="mailserver-pass-wrap"> <th scope="row"> <label for="mailserver_pass"> <?php _e( 'Password' ); ?> </label> </th> <td> <input type="hidden" value=" " /><!-- #24364 workaround --> <span class="wp-pwd"> <input type="text" name="mailserver_pass" id="mailserver_pass" class="regular-text ltr" autocomplete="off" data-reveal="1" data-pw="<?php echo esc_attr( get_option( 'mailserver_pass' ) ); ?>" /> <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> <span class="dashicons dashicons-visibility" aria-hidden="true"></span> </button> </span> </td> </tr> <tr> <th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th> <td> <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'default_email_category', 'orderby' => 'name', 'selected' => get_option( 'default_email_category' ), 'hierarchical' => true, ) ); ?> </td> </tr> <?php do_settings_fields( 'writing', 'post_via_email' ); ?> </table> <?php } ?> <?php /** * Filters whether to enable the Update Services section in the Writing settings screen. * * @since 3.0.0 * * @param bool $enable Whether to enable the Update Services settings area. Default true. */ if ( apply_filters( 'enable_update_services_configuration', true ) ) { ?> <h2 class="title"><?php _e( 'Update Services' ); ?></h2> <?php if ( '1' === get_option( 'blog_public' ) ) : ?> <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://developer.wordpress.org/advanced-administration/wordpress/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’s <a href="%2$s">visibility settings</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/update-services/' ), 'options-reading.php' ); ?> </p> <?php endif; ?> <?php } // enable_update_services_configuration ?> <?php do_settings_sections( 'writing' ); ?> <?php submit_button(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> edit-tag-form.php 0000644 00000024707 15024324530 0007724 0 ustar 00 <?php /** * Edit tag form for inclusion in administration panels. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } // Back compat hooks. if ( 'category' === $taxonomy ) { /** * Fires before the Edit Category form. * * @since 2.1.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. * * @param WP_Term $tag Current category term object. */ do_action_deprecated( 'edit_category_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' ); } elseif ( 'link_category' === $taxonomy ) { /** * Fires before the Edit Link Category form. * * @since 2.3.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. * * @param WP_Term $tag Current link category term object. */ do_action_deprecated( 'edit_link_category_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' ); } else { /** * Fires before the Edit Tag form. * * @since 2.5.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_edit_form'} instead. * * @param WP_Term $tag Current tag term object. */ do_action_deprecated( 'edit_tag_form_pre', array( $tag ), '3.0.0', '{$taxonomy}_pre_edit_form' ); } $wp_http_referer = ! empty( $_REQUEST['wp_http_referer'] ) ? sanitize_text_field( $_REQUEST['wp_http_referer'] ) : ''; $wp_http_referer = remove_query_arg( array( 'action', 'message', 'tag_ID' ), $wp_http_referer ); // Also used by Edit Tags. require_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php'; /** * Fires before the Edit Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to * the taxonomy slug. * * Possible hook names include: * * - `category_pre_edit_form` * - `post_tag_pre_edit_form` * * @since 3.0.0 * * @param WP_Term $tag Current taxonomy term object. * @param string $taxonomy Current $taxonomy slug. */ do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?> <div class="wrap"> <h1><?php echo $tax->labels->edit_item; ?></h1> <?php $class = ( isset( $_REQUEST['error'] ) ) ? 'error' : 'success'; if ( $message ) { $message = '<p><strong>' . $message . '</strong></p>'; if ( $wp_http_referer ) { $message .= sprintf( '<p><a href="%1$s">%2$s</a></p>', esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ), esc_html( $tax->labels->back_to_items ) ); } wp_admin_notice( $message, array( 'type' => $class, 'id' => 'message', 'paragraph_wrap' => false, ) ); } ?> <div id="ajax-response"></div> <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate" <?php /** * Fires inside the Edit Term form tag. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_term_edit_form_tag` * - `post_tag_term_edit_form_tag` * * @since 3.7.0 */ do_action( "{$taxonomy}_term_edit_form_tag" ); ?> > <input type="hidden" name="action" value="editedtag" /> <input type="hidden" name="tag_ID" value="<?php echo esc_attr( $tag_ID ); ?>" /> <input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" /> <?php wp_original_referer_field( true, 'previous' ); wp_nonce_field( 'update-tag_' . $tag_ID ); /** * Fires at the beginning of the Edit Term form. * * At this point, the required hidden fields and nonces have already been output. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_term_edit_form_top` * - `post_tag_term_edit_form_top` * * @since 4.5.0 * * @param WP_Term $tag Current taxonomy term object. * @param string $taxonomy Current $taxonomy slug. */ do_action( "{$taxonomy}_term_edit_form_top", $tag, $taxonomy ); $tag_name_value = ''; if ( isset( $tag->name ) ) { $tag_name_value = esc_attr( $tag->name ); } ?> <table class="form-table" role="presentation"> <tr class="form-field form-required term-name-wrap"> <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th> <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" aria-describedby="name-description" /> <p class="description" id="name-description"><?php echo $tax->labels->name_field_description; ?></p></td> </tr> <tr class="form-field term-slug-wrap"> <th scope="row"><label for="slug"><?php _e( 'Slug' ); ?></label></th> <?php /** * Filters the editable slug for a post or term. * * Note: This is a multi-use hook in that it is leveraged both for editable * post URIs and term slugs. * * @since 2.6.0 * @since 4.4.0 The `$tag` parameter was added. * * @param string $slug The editable slug. Will be either a term slug or post URI depending * upon the context in which it is evaluated. * @param WP_Term|WP_Post $tag Term or post object. */ $slug = isset( $tag->slug ) ? apply_filters( 'editable_slug', $tag->slug, $tag ) : ''; ?> <td><input name="slug" id="slug" type="text" value="<?php echo esc_attr( $slug ); ?>" size="40" aria-describedby="slug-description" /> <p class="description" id="slug-description"><?php echo $tax->labels->slug_field_description; ?></p></td> </tr> <?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?> <tr class="form-field term-parent-wrap"> <th scope="row"><label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label></th> <td> <?php $dropdown_args = array( 'hide_empty' => 0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'selected' => $tag->parent, 'exclude_tree' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __( 'None' ), 'aria_describedby' => 'parent-description', ); /** This filter is documented in wp-admin/edit-tags.php */ $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' ); wp_dropdown_categories( $dropdown_args ); ?> <?php if ( 'category' === $taxonomy ) : ?> <p class="description" id="parent-description"><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p> <?php else : ?> <p class="description" id="parent-description"><?php echo $tax->labels->parent_field_description; ?></p> <?php endif; ?> </td> </tr> <?php endif; // is_taxonomy_hierarchical() ?> <tr class="form-field term-description-wrap"> <th scope="row"><label for="description"><?php _e( 'Description' ); ?></label></th> <td><textarea name="description" id="description" rows="5" cols="50" class="large-text" aria-describedby="description-description"><?php echo $tag->description; // textarea_escaped ?></textarea> <p class="description" id="description-description"><?php echo $tax->labels->desc_field_description; ?></p></td> </tr> <?php // Back compat hooks. if ( 'category' === $taxonomy ) { /** * Fires after the Edit Category form fields are displayed. * * @since 2.9.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. * * @param WP_Term $tag Current category term object. */ do_action_deprecated( 'edit_category_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' ); } elseif ( 'link_category' === $taxonomy ) { /** * Fires after the Edit Link Category form fields are displayed. * * @since 2.9.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. * * @param WP_Term $tag Current link category term object. */ do_action_deprecated( 'edit_link_category_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' ); } else { /** * Fires after the Edit Tag form fields are displayed. * * @since 2.9.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form_fields'} instead. * * @param WP_Term $tag Current tag term object. */ do_action_deprecated( 'edit_tag_form_fields', array( $tag ), '3.0.0', '{$taxonomy}_edit_form_fields' ); } /** * Fires after the Edit Term form fields are displayed. * * The dynamic portion of the hook name, `$taxonomy`, refers to * the taxonomy slug. * * Possible hook names include: * * - `category_edit_form_fields` * - `post_tag_edit_form_fields` * * @since 3.0.0 * * @param WP_Term $tag Current taxonomy term object. * @param string $taxonomy Current taxonomy slug. */ do_action( "{$taxonomy}_edit_form_fields", $tag, $taxonomy ); ?> </table> <?php // Back compat hooks. if ( 'category' === $taxonomy ) { /** This action is documented in wp-admin/edit-tags.php */ do_action_deprecated( 'edit_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' ); } elseif ( 'link_category' === $taxonomy ) { /** This action is documented in wp-admin/edit-tags.php */ do_action_deprecated( 'edit_link_category_form', array( $tag ), '3.0.0', '{$taxonomy}_add_form' ); } else { /** * Fires at the end of the Edit Term form. * * @since 2.5.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_edit_form'} instead. * * @param WP_Term $tag Current taxonomy term object. */ do_action_deprecated( 'edit_tag_form', array( $tag ), '3.0.0', '{$taxonomy}_edit_form' ); } /** * Fires at the end of the Edit Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_edit_form` * - `post_tag_edit_form` * * @since 3.0.0 * * @param WP_Term $tag Current taxonomy term object. * @param string $taxonomy Current taxonomy slug. */ do_action( "{$taxonomy}_edit_form", $tag, $taxonomy ); ?> <div class="edit-tag-actions"> <?php submit_button( __( 'Update' ), 'primary', null, false ); ?> <?php if ( current_user_can( 'delete_term', $tag->term_id ) ) : ?> <span id="delete-link"> <a class="delete" href="<?php echo esc_url( admin_url( wp_nonce_url( "edit-tags.php?action=delete&taxonomy=$taxonomy&tag_ID=$tag->term_id", 'delete-tag_' . $tag->term_id ) ) ); ?>"><?php _e( 'Delete' ); ?></a> </span> <?php endif; ?> </div> </form> </div> <?php if ( ! wp_is_mobile() ) : ?> <script type="text/javascript"> try{document.forms.edittag.name.focus();}catch(e){} </script> <?php endif; menu-header.php 0000644 00000023525 15024324530 0007454 0 ustar 00 <?php /** * Displays Administration Menu. * * @package WordPress * @subpackage Administration */ /** * The current page. * * @global string $self */ $self = preg_replace( '|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF'] ); $self = preg_replace( '|^.*/wp-admin/|i', '', $self ); $self = preg_replace( '|^.*/plugins/|i', '', $self ); $self = preg_replace( '|^.*/mu-plugins/|i', '', $self ); /** * For when admin-header is included from within a function. * * @global array $menu * @global array $submenu * @global string $parent_file * @global string $submenu_file */ global $menu, $submenu, $parent_file, $submenu_file; /** * Filters the parent file of an admin menu sub-menu item. * * Allows plugins to move sub-menu items around. * * @since MU (3.0.0) * * @param string $parent_file The parent file. */ $parent_file = apply_filters( 'parent_file', $parent_file ); /** * Filters the file of an admin menu sub-menu item. * * @since 4.4.0 * * @param string $submenu_file The submenu file. * @param string $parent_file The submenu item's parent file. */ $submenu_file = apply_filters( 'submenu_file', $submenu_file, $parent_file ); get_admin_page_parent(); /** * Display menu. * * @access private * @since 2.7.0 * * @global string $self * @global string $parent_file * @global string $submenu_file * @global string $plugin_page * @global string $typenow The post type of the current screen. * * @param array $menu * @param array $submenu * @param bool $submenu_as_parent */ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { global $self, $parent_file, $submenu_file, $plugin_page, $typenow; $first = true; // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes, 5 = hookname, 6 = icon_url. foreach ( $menu as $key => $item ) { $admin_is_parent = false; $class = array(); $aria_attributes = ''; $aria_hidden = ''; $is_separator = false; if ( $first ) { $class[] = 'wp-first-item'; $first = false; } $submenu_items = array(); if ( ! empty( $submenu[ $item[2] ] ) ) { $class[] = 'wp-has-submenu'; $submenu_items = $submenu[ $item[2] ]; } if ( ( $parent_file && $item[2] === $parent_file ) || ( empty( $typenow ) && $self === $item[2] ) ) { if ( ! empty( $submenu_items ) ) { $class[] = 'wp-has-current-submenu wp-menu-open'; } else { $class[] = 'current'; $aria_attributes .= 'aria-current="page"'; } } else { $class[] = 'wp-not-current-submenu'; if ( ! empty( $submenu_items ) ) { $aria_attributes .= 'data-ariahaspopup'; } } if ( ! empty( $item[4] ) ) { $class[] = esc_attr( $item[4] ); } $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; $img = ''; $img_style = ''; $img_class = ' dashicons-before'; if ( str_contains( $class, 'wp-menu-separator' ) ) { $is_separator = true; } /* * If the string 'none' (previously 'div') is passed instead of a URL, don't output * the default menu image so an icon can be added to div.wp-menu-image as background * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled * as special cases. */ if ( ! empty( $item[6] ) ) { $img = '<img src="' . esc_url( $item[6] ) . '" alt="" />'; if ( 'none' === $item[6] || 'div' === $item[6] ) { $img = '<br />'; } elseif ( str_starts_with( $item[6], 'data:image/svg+xml;base64,' ) ) { $img = '<br />'; // The value is base64-encoded data, so esc_attr() is used here instead of esc_url(). $img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"'; $img_class = ' svg'; } elseif ( str_starts_with( $item[6], 'dashicons-' ) ) { $img = '<br />'; $img_class = ' dashicons-before ' . sanitize_html_class( $item[6] ); } } $arrow = '<div class="wp-menu-arrow"><div></div></div>'; $title = wptexturize( $item[0] ); // Hide separators from screen readers. if ( $is_separator ) { $aria_hidden = ' aria-hidden="true"'; } echo "\n\t<li$class$id$aria_hidden>"; if ( $is_separator ) { echo '<div class="separator"></div>'; } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) { $submenu_items = array_values( $submenu_items ); // Re-index. $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] ); $menu_file = $submenu_items[0][2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>$title</div></a>"; } else { echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>$title</div></a>"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); $menu_file = $item[2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; } else { echo "\n\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; } } if ( ! empty( $submenu_items ) ) { echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>"; echo "<li class='wp-submenu-head' aria-hidden='true'>{$item[0]}</li>"; $first = true; // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes. foreach ( $submenu_items as $sub_key => $sub_item ) { if ( ! current_user_can( $sub_item[1] ) ) { continue; } $class = array(); $aria_attributes = ''; if ( $first ) { $class[] = 'wp-first-item'; $first = false; } $menu_file = $item[2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } // Handle current for post_type=post|page|foo pages, which won't match $self. $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing'; if ( isset( $submenu_file ) ) { if ( $submenu_file === $sub_item[2] ) { $class[] = 'current'; $aria_attributes .= ' aria-current="page"'; } /* * If plugin_page is set the parent must either match the current page or not physically exist. * This allows plugin pages with the same hook to exist under different parents. */ } elseif ( ( ! isset( $plugin_page ) && $self === $sub_item[2] ) || ( isset( $plugin_page ) && $plugin_page === $sub_item[2] && ( $item[2] === $self_type || $item[2] === $self || file_exists( $menu_file ) === false ) ) ) { $class[] = 'current'; $aria_attributes .= ' aria-current="page"'; } if ( ! empty( $sub_item[4] ) ) { $class[] = esc_attr( $sub_item[4] ); } $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; $menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] ); $sub_file = $sub_item[2]; $pos = strpos( $sub_file, '?' ); if ( false !== $pos ) { $sub_file = substr( $sub_file, 0, $pos ); } $title = wptexturize( $sub_item[0] ); if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) { // If admin.php is the current page or if the parent exists as a file in the plugins or admin directory. if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) { $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] ); } else { $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' ); } $sub_item_url = esc_url( $sub_item_url ); echo "<li$class><a href='$sub_item_url'$class$aria_attributes>$title</a></li>"; } else { echo "<li$class><a href='{$sub_item[2]}'$class$aria_attributes>$title</a></li>"; } } echo '</ul>'; } echo '</li>'; } echo '<li id="collapse-menu" class="hide-if-no-js">' . '<button type="button" id="collapse-button" aria-label="' . esc_attr__( 'Collapse Main menu' ) . '" aria-expanded="true">' . '<span class="collapse-button-icon" aria-hidden="true"></span>' . '<span class="collapse-button-label">' . __( 'Collapse menu' ) . '</span>' . '</button></li>'; } ?> <div id="adminmenumain" role="navigation" aria-label="<?php esc_attr_e( 'Main menu' ); ?>"> <a href="#wpbody-content" class="screen-reader-shortcut"><?php _e( 'Skip to main content' ); ?></a> <a href="#wp-toolbar" class="screen-reader-shortcut"><?php _e( 'Skip to toolbar' ); ?></a> <div id="adminmenuback"></div> <div id="adminmenuwrap"> <ul id="adminmenu"> <?php _wp_menu_output( $menu, $submenu ); /** * Fires after the admin menu has been output. * * @since 2.5.0 */ do_action( 'adminmenu' ); ?> </ul> </div> </div> update-core.php 0000644 00000132667 15024324530 0007502 0 ustar 00 <?php /** * Update Core administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; wp_enqueue_style( 'plugin-install' ); wp_enqueue_script( 'plugin-install' ); wp_enqueue_script( 'updates' ); add_thickbox(); if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'update-core.php' ) ); exit; } if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) && ! current_user_can( 'update_languages' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } /** * Lists available core updates. * * @since 2.7.0 * * @global string $wp_local_package Locale code of the package. * @global wpdb $wpdb WordPress database abstraction object. * * @param object $update */ function list_core_update( $update ) { global $wp_local_package, $wpdb; static $first_pass = true; $wp_version = wp_get_wp_version(); $version_string = sprintf( '%s–%s', $update->current, get_locale() ); if ( 'en_US' === $update->locale && 'en_US' === get_locale() ) { $version_string = $update->current; } elseif ( 'en_US' === $update->locale && $update->packages->partial && $wp_version === $update->partial_version ) { $updates = get_core_updates(); if ( $updates && 1 === count( $updates ) ) { // If the only available update is a partial builds, it doesn't need a language-specific version string. $version_string = $update->current; } } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() ) { $version_string = sprintf( '%s–%s', $update->current, $update->locale ); } $current = false; if ( ! isset( $update->response ) || 'latest' === $update->response ) { $current = true; } $message = ''; $form_action = 'update-core.php?action=do-core-upgrade'; $php_version = PHP_VERSION; $mysql_version = $wpdb->db_version(); $show_buttons = true; // Nightly build versions have two hyphens and a commit number. if ( preg_match( '/-\w+-\d+/', $update->current ) ) { // Retrieve the major version number. preg_match( '/^\d+.\d+/', $update->current, $update_major ); /* translators: %s: WordPress version. */ $submit = sprintf( __( 'Update to latest %s nightly' ), $update_major[0] ); } else { /* translators: %s: WordPress version. */ $submit = sprintf( __( 'Update to version %s' ), $version_string ); } if ( 'development' === $update->response ) { $message = __( 'You can update to the latest nightly build manually:' ); } else { if ( $current ) { /* translators: %s: WordPress version. */ $submit = sprintf( __( 'Re-install version %s' ), $version_string ); $form_action = 'update-core.php?action=do-core-reinstall'; } else { $php_compat = version_compare( $php_version, $update->php_version, '>=' ); if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) { $mysql_compat = true; } else { $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ); } $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $update->current ) ); $php_update_message = '</p><p>' . sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $php_update_message .= '</p><p><em>' . $annotation . '</em>'; } if ( ! $mysql_compat && ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $update->current, $update->mysql_version, $mysql_version ); } else { $message = sprintf( /* translators: 1: Installed WordPress version number, 2: URL to WordPress release notes, 3: New WordPress version number, including locale if necessary. */ __( 'You can update from WordPress %1$s to <a href="%2$s">WordPress %3$s</a> manually:' ), $wp_version, $version_url, $version_string ); } if ( ! $mysql_compat || ! $php_compat ) { $show_buttons = false; } } } echo '<p>'; echo $message; echo '</p>'; echo '<form method="post" action="' . esc_url( $form_action ) . '" name="upgrade" class="upgrade">'; wp_nonce_field( 'upgrade-core' ); echo '<p>'; echo '<input name="version" value="' . esc_attr( $update->current ) . '" type="hidden" />'; echo '<input name="locale" value="' . esc_attr( $update->locale ) . '" type="hidden" />'; if ( $show_buttons ) { if ( $first_pass ) { submit_button( $submit, $current ? '' : 'primary regular', 'upgrade', false ); $first_pass = false; } else { submit_button( $submit, '', 'upgrade', false ); } } if ( 'en_US' !== $update->locale ) { if ( ! isset( $update->dismissed ) || ! $update->dismissed ) { submit_button( __( 'Hide this update' ), '', 'dismiss', false ); } else { submit_button( __( 'Bring back this update' ), '', 'undismiss', false ); } } echo '</p>'; if ( 'en_US' !== $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package !== $update->locale ) ) { echo '<p class="hint">' . __( 'This localized version contains both the translation and various other localization fixes.' ) . '</p>'; } elseif ( 'en_US' === $update->locale && 'en_US' !== get_locale() && ( ! $update->packages->partial && $wp_version === $update->partial_version ) ) { // Partial builds don't need language-specific warnings. echo '<p class="hint">' . sprintf( /* translators: %s: WordPress version. */ __( 'You are about to install WordPress %s <strong>in English (US)</strong>. There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), 'development' !== $update->response ? $update->current : '' ) . '</p>'; } echo '</form>'; } /** * Display dismissed updates. * * @since 2.7.0 */ function dismissed_updates() { $dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false, ) ); if ( $dismissed ) { $show_text = esc_js( __( 'Show hidden updates' ) ); $hide_text = esc_js( __( 'Hide hidden updates' ) ); ?> <script type="text/javascript"> jQuery( function( $ ) { $( '#show-dismissed' ).on( 'click', function() { var isExpanded = ( 'true' === $( this ).attr( 'aria-expanded' ) ); if ( isExpanded ) { $( this ).text( '<?php echo $show_text; ?>' ).attr( 'aria-expanded', 'false' ); } else { $( this ).text( '<?php echo $hide_text; ?>' ).attr( 'aria-expanded', 'true' ); } $( '#dismissed-updates' ).toggle( 'fast' ); }); }); </script> <?php echo '<p class="hide-if-no-js"><button type="button" class="button" id="show-dismissed" aria-expanded="false">' . __( 'Show hidden updates' ) . '</button></p>'; echo '<ul id="dismissed-updates" class="core-updates dismissed">'; foreach ( (array) $dismissed as $update ) { echo '<li>'; list_core_update( $update ); echo '</li>'; } echo '</ul>'; } } /** * Display upgrade WordPress for downloading latest or upgrading automatically form. * * @since 2.7.0 */ function core_upgrade_preamble() { $updates = get_core_updates(); // Include an unmodified $wp_version. require ABSPATH . WPINC . '/version.php'; $is_development_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { echo '<h2 class="response">'; _e( 'An updated version of WordPress is available.' ); echo '</h2>'; $message = sprintf( /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */ __( '<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.' ), __( 'https://developer.wordpress.org/advanced-administration/security/backup/' ), __( 'https://wordpress.org/documentation/article/updating-wordpress/' ) ); wp_admin_notice( $message, array( 'type' => 'warning', 'additional_classes' => array( 'inline' ), ) ); } elseif ( $is_development_version ) { echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>'; } else { echo '<h2 class="response">' . __( 'You have the latest version of WordPress.' ) . '</h2>'; } echo '<ul class="core-updates">'; foreach ( (array) $updates as $update ) { echo '<li>'; list_core_update( $update ); echo '</li>'; } echo '</ul>'; // Don't show the maintenance mode notice when we are only showing a single re-install option. if ( $updates && ( count( $updates ) > 1 || 'latest' !== $updates[0]->response ) ) { echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, this mode will be deactivated.' ) . '</p>'; } elseif ( ! $updates ) { list( $normalized_version ) = explode( '-', $wp_version ); echo '<p>' . sprintf( /* translators: 1: URL to About screen, 2: WordPress version. */ __( '<a href="%1$s">Learn more about WordPress %2$s</a>.' ), esc_url( self_admin_url( 'about.php' ) ), $normalized_version ) . '</p>'; } dismissed_updates(); } /** * Display WordPress auto-updates settings. * * @since 5.6.0 */ function core_auto_updates_settings() { if ( isset( $_GET['core-major-auto-updates-saved'] ) ) { if ( 'enabled' === $_GET['core-major-auto-updates-saved'] ) { $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' ); wp_admin_notice( $notice_text, array( 'type' => 'success', 'dismissible' => true, ) ); } elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) { $notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' ); wp_admin_notice( $notice_text, array( 'type' => 'success', 'dismissible' => true, ) ); } } require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $updater = new WP_Automatic_Updater(); // Defaults: $upgrade_dev = get_site_option( 'auto_update_core_dev', 'enabled' ) === 'enabled'; $upgrade_minor = get_site_option( 'auto_update_core_minor', 'enabled' ) === 'enabled'; $upgrade_major = get_site_option( 'auto_update_core_major', 'unset' ) === 'enabled'; $can_set_update_option = true; // WP_AUTO_UPDATE_CORE = true (all), 'beta', 'rc', 'development', 'branch-development', 'minor', false. if ( defined( 'WP_AUTO_UPDATE_CORE' ) ) { if ( false === WP_AUTO_UPDATE_CORE ) { // Defaults to turned off, unless a filter allows it. $upgrade_dev = false; $upgrade_minor = false; $upgrade_major = false; } elseif ( true === WP_AUTO_UPDATE_CORE || in_array( WP_AUTO_UPDATE_CORE, array( 'beta', 'rc', 'development', 'branch-development' ), true ) ) { // ALL updates for core. $upgrade_dev = true; $upgrade_minor = true; $upgrade_major = true; } elseif ( 'minor' === WP_AUTO_UPDATE_CORE ) { // Only minor updates for core. $upgrade_dev = false; $upgrade_minor = true; $upgrade_major = false; } // The UI is overridden by the `WP_AUTO_UPDATE_CORE` constant. $can_set_update_option = false; } if ( $updater->is_disabled() ) { $upgrade_dev = false; $upgrade_minor = false; $upgrade_major = false; /* * The UI is overridden by the `AUTOMATIC_UPDATER_DISABLED` constant * or the `automatic_updater_disabled` filter, * or by `wp_is_file_mod_allowed( 'automatic_updater' )`. * See `WP_Automatic_Updater::is_disabled()`. */ $can_set_update_option = false; } // Is the UI overridden by a plugin using the `allow_major_auto_core_updates` filter? if ( has_filter( 'allow_major_auto_core_updates' ) ) { $can_set_update_option = false; } /** This filter is documented in wp-admin/includes/class-core-upgrader.php */ $upgrade_dev = apply_filters( 'allow_dev_auto_core_updates', $upgrade_dev ); /** This filter is documented in wp-admin/includes/class-core-upgrader.php */ $upgrade_minor = apply_filters( 'allow_minor_auto_core_updates', $upgrade_minor ); /** This filter is documented in wp-admin/includes/class-core-upgrader.php */ $upgrade_major = apply_filters( 'allow_major_auto_core_updates', $upgrade_major ); $auto_update_settings = array( 'dev' => $upgrade_dev, 'minor' => $upgrade_minor, 'major' => $upgrade_major, ); if ( $upgrade_major ) { $wp_version = wp_get_wp_version(); $updates = get_core_updates(); if ( isset( $updates[0]->version ) && version_compare( $updates[0]->version, $wp_version, '>' ) ) { echo '<p>' . wp_get_auto_update_message() . '</p>'; } } $action_url = self_admin_url( 'update-core.php?action=core-major-auto-updates-settings' ); ?> <p class="auto-update-status"> <?php if ( $updater->is_vcs_checkout( ABSPATH ) ) { _e( 'This site appears to be under version control. Automatic updates are disabled.' ); } elseif ( $upgrade_major ) { _e( 'This site is automatically kept up to date with each new version of WordPress.' ); if ( $can_set_update_option ) { echo '<br />'; printf( '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-disable">%s</a>', wp_nonce_url( add_query_arg( 'value', 'disable', $action_url ), 'core-major-auto-updates-nonce' ), __( 'Switch to automatic updates for maintenance and security releases only.' ) ); } } elseif ( $upgrade_minor ) { _e( 'This site is automatically kept up to date with maintenance and security releases of WordPress only.' ); if ( $can_set_update_option ) { echo '<br />'; printf( '<a href="%s" class="core-auto-update-settings-link core-auto-update-settings-link-enable">%s</a>', wp_nonce_url( add_query_arg( 'value', 'enable', $action_url ), 'core-major-auto-updates-nonce' ), __( 'Enable automatic updates for all new versions of WordPress.' ) ); } } else { _e( 'This site will not receive automatic updates for new versions of WordPress.' ); } ?> </p> <?php /** * Fires after the major core auto-update settings. * * @since 5.6.0 * * @param array $auto_update_settings { * Array of core auto-update settings. * * @type bool $dev Whether to enable automatic updates for development versions. * @type bool $minor Whether to enable minor automatic core updates. * @type bool $major Whether to enable major automatic core updates. * } */ do_action( 'after_core_auto_updates_settings', $auto_update_settings ); } /** * Display the upgrade plugins form. * * @since 2.9.0 */ function list_plugin_updates() { $wp_version = wp_get_wp_version(); $cur_wp_version = preg_replace( '/-.*$/', '', $wp_version ); require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $plugins = get_plugin_updates(); if ( empty( $plugins ) ) { echo '<h2>' . __( 'Plugins' ) . '</h2>'; echo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>'; return; } $form_action = 'update-core.php?action=do-plugin-upgrade'; $core_updates = get_core_updates(); if ( ! isset( $core_updates[0]->response ) || 'latest' === $core_updates[0]->response || 'development' === $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=' ) ) { $core_update_version = false; } else { $core_update_version = $core_updates[0]->current; } $plugins_count = count( $plugins ); ?> <h2> <?php printf( '%s <span class="count">(%d)</span>', __( 'Plugins' ), number_format_i18n( $plugins_count ) ); ?> </h2> <p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click “Update Plugins”.' ); ?></p> <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade"> <?php wp_nonce_field( 'upgrade-core' ); ?> <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p> <table class="widefat updates-table" id="update-plugins-table"> <thead> <tr> <td class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></td> <td class="manage-column"><label for="plugins-select-all"><?php _e( 'Select All' ); ?></label></td> </tr> </thead> <tbody class="plugins"> <?php $auto_updates = array(); if ( wp_is_auto_update_enabled_for_type( 'plugin' ) ) { $auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); $auto_update_notice = ' | ' . wp_get_auto_update_message(); } foreach ( (array) $plugins as $plugin_file => $plugin_data ) { $plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true ); $icon = '<span class="dashicons dashicons-admin-plugins"></span>'; $preferred_icons = array( 'svg', '2x', '1x', 'default' ); foreach ( $preferred_icons as $preferred_icon ) { if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) { $icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />'; break; } } // Get plugin compat for running version of WordPress. if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) { /* translators: %s: WordPress version. */ $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $cur_wp_version ); } else { /* translators: %s: WordPress version. */ $compat = '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $cur_wp_version ); } // Get plugin compat for updated version of WordPress. if ( $core_update_version ) { if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) { /* translators: %s: WordPress version. */ $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: 100%% (according to its author)' ), $core_update_version ); } else { /* translators: %s: WordPress version. */ $compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %s: Unknown' ), $core_update_version ); } } $requires_php = isset( $plugin_data->update->requires_php ) ? $plugin_data->update->requires_php : null; $compatible_php = is_php_version_compatible( $requires_php ); if ( ! $compatible_php && current_user_can( 'update_php' ) ) { $compat .= '<br />' . __( 'This update does not work with your version of PHP.' ) . ' '; $compat .= sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $compat .= '</p><p><em>' . $annotation . '</em>'; } } // Get the upgrade notice for the new plugin version. if ( isset( $plugin_data->update->upgrade_notice ) ) { $upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice ); } else { $upgrade_notice = ''; } $details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '§ion=changelog&TB_iframe=true&width=640&height=662' ); $details = sprintf( '<a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>', esc_url( $details_url ), /* translators: 1: Plugin name, 2: Version number. */ esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_data->Name, $plugin_data->update->new_version ) ), /* translators: %s: Plugin version. */ sprintf( __( 'View version %s details.' ), $plugin_data->update->new_version ) ); $checkbox_id = 'checkbox_' . md5( $plugin_file ); ?> <tr> <td class="check-column"> <?php if ( $compatible_php ) : ?> <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" /> <label for="<?php echo $checkbox_id; ?>"> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. %s: Plugin name. */ printf( __( 'Select %s' ), $plugin_data->Name ); ?> </span> </label> <?php endif; ?> </td> <td class="plugin-title"><p> <?php echo $icon; ?> <strong><?php echo $plugin_data->Name; ?></strong> <?php printf( /* translators: 1: Plugin version, 2: New version. */ __( 'You have version %1$s installed. Update to %2$s.' ), $plugin_data->Version, $plugin_data->update->new_version ); echo ' ' . $details . $compat; if ( in_array( $plugin_file, $auto_updates, true ) ) { echo $auto_update_notice; } echo $upgrade_notice; ?> </p></td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></td> <td class="manage-column"><label for="plugins-select-all-2"><?php _e( 'Select All' ); ?></label></td> </tr> </tfoot> </table> <p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p> </form> <?php } /** * Display the upgrade themes form. * * @since 2.9.0 */ function list_theme_updates() { $themes = get_theme_updates(); if ( empty( $themes ) ) { echo '<h2>' . __( 'Themes' ) . '</h2>'; echo '<p>' . __( 'Your themes are all up to date.' ) . '</p>'; return; } $form_action = 'update-core.php?action=do-theme-upgrade'; $themes_count = count( $themes ); ?> <h2> <?php printf( '%s <span class="count">(%d)</span>', __( 'Themes' ), number_format_i18n( $themes_count ) ); ?> </h2> <p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p> <p> <?php printf( /* translators: %s: Link to documentation on child themes. */ __( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.' ), __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) ); ?> </p> <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade"> <?php wp_nonce_field( 'upgrade-core' ); ?> <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p> <table class="widefat updates-table" id="update-themes-table"> <thead> <tr> <td class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></td> <td class="manage-column"><label for="themes-select-all"><?php _e( 'Select All' ); ?></label></td> </tr> </thead> <tbody class="plugins"> <?php $auto_updates = array(); if ( wp_is_auto_update_enabled_for_type( 'theme' ) ) { $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); $auto_update_notice = ' | ' . wp_get_auto_update_message(); } foreach ( $themes as $stylesheet => $theme ) { $requires_wp = isset( $theme->update['requires'] ) ? $theme->update['requires'] : null; $requires_php = isset( $theme->update['requires_php'] ) ? $theme->update['requires_php'] : null; $compatible_wp = is_wp_version_compatible( $requires_wp ); $compatible_php = is_php_version_compatible( $requires_php ); $compat = ''; if ( ! $compatible_wp && ! $compatible_php ) { $compat .= '<br />' . __( 'This update does not work with your versions of WordPress and PHP.' ) . ' '; if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $compat .= sprintf( /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), esc_url( self_admin_url( 'update-core.php' ) ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $compat .= '</p><p><em>' . $annotation . '</em>'; } } elseif ( current_user_can( 'update_core' ) ) { $compat .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ __( '<a href="%s">Please update WordPress</a>.' ), esc_url( self_admin_url( 'update-core.php' ) ) ); } elseif ( current_user_can( 'update_php' ) ) { $compat .= sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $compat .= '</p><p><em>' . $annotation . '</em>'; } } } elseif ( ! $compatible_wp ) { $compat .= '<br />' . __( 'This update does not work with your version of WordPress.' ) . ' '; if ( current_user_can( 'update_core' ) ) { $compat .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ __( '<a href="%s">Please update WordPress</a>.' ), esc_url( self_admin_url( 'update-core.php' ) ) ); } } elseif ( ! $compatible_php ) { $compat .= '<br />' . __( 'This update does not work with your version of PHP.' ) . ' '; if ( current_user_can( 'update_php' ) ) { $compat .= sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $compat .= '</p><p><em>' . $annotation . '</em>'; } } } $checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) ); ?> <tr> <td class="check-column"> <?php if ( $compatible_wp && $compatible_php ) : ?> <input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $stylesheet ); ?>" /> <label for="<?php echo $checkbox_id; ?>"> <span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. %s: Theme name. */ printf( __( 'Select %s' ), $theme->display( 'Name' ) ); ?> </span> </label> <?php endif; ?> </td> <td class="plugin-title"><p> <img src="<?php echo esc_url( $theme->get_screenshot() . '?ver=' . $theme->version ); ?>" width="85" height="64" class="updates-table-screenshot" alt="" /> <strong><?php echo $theme->display( 'Name' ); ?></strong> <?php printf( /* translators: 1: Theme version, 2: New version. */ __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display( 'Version' ), $theme->update['new_version'] ); echo ' ' . $compat; if ( in_array( $stylesheet, $auto_updates, true ) ) { echo $auto_update_notice; } ?> </p></td> </tr> <?php } ?> </tbody> <tfoot> <tr> <td class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></td> <td class="manage-column"><label for="themes-select-all-2"><?php _e( 'Select All' ); ?></label></td> </tr> </tfoot> </table> <p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p> </form> <?php } /** * Display the update translations form. * * @since 3.7.0 */ function list_translation_updates() { $updates = wp_get_translation_updates(); if ( ! $updates ) { if ( 'en_US' !== get_locale() ) { echo '<h2>' . __( 'Translations' ) . '</h2>'; echo '<p>' . __( 'Your translations are all up to date.' ) . '</p>'; } return; } $form_action = 'update-core.php?action=do-translation-upgrade'; ?> <h2><?php _e( 'Translations' ); ?></h2> <form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-translations" class="upgrade"> <p><?php _e( 'New translations are available.' ); ?></p> <?php wp_nonce_field( 'upgrade-translations' ); ?> <p><input class="button" type="submit" value="<?php esc_attr_e( 'Update Translations' ); ?>" name="upgrade" /></p> </form> <?php } /** * Upgrades WordPress core display. * * @since 2.7.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param bool $reinstall */ function do_core_upgrade( $reinstall = false ) { global $wp_filesystem; require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; if ( $reinstall ) { $url = 'update-core.php?action=do-core-reinstall'; } else { $url = 'update-core.php?action=do-core-upgrade'; } $url = wp_nonce_url( $url, 'upgrade-core' ); $version = isset( $_POST['version'] ) ? $_POST['version'] : false; $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US'; $update = find_core_update( $version, $locale ); if ( ! $update ) { return; } /* * Allow relaxed file ownership writes for User-initiated upgrades when the API specifies * that it's safe to do so. This only happens when there are no new files to create. */ $allow_relaxed_file_ownership = ! $reinstall && isset( $update->new_files ) && ! $update->new_files; ?> <div class="wrap"> <h1><?php _e( 'Update WordPress' ); ?></h1> <?php $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ); if ( false === $credentials ) { echo '</div>'; return; } if ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) { // Failed to connect. Error and request again. request_filesystem_credentials( $url, '', true, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ); echo '</div>'; return; } if ( $wp_filesystem->errors->has_errors() ) { foreach ( $wp_filesystem->errors->get_error_messages() as $message ) { show_message( $message ); } echo '</div>'; return; } if ( $reinstall ) { $update->response = 'reinstall'; } add_filter( 'update_feedback', 'show_message' ); $upgrader = new Core_Upgrader(); $result = $upgrader->upgrade( $update, array( 'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership, ) ); if ( is_wp_error( $result ) ) { show_message( $result ); if ( 'up_to_date' !== $result->get_error_code() && 'locked' !== $result->get_error_code() ) { show_message( __( 'Installation failed.' ) ); } echo '</div>'; return; } show_message( __( 'WordPress updated successfully.' ) ); show_message( '<span class="hide-if-no-js">' . sprintf( /* translators: 1: WordPress version, 2: URL to About screen. */ __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' ); show_message( '<span class="hide-if-js">' . sprintf( /* translators: 1: WordPress version, 2: URL to About screen. */ __( 'Welcome to WordPress %1$s. <a href="%2$s">Learn more</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' ); ?> </div> <script type="text/javascript"> window.location = '<?php echo esc_url( self_admin_url( 'about.php?updated' ) ); ?>'; </script> <?php } /** * Dismiss a core update. * * @since 2.7.0 */ function do_dismiss_core_update() { $version = isset( $_POST['version'] ) ? $_POST['version'] : false; $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US'; $update = find_core_update( $version, $locale ); if ( ! $update ) { return; } dismiss_core_update( $update ); wp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) ); exit; } /** * Undismiss a core update. * * @since 2.7.0 */ function do_undismiss_core_update() { $version = isset( $_POST['version'] ) ? $_POST['version'] : false; $locale = isset( $_POST['locale'] ) ? $_POST['locale'] : 'en_US'; $update = find_core_update( $version, $locale ); if ( ! $update ) { return; } undismiss_core_update( $version, $locale ); wp_redirect( wp_nonce_url( 'update-core.php?action=upgrade-core', 'upgrade-core' ) ); exit; } $action = isset( $_GET['action'] ) ? $_GET['action'] : 'upgrade-core'; $upgrade_error = false; if ( ( 'do-theme-upgrade' === $action || ( 'do-plugin-upgrade' === $action && ! isset( $_GET['plugins'] ) ) ) && ! isset( $_POST['checked'] ) ) { $upgrade_error = ( 'do-theme-upgrade' === $action ) ? 'themes' : 'plugins'; $action = 'upgrade-core'; } $title = __( 'WordPress Updates' ); $parent_file = 'index.php'; $updates_overview = '<p>' . __( 'On this screen, you can update to the latest version of WordPress, as well as update your themes, plugins, and translations from the WordPress.org repositories.' ) . '</p>'; $updates_overview .= '<p>' . __( 'If an update is available, you᾿ll see a notification appear in the Toolbar and navigation menu.' ) . ' ' . __( 'Keeping your site updated is important for security. It also makes the internet a safer place for you and your readers.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $updates_overview, ) ); $updates_howto = '<p>' . __( '<strong>WordPress</strong> — Updating your WordPress installation is a simple one-click procedure: just <strong>click on the “Update now” button</strong> when you are notified that a new version is available.' ) . ' ' . __( 'In most cases, WordPress will automatically apply maintenance and security updates in the background for you.' ) . '</p>'; $updates_howto .= '<p>' . __( '<strong>Themes and Plugins</strong> — To update individual themes or plugins from this screen, use the checkboxes to make your selection, then <strong>click on the appropriate “Update” button</strong>. To update all of your themes or plugins at once, you can check the box at the top of the section to select all before clicking the update button.' ) . '</p>'; if ( 'en_US' !== get_locale() ) { $updates_howto .= '<p>' . __( '<strong>Translations</strong> — The files translating WordPress into your language are updated for you whenever any other updates occur. But if these files are out of date, you can <strong>click the “Update Translations”</strong> button.' ) . '</p>'; } get_current_screen()->add_help_tab( array( 'id' => 'how-to-update', 'title' => __( 'How to Update' ), 'content' => $updates_howto, ) ); $help_sidebar_autoupdates = ''; if ( ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) || ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) ) { $help_tab_autoupdates = '<p>' . __( 'Auto-updates can be enabled or disabled for WordPress major versions and for each individual theme or plugin. Themes or plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>'; $help_tab_autoupdates .= '<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'plugins-themes-auto-updates', 'title' => __( 'Auto-updates' ), 'content' => $help_tab_autoupdates, ) ); $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>'; } $help_sidebar_rollback = ''; if ( current_user_can( 'update_themes' ) || current_user_can( 'update_plugins' ) ) { $rollback_help = '<p>' . __( 'This feature will create a temporary backup of a plugin or theme before it is upgraded. This backup is used to restore the plugin or theme back to its previous state if there is an error during the update process.' ) . '</p>'; $rollback_help .= '<p>' . __( 'On systems with fewer resources, this may lead to server timeouts or resource limits being reached. If you encounter an issue during the update process, please create a support forum topic and reference <strong>Rollback</strong> in the issue title.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'rollback-plugins-themes', 'title' => __( 'Restore Plugin or Theme' ), 'content' => $rollback_help, ) ); $help_sidebar_rollback = '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/wordpress/common-errors/">Common Errors</a>' ) . '</p>'; } get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/dashboard-updates-screen/">Documentation on Updating WordPress</a>' ) . '</p>' . $help_sidebar_autoupdates . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' . $help_sidebar_rollback ); if ( 'upgrade-core' === $action ) { // Force an update check when requested. $force_check = ! empty( $_GET['force-check'] ); wp_version_check( array(), $force_check ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php _e( 'WordPress Updates' ); ?></h1> <p><?php _e( 'Updates may take several minutes to complete. If there is no feedback after 5 minutes, or if there are errors please refer to the Help section above.' ); ?></p> <?php if ( $upgrade_error ) { if ( 'themes' === $upgrade_error ) { $theme_updates = get_theme_updates(); if ( ! empty( $theme_updates ) ) { wp_admin_notice( __( 'Please select one or more themes to update.' ), array( 'additional_classes' => array( 'error' ), ) ); } } else { $plugin_updates = get_plugin_updates(); if ( ! empty( $plugin_updates ) ) { wp_admin_notice( __( 'Please select one or more plugins to update.' ), array( 'additional_classes' => array( 'error' ), ) ); } } } $last_update_check = false; $current = get_site_transient( 'update_core' ); if ( $current && isset( $current->last_checked ) ) { $last_update_check = $current->last_checked + (int) ( (float) get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); } echo '<h2 class="wp-current-version">'; /* translators: Current version of WordPress. */ printf( __( 'Current version: %s' ), esc_html( wp_get_wp_version() ) ); echo '</h2>'; echo '<p class="update-last-checked">'; printf( /* translators: 1: Date, 2: Time. */ __( 'Last checked on %1$s at %2$s.' ), /* translators: Last update date format. See https://www.php.net/manual/datetime.format.php */ date_i18n( __( 'F j, Y' ), $last_update_check ), /* translators: Last update time format. See https://www.php.net/manual/datetime.format.php */ date_i18n( __( 'g:i a T' ), $last_update_check ) ); echo ' <a href="' . esc_url( self_admin_url( 'update-core.php?force-check=1' ) ) . '">' . __( 'Check again.' ) . '</a>'; echo '</p>'; if ( current_user_can( 'update_core' ) ) { core_auto_updates_settings(); core_upgrade_preamble(); } if ( current_user_can( 'update_plugins' ) ) { list_plugin_updates(); } if ( current_user_can( 'update_themes' ) ) { list_theme_updates(); } if ( current_user_can( 'update_languages' ) ) { list_translation_updates(); } /** * Fires after the core, plugin, and theme update tables. * * @since 2.9.0 */ do_action( 'core_upgrade_preamble' ); echo '</div>'; wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-core-upgrade' === $action || 'do-core-reinstall' === $action ) { if ( ! current_user_can( 'update_core' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } check_admin_referer( 'upgrade-core' ); // Do the (un)dismiss actions before headers, so that they can redirect. if ( isset( $_POST['dismiss'] ) ) { do_dismiss_core_update(); } elseif ( isset( $_POST['undismiss'] ) ) { do_undismiss_core_update(); } require_once ABSPATH . 'wp-admin/admin-header.php'; if ( 'do-core-reinstall' === $action ) { $reinstall = true; } else { $reinstall = false; } if ( isset( $_POST['upgrade'] ) ) { do_core_upgrade( $reinstall ); } wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-plugin-upgrade' === $action ) { if ( ! current_user_can( 'update_plugins' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } check_admin_referer( 'upgrade-core' ); if ( isset( $_GET['plugins'] ) ) { $plugins = explode( ',', $_GET['plugins'] ); } elseif ( isset( $_POST['checked'] ) ) { $plugins = (array) $_POST['checked']; } else { wp_redirect( admin_url( 'update-core.php' ) ); exit; } $url = 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ); $url = wp_nonce_url( $url, 'bulk-update-plugins' ); // Used in the HTML title tag. $title = __( 'Update Plugins' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php _e( 'Update Plugins' ); ?></h1> <iframe src="<?php echo $url; ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe> </div> <?php wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-theme-upgrade' === $action ) { if ( ! current_user_can( 'update_themes' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } check_admin_referer( 'upgrade-core' ); if ( isset( $_GET['themes'] ) ) { $themes = explode( ',', $_GET['themes'] ); } elseif ( isset( $_POST['checked'] ) ) { $themes = (array) $_POST['checked']; } else { wp_redirect( admin_url( 'update-core.php' ) ); exit; } $url = 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) ); $url = wp_nonce_url( $url, 'bulk-update-themes' ); // Used in the HTML title tag. $title = __( 'Update Themes' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php _e( 'Update Themes' ); ?></h1> <iframe src="<?php echo $url; ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0" title="<?php esc_attr_e( 'Update progress' ); ?>"></iframe> </div> <?php wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'do-translation-upgrade' === $action ) { if ( ! current_user_can( 'update_languages' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } check_admin_referer( 'upgrade-translations' ); require_once ABSPATH . 'wp-admin/admin-header.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; $url = 'update-core.php?action=do-translation-upgrade'; $nonce = 'upgrade-translations'; $title = __( 'Update Translations' ); $context = WP_LANG_DIR; $upgrader = new Language_Pack_Upgrader( new Language_Pack_Upgrader_Skin( compact( 'url', 'nonce', 'title', 'context' ) ) ); $result = $upgrader->bulk_upgrade(); wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; } elseif ( 'core-major-auto-updates-settings' === $action ) { if ( ! current_user_can( 'update_core' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); } $redirect_url = self_admin_url( 'update-core.php' ); if ( isset( $_GET['value'] ) ) { check_admin_referer( 'core-major-auto-updates-nonce' ); if ( 'enable' === $_GET['value'] ) { update_site_option( 'auto_update_core_major', 'enabled' ); $redirect_url = add_query_arg( 'core-major-auto-updates-saved', 'enabled', $redirect_url ); } elseif ( 'disable' === $_GET['value'] ) { update_site_option( 'auto_update_core_major', 'disabled' ); $redirect_url = add_query_arg( 'core-major-auto-updates-saved', 'disabled', $redirect_url ); } } wp_redirect( $redirect_url ); exit; } else { /** * Fires for each custom update action on the WordPress Updates screen. * * The dynamic portion of the hook name, `$action`, refers to the * passed update action. The hook fires in lieu of all available * default update actions. * * @since 3.2.0 */ do_action( "update-core-custom_{$action}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } export.php 0000644 00000026030 15024324530 0006575 0 ustar 00 <?php /** * WordPress Export Administration Screen * * @package WordPress * @subpackage Administration */ /** Load WordPress Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'export' ) ) { wp_die( __( 'Sorry, you are not allowed to export the content of this site.' ) ); } /** Load WordPress export API */ require_once ABSPATH . 'wp-admin/includes/export.php'; // Used in the HTML title tag. $title = __( 'Export' ); /** * Display JavaScript on the page. * * @since 3.5.0 */ function export_add_js() { ?> <script type="text/javascript"> jQuery( function($) { var form = $('#export-filters'), filters = form.find('.export-filters'); filters.hide(); form.find('input:radio').on( 'change', function() { filters.slideUp('fast'); switch ( $(this).val() ) { case 'attachment': $('#attachment-filters').slideDown(); break; case 'posts': $('#post-filters').slideDown(); break; case 'pages': $('#page-filters').slideDown(); break; } }); } ); </script> <?php } add_action( 'admin_head', 'export_add_js' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can export a file of your site’s content in order to import it into another installation or platform. The export file will be an XML file format called WXR. Posts, pages, comments, custom fields, categories, and tags can be included. You can choose for the WXR file to include only certain posts or pages by setting the dropdown filters to limit the export by category, author, date range by month, or publishing status.' ) . '</p>' . '<p>' . __( 'Once generated, your WXR file can be imported by another WordPress site or by another blogging platform able to access this format.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-export-screen/">Documentation on Export</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); // If the 'download' URL parameter is set, a WXR export file is baked and returned. if ( isset( $_GET['download'] ) ) { $args = array(); if ( ! isset( $_GET['content'] ) || 'all' === $_GET['content'] ) { $args['content'] = 'all'; } elseif ( 'posts' === $_GET['content'] ) { $args['content'] = 'post'; if ( $_GET['cat'] ) { $args['category'] = (int) $_GET['cat']; } if ( $_GET['post_author'] ) { $args['author'] = (int) $_GET['post_author']; } if ( $_GET['post_start_date'] || $_GET['post_end_date'] ) { $args['start_date'] = $_GET['post_start_date']; $args['end_date'] = $_GET['post_end_date']; } if ( $_GET['post_status'] ) { $args['status'] = $_GET['post_status']; } } elseif ( 'pages' === $_GET['content'] ) { $args['content'] = 'page'; if ( $_GET['page_author'] ) { $args['author'] = (int) $_GET['page_author']; } if ( $_GET['page_start_date'] || $_GET['page_end_date'] ) { $args['start_date'] = $_GET['page_start_date']; $args['end_date'] = $_GET['page_end_date']; } if ( $_GET['page_status'] ) { $args['status'] = $_GET['page_status']; } } elseif ( 'attachment' === $_GET['content'] ) { $args['content'] = 'attachment'; if ( $_GET['attachment_start_date'] || $_GET['attachment_end_date'] ) { $args['start_date'] = $_GET['attachment_start_date']; $args['end_date'] = $_GET['attachment_end_date']; } } else { $args['content'] = $_GET['content']; } /** * Filters the export args. * * @since 3.5.0 * * @param array $args The arguments to send to the exporter. */ $args = apply_filters( 'export_args', $args ); export_wp( $args ); die(); } require_once ABSPATH . 'wp-admin/admin-header.php'; /** * Creates the date options fields for exporting a given post type. * * @since 3.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $post_type The post type. Default 'post'. */ function export_date_options( $post_type = 'post' ) { global $wpdb, $wp_locale; $months = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month FROM $wpdb->posts WHERE post_type = %s AND post_status != 'auto-draft' ORDER BY post_date DESC", $post_type ) ); $month_count = count( $months ); if ( ! $month_count || ( 1 === $month_count && 0 === (int) $months[0]->month ) ) { return; } foreach ( $months as $date ) { if ( 0 === (int) $date->year ) { continue; } $month = zeroise( $date->month, 2 ); printf( '<option value="%1$s">%2$s</option>', esc_attr( $date->year . '-' . $month ), $wp_locale->get_month( $month ) . ' ' . $date->year ); } } ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <p><?php _e( 'When you click the button below WordPress will create an XML file for you to save to your computer.' ); ?></p> <p><?php _e( 'This format, which is called WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.' ); ?></p> <p><?php _e( 'Once you’ve saved the download file, you can use the Import function in another WordPress installation to import the content from this site.' ); ?></p> <h2><?php _e( 'Choose what to export' ); ?></h2> <form method="get" id="export-filters"> <fieldset> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Content to export' ); ?> </legend> <input type="hidden" name="download" value="true" /> <p><label><input type="radio" name="content" value="all" checked="checked" aria-describedby="all-content-desc" /> <?php _e( 'All content' ); ?></label></p> <p class="description" id="all-content-desc"><?php _e( 'This will contain all of your posts, pages, comments, custom fields, terms, navigation menus, and custom posts.' ); ?></p> <p><label><input type="radio" name="content" value="posts" /> <?php _ex( 'Posts', 'post type general name' ); ?></label></p> <ul id="post-filters" class="export-filters"> <li> <label><span class="label-responsive"><?php _e( 'Categories:' ); ?></span> <?php wp_dropdown_categories( array( 'show_option_all' => __( 'All' ) ) ); ?> </label> </li> <li> <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span> <?php $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'post'" ); wp_dropdown_users( array( 'include' => $authors, 'name' => 'post_author', 'multi' => true, 'show_option_all' => __( 'All' ), 'show' => 'display_name_with_login', ) ); ?> </label> </li> <li> <fieldset> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Date range:' ) ?> </legend> <label for="post-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> <select name="post_start_date" id="post-start-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options(); ?> </select> <label for="post-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> <select name="post_end_date" id="post-end-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options(); ?> </select> </fieldset> </li> <li> <label for="post-status" class="label-responsive"><?php _e( 'Status:' ); ?></label> <select name="post_status" id="post-status"> <option value="0"><?php _e( 'All' ); ?></option> <?php $post_statuses = get_post_stati( array( 'internal' => false ), 'objects' ); foreach ( $post_statuses as $status ) : ?> <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> <?php endforeach; ?> </select> </li> </ul> <p><label><input type="radio" name="content" value="pages" /> <?php _e( 'Pages' ); ?></label></p> <ul id="page-filters" class="export-filters"> <li> <label><span class="label-responsive"><?php _e( 'Authors:' ); ?></span> <?php $authors = $wpdb->get_col( "SELECT DISTINCT post_author FROM {$wpdb->posts} WHERE post_type = 'page'" ); wp_dropdown_users( array( 'include' => $authors, 'name' => 'page_author', 'multi' => true, 'show_option_all' => __( 'All' ), 'show' => 'display_name_with_login', ) ); ?> </label> </li> <li> <fieldset> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Date range:' ); ?> </legend> <label for="page-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> <select name="page_start_date" id="page-start-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options( 'page' ); ?> </select> <label for="page-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> <select name="page_end_date" id="page-end-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options( 'page' ); ?> </select> </fieldset> </li> <li> <label for="page-status" class="label-responsive"><?php _e( 'Status:' ); ?></label> <select name="page_status" id="page-status"> <option value="0"><?php _e( 'All' ); ?></option> <?php foreach ( $post_statuses as $status ) : ?> <option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option> <?php endforeach; ?> </select> </li> </ul> <?php foreach ( get_post_types( array( '_builtin' => false, 'can_export' => true, ), 'objects' ) as $post_type ) : ?> <p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p> <?php endforeach; ?> <p><label><input type="radio" name="content" value="attachment" /> <?php _e( 'Media' ); ?></label></p> <ul id="attachment-filters" class="export-filters"> <li> <fieldset> <legend class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Date range:' ); ?> </legend> <label for="attachment-start-date" class="label-responsive"><?php _e( 'Start date:' ); ?></label> <select name="attachment_start_date" id="attachment-start-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options( 'attachment' ); ?> </select> <label for="attachment-end-date" class="label-responsive"><?php _e( 'End date:' ); ?></label> <select name="attachment_end_date" id="attachment-end-date"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php export_date_options( 'attachment' ); ?> </select> </fieldset> </li> </ul> </fieldset> <?php /** * Fires at the end of the export filters form. * * @since 3.5.0 */ do_action( 'export_filters' ); ?> <?php submit_button( __( 'Download Export File' ) ); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> edit.php 0000644 00000046760 15024324530 0006215 0 ustar 00 <?php /** * Edit Posts Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; /** * @global string $typenow The post type of the current screen. */ global $typenow; if ( ! $typenow ) { 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 ( 'attachment' === $typenow ) { if ( wp_redirect( admin_url( 'upload.php' ) ) ) { exit; } } /** * @global string $post_type Global post type. * @global WP_Post_Type $post_type_object Global post type object. */ global $post_type, $post_type_object; $post_type = $typenow; $post_type_object = get_post_type_object( $post_type ); if ( ! $post_type_object ) { wp_die( __( 'Invalid post type.' ) ); } if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>', 403 ); } $wp_list_table = _get_list_table( 'WP_Posts_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); // Back-compat for viewing comments of an entry. foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) { if ( ! empty( $_REQUEST[ $_redirect ] ) ) { wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) ); exit; } } unset( $_redirect ); if ( 'post' !== $post_type ) { $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"; } else { $parent_file = 'edit.php'; $submenu_file = 'edit.php'; $post_new_file = 'post-new.php'; } $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-posts' ); $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'locked', 'ids' ), wp_get_referer() ); if ( ! $sendback ) { $sendback = admin_url( $parent_file ); } $sendback = add_query_arg( 'paged', $pagenum, $sendback ); if ( str_contains( $sendback, 'post.php' ) ) { $sendback = admin_url( $post_new_file ); } $post_ids = array(); if ( 'delete_all' === $doaction ) { // Prepare for deletion of all posts with a specified post status (i.e. Empty Trash). $post_status = preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['post_status'] ); // Validate the post status exists. if ( get_post_status_object( $post_status ) ) { /** * @global wpdb $wpdb WordPress database abstraction object. */ global $wpdb; $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) ); } $doaction = 'delete'; } elseif ( isset( $_REQUEST['media'] ) ) { $post_ids = $_REQUEST['media']; } elseif ( isset( $_REQUEST['ids'] ) ) { $post_ids = explode( ',', $_REQUEST['ids'] ); } elseif ( ! empty( $_REQUEST['post'] ) ) { $post_ids = array_map( 'intval', $_REQUEST['post'] ); } if ( empty( $post_ids ) ) { wp_redirect( $sendback ); exit; } switch ( $doaction ) { case 'trash': $trashed = 0; $locked = 0; foreach ( (array) $post_ids as $post_id ) { if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to move this item to the Trash.' ) ); } if ( wp_check_post_lock( $post_id ) ) { ++$locked; continue; } if ( ! wp_trash_post( $post_id ) ) { wp_die( __( 'Error in moving the item to Trash.' ) ); } ++$trashed; } $sendback = add_query_arg( array( 'trashed' => $trashed, 'ids' => implode( ',', $post_ids ), 'locked' => $locked, ), $sendback ); break; case 'untrash': $untrashed = 0; if ( isset( $_GET['doaction'] ) && ( 'undo' === $_GET['doaction'] ) ) { add_filter( 'wp_untrash_post_status', 'wp_untrash_post_set_previous_status', 10, 3 ); } foreach ( (array) $post_ids as $post_id ) { 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.' ) ); } ++$untrashed; } $sendback = add_query_arg( 'untrashed', $untrashed, $sendback ); remove_filter( 'wp_untrash_post_status', 'wp_untrash_post_set_previous_status', 10 ); break; case 'delete': $deleted = 0; foreach ( (array) $post_ids as $post_id ) { $post_del = get_post( $post_id ); if ( ! current_user_can( 'delete_post', $post_id ) ) { wp_die( __( 'Sorry, you are not allowed to delete this item.' ) ); } if ( 'attachment' === $post_del->post_type ) { if ( ! wp_delete_attachment( $post_id ) ) { wp_die( __( 'Error in deleting the attachment.' ) ); } } else { if ( ! wp_delete_post( $post_id ) ) { wp_die( __( 'Error in deleting the item.' ) ); } } ++$deleted; } $sendback = add_query_arg( 'deleted', $deleted, $sendback ); break; case 'edit': if ( isset( $_REQUEST['bulk_edit'] ) ) { $done = bulk_edit_posts( $_REQUEST ); if ( is_array( $done ) ) { $done['updated'] = count( $done['updated'] ); $done['skipped'] = count( $done['skipped'] ); $done['locked'] = count( $done['locked'] ); $sendback = add_query_arg( $done, $sendback ); } } break; default: $screen = get_current_screen()->id; /** * Fires when a custom bulk action should be handled. * * The redirect link should be modified with success or failure feedback * from the action to be used to display feedback to the user. * * The dynamic portion of the hook name, `$screen`, refers to the current screen ID. * * @since 4.7.0 * * @param string $sendback The redirect URL. * @param string $doaction The action being taken. * @param array $items The items to take the action on. Accepts an array of IDs of posts, * comments, terms, links, plugins, attachments, or users. */ $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $doaction, $post_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores break; } $sendback = remove_query_arg( array( 'action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view' ), $sendback ); wp_redirect( $sendback ); exit; } elseif ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); wp_enqueue_script( 'inline-edit-post' ); wp_enqueue_script( 'heartbeat' ); if ( 'wp_block' === $post_type ) { wp_enqueue_script( 'wp-list-reusable-blocks' ); wp_enqueue_style( 'wp-list-reusable-blocks' ); } // Used in the HTML title tag. $title = $post_type_object->labels->name; if ( 'post' === $post_type ) { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'screen-content', 'title' => __( 'Screen Content' ), 'content' => '<p>' . __( 'You can customize the display of this screen’s contents in a number of ways:' ) . '</p>' . '<ul>' . '<li>' . __( 'You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.' ) . '</li>' . '<li>' . __( 'You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.' ) . '</li>' . '<li>' . __( 'You can view posts in a simple title list or with an excerpt using the Screen Options tab.' ) . '</li>' . '<li>' . __( 'You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.' ) . '</li>' . '</ul>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'action-links', 'title' => __( 'Available Actions' ), 'content' => '<p>' . __( 'Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:' ) . '</p>' . '<ul>' . '<li>' . __( '<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.' ) . '</li>' . '<li>' . __( '<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.' ) . '</li>' . '<li>' . __( '<strong>Trash</strong> removes your post from this list and places it in the Trash, from which you can permanently delete it.' ) . '</li>' . '<li>' . __( '<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post’s status.' ) . '</li>' . '</ul>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'bulk-actions', 'title' => __( 'Bulk actions' ), 'content' => '<p>' . __( 'You can also edit or move multiple posts to the Trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk actions menu and click Apply.' ) . '</p>' . '<p>' . sprintf( /* translators: %s: The dismiss dashicon used for buttons that dismiss or remove. */ __( 'When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the %s<span class="screen-reader-text">remove</span> button next to its name in the Bulk Edit area that appears.' ), '<span class="dashicons dashicons-dismiss" aria-hidden="true" style="font-size: 16px; width: 16px; vertical-align: middle;"></span>' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/posts-screen/">Documentation on Managing Posts</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); } elseif ( 'page' === $post_type ) { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the “Parent” of the other, creating a group of pages.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'managing-pages', 'title' => __( 'Managing Pages' ), 'content' => '<p>' . __( 'Managing pages is very similar to managing posts, and the screens can be customized in the same way.' ) . '</p>' . '<p>' . __( 'You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk actions menu to edit the metadata for multiple pages at once.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/pages-screen/">Documentation on Managing Pages</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); } get_current_screen()->set_screen_reader_content( array( 'heading_views' => $post_type_object->labels->filter_items_list, 'heading_pagination' => $post_type_object->labels->items_list_navigation, 'heading_list' => $post_type_object->labels->items_list, ) ); add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page', ) ); $bulk_counts = array( 'updated' => isset( $_REQUEST['updated'] ) ? absint( $_REQUEST['updated'] ) : 0, 'locked' => isset( $_REQUEST['locked'] ) ? absint( $_REQUEST['locked'] ) : 0, 'deleted' => isset( $_REQUEST['deleted'] ) ? absint( $_REQUEST['deleted'] ) : 0, 'trashed' => isset( $_REQUEST['trashed'] ) ? absint( $_REQUEST['trashed'] ) : 0, 'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0, ); $bulk_messages = array(); $bulk_messages['post'] = array( /* translators: %s: Number of posts. */ 'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ), 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) : /* translators: %s: Number of posts. */ _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ), /* translators: %s: Number of posts. */ 'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ), /* translators: %s: Number of posts. */ 'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ), /* translators: %s: Number of posts. */ 'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ), ); $bulk_messages['page'] = array( /* translators: %s: Number of pages. */ 'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ), 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) : /* translators: %s: Number of pages. */ _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ), /* translators: %s: Number of pages. */ 'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ), /* translators: %s: Number of pages. */ 'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ), /* translators: %s: Number of pages. */ 'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ), ); $bulk_messages['wp_block'] = array( /* translators: %s: Number of patterns. */ 'updated' => _n( '%s pattern updated.', '%s patterns updated.', $bulk_counts['updated'] ), 'locked' => ( 1 === $bulk_counts['locked'] ) ? __( '1 pattern not updated, somebody is editing it.' ) : /* translators: %s: Number of patterns. */ _n( '%s pattern not updated, somebody is editing it.', '%s patterns not updated, somebody is editing them.', $bulk_counts['locked'] ), /* translators: %s: Number of patterns. */ 'deleted' => _n( '%s pattern permanently deleted.', '%s patterns permanently deleted.', $bulk_counts['deleted'] ), /* translators: %s: Number of patterns. */ 'trashed' => _n( '%s pattern moved to the Trash.', '%s patterns moved to the Trash.', $bulk_counts['trashed'] ), /* translators: %s: Number of patterns. */ 'untrashed' => _n( '%s pattern restored from the Trash.', '%s patterns restored from the Trash.', $bulk_counts['untrashed'] ), ); /** * Filters the bulk action updated messages. * * By default, custom post types use the messages for the 'post' post type. * * @since 3.7.0 * * @param array[] $bulk_messages Arrays of messages, each keyed by the corresponding post type. Messages are * keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'. * @param int[] $bulk_counts Array of item counts for each message, used to build internationalized strings. */ $bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts ); $bulk_counts = array_filter( $bulk_counts ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"> <?php echo esc_html( $post_type_object->labels->name ); ?> </h1> <?php if ( current_user_can( $post_type_object->cap->create_posts ) ) { echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new_item ) . '</a>'; } if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { echo '<span class="subtitle">'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '<strong>' . get_search_query() . '</strong>' ); echo '</span>'; } ?> <hr class="wp-header-end"> <?php // If we have a bulk message to issue: $messages = array(); foreach ( $bulk_counts as $message => $count ) { if ( isset( $bulk_messages[ $post_type ][ $message ] ) ) { $messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) ); } elseif ( isset( $bulk_messages['post'][ $message ] ) ) { $messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) ); } if ( 'trashed' === $message && isset( $_REQUEST['ids'] ) ) { $ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] ); $messages[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", 'bulk-posts' ) ), __( 'Undo' ) ); } if ( 'untrashed' === $message && isset( $_REQUEST['ids'] ) ) { $ids = explode( ',', $_REQUEST['ids'] ); if ( 1 === count( $ids ) && current_user_can( 'edit_post', $ids[0] ) ) { $messages[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( get_edit_post_link( $ids[0] ) ), esc_html( get_post_type_object( get_post_type( $ids[0] ) )->labels->edit_item ) ); } } } if ( $messages ) { wp_admin_notice( implode( ' ', $messages ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } unset( $messages ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] ); ?> <?php $wp_list_table->views(); ?> <form id="posts-filter" method="get"> <?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?> <input type="hidden" name="post_status" class="post_status_page" value="<?php echo ! empty( $_REQUEST['post_status'] ) ? esc_attr( $_REQUEST['post_status'] ) : 'all'; ?>" /> <input type="hidden" name="post_type" class="post_type_page" value="<?php echo esc_attr( $post_type ); ?>" /> <?php if ( ! empty( $_REQUEST['author'] ) ) { ?> <input type="hidden" name="author" value="<?php echo esc_attr( $_REQUEST['author'] ); ?>" /> <?php } ?> <?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?> <input type="hidden" name="show_sticky" value="1" /> <?php } ?> <?php $wp_list_table->display(); ?> </form> <?php if ( $wp_list_table->has_items() ) { $wp_list_table->inline_edit(); } ?> <div id="ajax-response"></div> <div class="clear"></div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; user-new.php 0000644 00000057742 15024324530 0007037 0 ustar 00 <?php /** * New User Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( is_multisite() ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', 403 ); } } elseif ( ! current_user_can( 'create_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', 403 ); } if ( is_multisite() ) { add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' ); } if ( isset( $_REQUEST['action'] ) && 'adduser' === $_REQUEST['action'] ) { check_admin_referer( 'add-user', '_wpnonce_add-user' ); $user_details = null; $user_email = wp_unslash( $_REQUEST['email'] ); if ( str_contains( $user_email, '@' ) ) { $user_details = get_user_by( 'email', $user_email ); } else { if ( current_user_can( 'manage_network_users' ) ) { $user_details = get_user_by( 'login', $user_email ); } else { wp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) ); die(); } } if ( ! $user_details ) { wp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) ); die(); } if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', 403 ); } // Adding an existing user to this blog. $new_user_email = array(); $redirect = 'user-new.php'; $username = $user_details->user_login; $user_id = $user_details->ID; if ( array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) { $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' ); } else { if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { $result = add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST['role'], ) ); if ( ! is_wp_error( $result ) ) { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $user_id, ), 'user-new.php' ); } else { $redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' ); } } else { $newuser_key = wp_generate_password( 20, false ); add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST['role'], ) ); $roles = get_editable_roles(); $role = $roles[ $_REQUEST['role'] ]; /** * Fires immediately after an existing user is invited to join the site, but before the notification is sent. * * @since 4.4.0 * * @param int $user_id The invited user's ID. * @param array $role Array containing role information for the invited user. * @param string $newuser_key The key of the invitation. */ do_action( 'invite_user', $user_id, $role, $newuser_key ); $switched_locale = switch_to_user_locale( $user_id ); if ( '' !== get_option( 'blogname' ) ) { $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } else { $site_title = parse_url( home_url(), PHP_URL_HOST ); } /* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */ $message = __( 'Hi, You\'ve been invited to join \'%1$s\' at %2$s with the role of %3$s. Please click the following link to confirm the invite: %4$s' ); $new_user_email['to'] = $user_details->user_email; $new_user_email['subject'] = sprintf( /* translators: Joining confirmation notification email subject. %s: Site title. */ __( '[%s] Joining Confirmation' ), $site_title ); $new_user_email['message'] = sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ); $new_user_email['headers'] = ''; /** * Filters the contents of the email sent when an existing user is invited to join the site. * * @since 5.6.0 * * @param array $new_user_email { * Used to build wp_mail(). * * @type string $to The email address of the invited user. * @type string $subject The subject of the email. * @type string $message The content of the email. * @type string $headers Headers. * } * @param int $user_id The invited user's ID. * @param array $role Array containing role information for the invited user. * @param string $newuser_key The key of the invitation. * */ $new_user_email = apply_filters( 'invited_user_email', $new_user_email, $user_id, $role, $newuser_key ); wp_mail( $new_user_email['to'], $new_user_email['subject'], $new_user_email['message'], $new_user_email['headers'] ); if ( $switched_locale ) { restore_previous_locale(); } $redirect = add_query_arg( array( 'update' => 'add' ), 'user-new.php' ); } } wp_redirect( $redirect ); die(); } elseif ( isset( $_REQUEST['action'] ) && 'createuser' === $_REQUEST['action'] ) { check_admin_referer( 'create-user', '_wpnonce_create-user' ); if ( ! current_user_can( 'create_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', 403 ); } if ( ! is_multisite() ) { $user_id = edit_user(); if ( is_wp_error( $user_id ) ) { $add_user_errors = $user_id; } else { if ( current_user_can( 'list_users' ) ) { $redirect = 'users.php?update=add&id=' . $user_id; } else { $redirect = add_query_arg( 'update', 'add', 'user-new.php' ); } wp_redirect( $redirect ); die(); } } else { // Adding a new user to this site. $new_user_email = wp_unslash( $_REQUEST['email'] ); $user_details = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email ); if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) { $add_user_errors = $user_details['errors']; } else { /** This filter is documented in wp-includes/user.php */ $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email. add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email. } wpmu_signup_user( $new_user_login, $new_user_email, array( 'add_to_blog' => get_current_blog_id(), 'new_role' => $_REQUEST['role'], ) ); if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); $new_user = wpmu_activate_signup( $key ); if ( is_wp_error( $new_user ) ) { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' ); } elseif ( ! is_user_member_of_blog( $new_user['user_id'] ) ) { $redirect = add_query_arg( array( 'update' => 'created_could_not_add' ), 'user-new.php' ); } else { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $new_user['user_id'], ), 'user-new.php' ); } } else { $redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' ); } wp_redirect( $redirect ); die(); } } } // Used in the HTML title tag. $title = __( 'Add New User' ); $parent_file = 'users.php'; $do_both = false; if ( is_multisite() && current_user_can( 'promote_users' ) && current_user_can( 'create_users' ) ) { $do_both = true; } $help = '<p>' . __( 'To add a new user to your site, fill in the form on this screen and click the Add New User button at the bottom.' ) . '</p>'; if ( is_multisite() ) { $help .= '<p>' . __( 'Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user’s name to Edit the user profile under Network Admin > All Users.' ) . '</p>' . '<p>' . __( 'New users will receive an email letting them know they’ve been added as a user for your site. This email will also contain their password. Check the box if you do not want the user to receive a welcome email.' ) . '</p>'; } else { $help .= '<p>' . __( 'New users are automatically assigned a password, which they can change after logging in. You can view or edit the assigned password by clicking the Show Password button. The username cannot be changed once the user has been added.' ) . '</p>' . '<p>' . __( 'By default, new users will receive an email letting them know they’ve been added as a user for your site. This email will also contain a password reset link. Uncheck the box if you do not want to send the new user a welcome email.' ) . '</p>'; } $help .= '<p>' . __( 'Remember to click the Add New User button at the bottom of this screen when you are finished.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); get_current_screen()->add_help_tab( array( 'id' => 'user-roles', 'title' => __( 'User Roles' ), 'content' => '<p>' . __( 'Here is a basic overview of the different user roles and the permissions associated with each one:' ) . '</p>' . '<ul>' . '<li>' . __( 'Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.' ) . '</li>' . '<li>' . __( 'Contributors can write and manage their posts but not publish posts or upload media files.' ) . '</li>' . '<li>' . __( 'Authors can publish and manage their own posts, and are able to upload files.' ) . '</li>' . '<li>' . __( 'Editors can publish posts, manage posts as well as manage other people’s posts, etc.' ) . '</li>' . '<li>' . __( 'Administrators have access to all the administration features.' ) . '</li>' . '</ul>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/users-add-new-screen/">Documentation on Adding New Users</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); wp_enqueue_script( 'wp-ajax-response' ); wp_enqueue_script( 'user-profile' ); /** * Filters whether to enable user auto-complete for non-super admins in Multisite. * * @since 3.4.0 * * @param bool $enable Whether to enable auto-complete for non-super admins. Default false. */ if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) ) ) { wp_enqueue_script( 'user-suggest' ); } require_once ABSPATH . 'wp-admin/admin-header.php'; if ( isset( $_GET['update'] ) ) { $messages = array(); if ( is_multisite() ) { $edit_link = ''; if ( ( isset( $_GET['user_id'] ) ) ) { $user_id_new = absint( $_GET['user_id'] ); if ( $user_id_new ) { $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) ); } } switch ( $_GET['update'] ) { case 'newuserconfirmation': $messages[] = __( 'Invitation email sent to new user. A confirmation link must be clicked before their account is created.' ); break; case 'add': $messages[] = __( 'Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.' ); break; case 'addnoconfirmation': $message = __( 'User has been added to your site.' ); if ( $edit_link ) { $message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) ); } $messages[] = $message; break; case 'addexisting': $messages[] = __( 'That user is already a member of this site.' ); break; case 'could_not_add': $add_user_errors = new WP_Error( 'could_not_add', __( 'That user could not be added to this site.' ) ); break; case 'created_could_not_add': $add_user_errors = new WP_Error( 'created_could_not_add', __( 'User has been created, but could not be added to this site.' ) ); break; case 'does_not_exist': $add_user_errors = new WP_Error( 'does_not_exist', __( 'The requested user does not exist.' ) ); break; case 'enter_email': $add_user_errors = new WP_Error( 'enter_email', __( 'Please enter a valid email address.' ) ); break; } } else { if ( 'add' === $_GET['update'] ) { $messages[] = __( 'User added.' ); } } } ?> <div class="wrap"> <h1 id="add-new-user"> <?php if ( current_user_can( 'create_users' ) ) { _e( 'Add New User' ); } elseif ( current_user_can( 'promote_users' ) ) { _e( 'Add Existing User' ); } ?> </h1> <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : $error_message = ''; foreach ( $errors->get_error_messages() as $err ) { $error_message .= "<li>$err</li>\n"; } wp_admin_notice( '<ul>' . $error_message . '</ul>', array( 'additional_classes' => array( 'error' ), 'paragraph_wrap' => false, ) ); endif; if ( ! empty( $messages ) ) { foreach ( $messages as $msg ) { wp_admin_notice( $msg, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } } ?> <?php if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) : $error_message = ''; foreach ( $add_user_errors->get_error_messages() as $message ) { $error_message .= "<p>$message</p>\n"; } wp_admin_notice( $error_message, array( 'additional_classes' => array( 'error' ), 'paragraph_wrap' => false, ) ); endif; ?> <div id="ajax-response"></div> <?php if ( is_multisite() && current_user_can( 'promote_users' ) ) { if ( $do_both ) { echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>'; } if ( ! current_user_can( 'manage_network_users' ) ) { echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; $label = __( 'Email' ); $type = 'email'; } else { echo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; $label = __( 'Email or Username' ); $type = 'text'; } ?> <form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate" <?php /** * Fires inside the adduser form tag. * * @since 3.0.0 */ do_action( 'user_new_form_tag' ); ?> > <input name="action" type="hidden" value="adduser" /> <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="adduser-email"><?php echo esc_html( $label ); ?></label></th> <td><input name="email" type="<?php echo esc_attr( $type ); ?>" id="adduser-email" class="wp-suggest-user" value="" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="adduser-role"><?php _e( 'Role' ); ?></label></th> <td><select name="role" id="adduser-role"> <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> </select> </td> </tr> <?php if ( current_user_can( 'manage_network_users' ) ) { ?> <tr> <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> <td> <input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> <label for="adduser-noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation' ); ?></label> </td> </tr> <?php } ?> </table> <?php /** * Fires at the end of the new user form. * * Passes a contextual string to make both types of new user forms * uniquely targetable. Contexts are 'add-existing-user' (Multisite), * and 'add-new-user' (single site and network admin). * * @since 3.7.0 * * @param string $type A contextual string specifying which type of new user form the hook follows. */ do_action( 'user_new_form', 'add-existing-user' ); ?> <?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?> </form> <?php } // End if is_multisite(). if ( current_user_can( 'create_users' ) ) { if ( $do_both ) { echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>'; } ?> <p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p> <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate" <?php /** This action is documented in wp-admin/user-new.php */ do_action( 'user_new_form_tag' ); ?> > <input name="action" type="hidden" value="createuser" /> <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> <?php // Load up the passed data, else set to a default. $creating = isset( $_POST['createuser'] ); $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : ''; $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : ''; $new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : ''; $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : ''; $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : ''; $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true; $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" autocomplete="off" maxlength="60" /></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td> </tr> <?php if ( ! is_multisite() ) { ?> <tr class="form-field"> <th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th> <td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr( $new_user_firstname ); ?>" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="last_name"><?php _e( 'Last Name' ); ?> </label></th> <td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr( $new_user_lastname ); ?>" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="url"><?php _e( 'Website' ); ?></label></th> <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td> </tr> <?php $languages = get_available_languages(); if ( $languages ) : ?> <tr class="form-field user-language-wrap"> <th scope="row"> <label for="locale"> <?php /* translators: The user language selection field label. */ ?> <?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span> </label> </th> <td> <?php wp_dropdown_languages( array( 'name' => 'locale', 'id' => 'locale', 'selected' => 'site-default', 'languages' => $languages, 'show_available_translations' => false, 'show_option_site_default' => true, ) ); ?> </td> </tr> <?php endif; ?> <tr class="form-field form-required user-pass1-wrap"> <th scope="row"> <label for="pass1"> <?php _e( 'Password' ); ?> <span class="description hide-if-js"><?php _e( '(required)' ); ?></span> </label> </th> <td> <input type="hidden" value=" " /><!-- #24364 workaround --> <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate password' ); ?></button> <div class="wp-pwd"> <?php $initial_password = wp_generate_password( 24 ); ?> <div class="password-input-wrapper"> <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result" /> <div style="display:none" id="pass-strength-result" aria-live="polite"></div> </div> <button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> <span class="dashicons dashicons-hidden" aria-hidden="true"></span> <span class="text"><?php _e( 'Hide' ); ?></span> </button> </div> </td> </tr> <tr class="form-field form-required user-pass2-wrap hide-if-js"> <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td> <input type="password" name="pass2" id="pass2" autocomplete="new-password" spellcheck="false" aria-describedby="pass2-desc" /> <p class="description" id="pass2-desc"><?php _e( 'Type the password again.' ); ?></p> </td> </tr> <tr class="pw-weak"> <th><?php _e( 'Confirm Password' ); ?></th> <td> <label> <input type="checkbox" name="pw_weak" class="pw-checkbox" /> <?php _e( 'Confirm use of weak password' ); ?> </label> </td> </tr> <tr> <th scope="row"><?php _e( 'Send User Notification' ); ?></th> <td> <input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> /> <label for="send_user_notification"><?php _e( 'Send the new user an email about their account' ); ?></label> </td> </tr> <?php } // End if ! is_multisite(). ?> <?php if ( current_user_can( 'promote_users' ) ) { ?> <tr class="form-field"> <th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th> <td><select name="role" id="role"> <?php if ( ! $new_user_role ) { $new_user_role = get_option( 'default_role' ); } wp_dropdown_roles( $new_user_role ); ?> </select> </td> </tr> <?php } ?> <?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?> <tr> <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> <td> <input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation' ); ?></label> </td> </tr> <?php } ?> </table> <?php /** This action is documented in wp-admin/user-new.php */ do_action( 'user_new_form', 'add-new-user' ); ?> <?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?> </form> <?php } // End if current_user_can( 'create_users' ). ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; options-head.php 0000644 00000001044 15024324530 0007644 0 ustar 00 <?php /** * WordPress Options Header. * * Displays updated message, if updated variable is part of the URL query. * * @package WordPress * @subpackage Administration */ $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) { // For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect. add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); } settings_errors(); edit-link-form.php 0000644 00000014332 15024324530 0010077 0 ustar 00 <?php /** * Edit links form for inclusion in administration panels. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } if ( ! empty( $link_id ) ) { /* translators: %s: URL to Links screen. */ $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' ); $submit_text = __( 'Update Link' ); $form_name = 'editlink'; $nonce_action = 'update-bookmark_' . $link_id; } else { /* translators: %s: URL to Links screen. */ $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' ); $submit_text = __( 'Add Link' ); $form_name = 'addlink'; $nonce_action = 'add-bookmark'; } require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; add_meta_box( 'linksubmitdiv', __( 'Save' ), 'link_submit_meta_box', null, 'side', 'core' ); add_meta_box( 'linkcategorydiv', __( 'Categories' ), 'link_categories_meta_box', null, 'normal', 'core' ); add_meta_box( 'linktargetdiv', __( 'Target' ), 'link_target_meta_box', null, 'normal', 'core' ); add_meta_box( 'linkxfndiv', __( 'Link Relationship (XFN)' ), 'link_xfn_meta_box', null, 'normal', 'core' ); add_meta_box( 'linkadvanceddiv', __( 'Advanced' ), 'link_advanced_meta_box', null, 'normal', 'core' ); /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'add_meta_boxes', 'link', $link ); /** * Fires when link-specific meta boxes are added. * * @since 3.0.0 * * @param object $link Link object. */ do_action( 'add_meta_boxes_link', $link ); /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'do_meta_boxes', 'link', 'normal', $link ); /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'do_meta_boxes', 'link', 'advanced', $link ); /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'do_meta_boxes', 'link', 'side', $link ); add_screen_option( 'layout_columns', array( 'max' => 2, 'default' => 2, ) ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link’s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' . '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you do not use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' . '<p>' . __( 'XFN stands for <a href="https://gmpg.org/xfn/">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Links_Add_New_Screen">Documentation on Creating Links</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <a href="link-add.php" class="page-title-action"><?php echo esc_html__( 'Add New Link' ); ?></a> <hr class="wp-header-end"> <?php if ( isset( $_GET['added'] ) ) { wp_admin_notice( __( 'Link added.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } ?> <form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php"> <?php if ( ! empty( $link_added ) ) { echo $link_added; } wp_nonce_field( $nonce_action ); wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> <div id="poststuff"> <div id="post-body" class="metabox-holder columns-<?php echo ( 1 === get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> <div id="post-body-content"> <div id="namediv" class="postbox"> <h2 class="postbox-header"><label for="link_name"><?php _ex( 'Name', 'link name' ); ?></label></h2> <div class="inside"> <input type="text" name="link_name" size="30" maxlength="255" value="<?php echo esc_attr( $link->link_name ); ?>" id="link_name" /> <p><?php _e( 'Example: Nifty blogging software' ); ?></p> </div> </div> <div id="addressdiv" class="postbox"> <h2 class="postbox-header"><label for="link_url"><?php _e( 'Web Address' ); ?></label></h2> <div class="inside"> <input type="text" name="link_url" size="30" maxlength="255" class="code" value="<?php echo esc_url( $link->link_url ); ?>" id="link_url" /> <p><?php _e( 'Example: <code>https://wordpress.org/</code> — do not forget the <code>https://</code>' ); ?></p> </div> </div> <div id="descriptiondiv" class="postbox"> <h2 class="postbox-header"><label for="link_description"><?php _e( 'Description' ); ?></label></h2> <div class="inside"> <input type="text" name="link_description" size="30" maxlength="255" value="<?php echo isset( $link->link_description ) ? esc_attr( $link->link_description ) : ''; ?>" id="link_description" /> <p><?php _e( 'This will be shown when someone hovers over the link in the blogroll, or optionally below the link.' ); ?></p> </div> </div> </div><!-- /post-body-content --> <div id="postbox-container-1" class="postbox-container"> <?php /** This action is documented in wp-admin/includes/meta-boxes.php */ do_action( 'submitlink_box' ); $side_meta_boxes = do_meta_boxes( 'link', 'side', $link ); ?> </div> <div id="postbox-container-2" class="postbox-container"> <?php do_meta_boxes( null, 'normal', $link ); do_meta_boxes( null, 'advanced', $link ); ?> </div> <?php if ( $link_id ) : ?> <input type="hidden" name="action" value="save" /> <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" /> <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id; ?>" /> <?php else : ?> <input type="hidden" name="action" value="add" /> <?php endif; ?> </div> </div> </form> </div> edit-comments.php 0000644 00000034606 15024324530 0010034 0 ustar 00 <?php /** * Edit Comments Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'edit_posts' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>', 403 ); } $wp_list_table = _get_list_table( 'WP_Comments_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); $doaction = $wp_list_table->current_action(); if ( $doaction ) { check_admin_referer( 'bulk-comments' ); if ( 'delete_all' === $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) { /** * @global wpdb $wpdb WordPress database abstraction object. */ global $wpdb; $comment_status = wp_unslash( $_REQUEST['comment_status'] ); $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] ); $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) ); $doaction = 'delete'; } elseif ( isset( $_REQUEST['delete_comments'] ) ) { $comment_ids = $_REQUEST['delete_comments']; $doaction = $_REQUEST['action']; } elseif ( isset( $_REQUEST['ids'] ) ) { $comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) ); } elseif ( wp_get_referer() ) { wp_safe_redirect( wp_get_referer() ); exit; } $approved = 0; $unapproved = 0; $spammed = 0; $unspammed = 0; $trashed = 0; $untrashed = 0; $deleted = 0; $redirect_to = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'spammed', 'unspammed', 'approved', 'unapproved', 'ids', ), wp_get_referer() ); $redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to ); wp_defer_comment_counting( true ); foreach ( $comment_ids as $comment_id ) { // Check the permissions on each. if ( ! current_user_can( 'edit_comment', $comment_id ) ) { continue; } switch ( $doaction ) { case 'approve': wp_set_comment_status( $comment_id, 'approve' ); ++$approved; break; case 'unapprove': wp_set_comment_status( $comment_id, 'hold' ); ++$unapproved; break; case 'spam': wp_spam_comment( $comment_id ); ++$spammed; break; case 'unspam': wp_unspam_comment( $comment_id ); ++$unspammed; break; case 'trash': wp_trash_comment( $comment_id ); ++$trashed; break; case 'untrash': wp_untrash_comment( $comment_id ); ++$untrashed; break; case 'delete': wp_delete_comment( $comment_id ); ++$deleted; break; } } if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) { $screen = get_current_screen()->id; /** This action is documented in wp-admin/edit.php */ $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } wp_defer_comment_counting( false ); if ( $approved ) { $redirect_to = add_query_arg( 'approved', $approved, $redirect_to ); } if ( $unapproved ) { $redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to ); } if ( $spammed ) { $redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to ); } if ( $unspammed ) { $redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to ); } if ( $trashed ) { $redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to ); } if ( $untrashed ) { $redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to ); } if ( $deleted ) { $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to ); } if ( $trashed || $spammed ) { $redirect_to = add_query_arg( 'ids', implode( ',', $comment_ids ), $redirect_to ); } wp_safe_redirect( $redirect_to ); exit; } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); wp_enqueue_script( 'admin-comments' ); enqueue_comment_hotkeys_js(); /** * @global int $post_id */ global $post_id; if ( $post_id ) { $comments_count = wp_count_comments( $post_id ); $draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ); if ( $comments_count->moderated > 0 ) { // Used in the HTML title tag. $title = sprintf( /* translators: 1: Comments count, 2: Post title. */ __( 'Comments (%1$s) on “%2$s”' ), number_format_i18n( $comments_count->moderated ), $draft_or_post_title ); } else { // Used in the HTML title tag. $title = sprintf( /* translators: %s: Post title. */ __( 'Comments on “%s”' ), $draft_or_post_title ); } } else { $comments_count = wp_count_comments(); if ( $comments_count->moderated > 0 ) { // Used in the HTML title tag. $title = sprintf( /* translators: %s: Comments count. */ __( 'Comments (%s)' ), number_format_i18n( $comments_count->moderated ) ); } else { // Used in the HTML title tag. $title = __( 'Comments' ); } } add_screen_option( 'per_page' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the bulk actions.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'moderating-comments', 'title' => __( 'Moderating Comments' ), 'content' => '<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' . '<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and site URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' . '<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' . '<p>' . __( 'In the <strong>In response to</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' . '<p>' . __( 'In the <strong>Submitted on</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' . '<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/understand-comment-spam/">Documentation on Comment Spam</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/keyboard-shortcuts-classic-editor/#keyboard-shortcuts-for-comments">Documentation on Keyboard Shortcuts</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); get_current_screen()->set_screen_reader_content( array( 'heading_views' => __( 'Filter comments list' ), 'heading_pagination' => __( 'Comments list navigation' ), 'heading_list' => __( 'Comments list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"> <?php if ( $post_id ) { printf( /* translators: %s: Link to post. */ __( 'Comments on “%s”' ), sprintf( '<a href="%1$s">%2$s</a>', get_edit_post_link( $post_id ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) ) ); } else { _e( 'Comments' ); } ?> </h1> <?php if ( $post_id ) { $post_type_object = get_post_type_object( get_post_type( $post_id ) ); if ( $post_type_object ) { printf( '<a href="%1$s" class="comments-view-item-link">%2$s</a>', get_permalink( $post_id ), $post_type_object->labels->view_item ); } } if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { echo '<span class="subtitle">'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' ); echo '</span>'; } ?> <hr class="wp-header-end"> <?php if ( isset( $_REQUEST['error'] ) ) { $error = (int) $_REQUEST['error']; $error_msg = ''; switch ( $error ) { case 1: $error_msg = __( 'Invalid comment ID.' ); break; case 2: $error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' ); break; } if ( $error_msg ) { wp_admin_notice( $error_msg, array( 'id' => 'moderated', 'additional_classes' => array( 'error' ), ) ); } } if ( isset( $_REQUEST['approved'] ) || isset( $_REQUEST['deleted'] ) || isset( $_REQUEST['trashed'] ) || isset( $_REQUEST['untrashed'] ) || isset( $_REQUEST['spammed'] ) || isset( $_REQUEST['unspammed'] ) || isset( $_REQUEST['same'] ) ) { $approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0; $deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; $trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0; $untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0; $spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0; $unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0; $same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0; if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) { if ( $approved > 0 ) { $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment approved.', '%s comments approved.', $approved ), $approved ); } if ( $spammed > 0 ) { $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed ) . sprintf( ' <a href="%1$s">%2$s</a><br />', esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ), __( 'Undo' ) ); } if ( $unspammed > 0 ) { $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ), $unspammed ); } if ( $trashed > 0 ) { $ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0; $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ), $trashed ) . sprintf( ' <a href="%1$s">%2$s</a><br />', esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ), __( 'Undo' ) ); } if ( $untrashed > 0 ) { $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ), $untrashed ); } if ( $deleted > 0 ) { $messages[] = sprintf( /* translators: %s: Number of comments. */ _n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ), $deleted ); } if ( $same > 0 ) { $comment = get_comment( $same ); if ( $comment ) { switch ( $comment->comment_approved ) { case '1': $messages[] = __( 'This comment is already approved.' ) . sprintf( ' <a href="%1$s">%2$s</a>', esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), __( 'Edit comment' ) ); break; case 'trash': $messages[] = __( 'This comment is already in the Trash.' ) . sprintf( ' <a href="%1$s">%2$s</a>', esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ), __( 'View Trash' ) ); break; case 'spam': $messages[] = __( 'This comment is already marked as spam.' ) . sprintf( ' <a href="%1$s">%2$s</a>', esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ), __( 'Edit comment' ) ); break; } } } wp_admin_notice( implode( "<br />\n", $messages ), array( 'id' => 'moderated', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } } ?> <?php $wp_list_table->views(); ?> <form id="comments-form" method="get"> <?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?> <?php if ( $post_id ) : ?> <input type="hidden" name="p" value="<?php echo esc_attr( (int) $post_id ); ?>" /> <?php endif; ?> <input type="hidden" name="comment_status" value="<?php echo esc_attr( $comment_status ); ?>" /> <input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>" /> <input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>" /> <input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>" /> <input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'page' ) ); ?>" /> <?php if ( isset( $_REQUEST['paged'] ) ) { ?> <input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" /> <?php } ?> <?php $wp_list_table->display(); ?> </form> </div> <div id="ajax-response"></div> <?php wp_comment_reply( '-1', true, 'detail' ); wp_comment_trashnotice(); require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> export-personal-data.php 0000644 00000017405 15024324530 0011333 0 ustar 00 <?php /** * Privacy tools, Export Personal Data screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'export_others_personal_data' ) ) { wp_die( __( 'Sorry, you are not allowed to export personal data on this site.' ) ); } // Used in the HTML title tag. $title = __( 'Export Personal Data' ); // Contextual help - choose Help on the top right of admin panel to preview this. get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'This screen is where you manage requests for an export of personal data.' ) . '</p>' . '<p>' . __( 'Privacy Laws around the world require businesses and online services to provide an export of some of the data they collect about an individual, and to deliver that export on request. The rights those laws enshrine are sometimes called the "Right of Data Portability". It allows individuals to obtain and reuse their personal data for their own purposes across different services. It allows them to move, copy or transfer personal data easily from one IT environment to another.' ) . '</p>' . '<p>' . __( 'The tool associates data stored in WordPress with a supplied email address, including profile data and comments.' ) . '</p>' . '<p><strong>' . __( 'Note: Since this tool only gathers data from WordPress and participating plugins, you may need to do more to comply with export requests. For example, you should also send the requester some of the data collected from or stored with the 3rd party services your organization uses.' ) . '</strong></p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'default-data', 'title' => __( 'Default Data' ), 'content' => '<p>' . __( 'WordPress collects (but <em>never</em> publishes) a limited amount of data from registered users who have logged in to the site. Generally, these users are people who contribute to the site in some way -- content, store management, and so on. With rare exceptions, these users do not include occasional visitors who might have registered to comment on articles or buy products. The data WordPress retains can include:' ) . '</p>' . '<p>' . __( '<strong>Profile Information</strong> — user email address, username, display name, nickname, first name, last name, description/bio, and registration date.' ) . '</p>' . '<p>' . __( '<strong>Community Events Location</strong> — The IP Address of the user, which populates the Upcoming Community Events dashboard widget with relevant information.' ) . '</p>' . '<p>' . __( '<strong>Session Tokens</strong> — User login information, IP Addresses, Expiration Date, User Agent (Browser/OS), and Last Login.' ) . '</p>' . '<p>' . __( '<strong>Comments</strong> — For user comments, Email Address, IP Address, User Agent (Browser/OS), Date/Time, Comment Content, and Content URL.' ) . '</p>' . '<p>' . __( '<strong>Media</strong> — A list of URLs for media files the user uploads.' ) . '</p>', ) ); $privacy_policy_guide = '<p>' . sprintf( /* translators: %s: URL to Privacy Policy Guide screen. */ __( 'If you are not sure, check the plugin documentation or contact the plugin author to see if the plugin collects data and if it supports the Data Exporter tool. This information may be available in the <a href="%s">Privacy Policy Guide</a>.' ), admin_url( 'options-privacy.php?tab=policyguide' ) ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'plugin-data', 'title' => __( 'Plugin Data' ), 'content' => '<p>' . __( 'Many plugins may collect or store personal data either in the WordPress database or remotely. Any Export Personal Data request should include data from plugins as well.' ) . '</p>' . $privacy_policy_guide . '<p>' . __( 'If you are a plugin author, you can learn more about <a href="https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-exporter-to-your-plugin/">how to add the Personal Data Exporter to a plugin</a>.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-export-personal-data-screen/">Documentation on Export Personal Data</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); // Handle list table actions. _wp_personal_data_handle_actions(); // Cleans up failed and expired requests before displaying the list table. _wp_personal_data_cleanup_requests(); wp_enqueue_script( 'privacy-tools' ); add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'export_personal_data_requests_per_page', ) ); $_list_table_args = array( 'plural' => 'privacy_requests', 'singular' => 'privacy_request', ); $requests_table = _get_list_table( 'WP_Privacy_Data_Export_Requests_List_Table', $_list_table_args ); $requests_table->screen->set_screen_reader_content( array( 'heading_views' => __( 'Filter export personal data list' ), 'heading_pagination' => __( 'Export personal data list navigation' ), 'heading_list' => __( 'Export personal data list' ), ) ); $requests_table->process_bulk_action(); $requests_table->prepare_items(); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap nosubsub"> <h1><?php esc_html_e( 'Export Personal Data' ); ?></h1> <p><?php _e( 'This tool helps site owners comply with local laws and regulations by exporting known data for a given user in a .zip file.' ); ?></p> <hr class="wp-header-end" /> <?php settings_errors(); ?> <form action="<?php echo esc_url( admin_url( 'export-personal-data.php' ) ); ?>" method="post" class="wp-privacy-request-form"> <h2><?php esc_html_e( 'Add Data Export Request' ); ?></h2> <div class="wp-privacy-request-form-field"> <table class="form-table"> <tr> <th scope="row"> <label for="username_or_email_for_privacy_request"><?php esc_html_e( 'Username or email address' ); ?></label> </th> <td> <input type="text" required class="regular-text ltr" id="username_or_email_for_privacy_request" name="username_or_email_for_privacy_request" /> </td> </tr> <tr> <th scope="row"> <?php _e( 'Confirmation email' ); ?> </th> <td> <label for="send_confirmation_email"> <input type="checkbox" name="send_confirmation_email" id="send_confirmation_email" value="1" checked="checked" /> <?php _e( 'Send personal data export confirmation email.' ); ?> </label> </td> </tr> </table> <p class="submit"> <?php submit_button( __( 'Send Request' ), 'secondary', 'submit', false ); ?> </p> </div> <?php wp_nonce_field( 'personal-data-request' ); ?> <input type="hidden" name="action" value="add_export_personal_data_request" /> <input type="hidden" name="type_of_action" value="export_personal_data" /> </form> <hr /> <?php $requests_table->views(); ?> <form class="search-form wp-clearfix"> <?php $requests_table->search_box( __( 'Search Requests' ), 'requests' ); ?> <input type="hidden" name="filter-status" value="<?php echo isset( $_REQUEST['filter-status'] ) ? esc_attr( sanitize_text_field( $_REQUEST['filter-status'] ) ) : ''; ?>" /> <input type="hidden" name="orderby" value="<?php echo isset( $_REQUEST['orderby'] ) ? esc_attr( sanitize_text_field( $_REQUEST['orderby'] ) ) : ''; ?>" /> <input type="hidden" name="order" value="<?php echo isset( $_REQUEST['order'] ) ? esc_attr( sanitize_text_field( $_REQUEST['order'] ) ) : ''; ?>" /> </form> <form method="post"> <?php $requests_table->display(); $requests_table->embed_scripts(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; media.php 0000644 00000001463 15024324530 0006336 0 ustar 00 <?php /** * Media management action handler. * * This file is deprecated, use 'wp-admin/upload.php' instead. * * @deprecated 6.3.0 * @package WordPress * @subpackage Administration */ /** Load WordPress Administration Bootstrap. */ require_once __DIR__ . '/admin.php'; $parent_file = 'upload.php'; $submenu_file = 'upload.php'; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; switch ( $action ) { case 'editattachment': case 'edit': if ( empty( $_GET['attachment_id'] ) ) { wp_redirect( admin_url( 'upload.php?error=deprecated' ) ); exit; } $att_id = (int) $_GET['attachment_id']; wp_redirect( admin_url( "upload.php?item={$att_id}&error=deprecated" ) ); exit; default: wp_redirect( admin_url( 'upload.php?error=deprecated' ) ); exit; } setup-config.php 0000644 00000042757 15024324530 0007675 0 ustar 00 <?php /** * Retrieves and creates the wp-config.php file. * * The permissions for the base directory must allow for writing files in order * for the wp-config.php to be created using this page. * * @package WordPress * @subpackage Administration */ /** * We are installing. */ define( 'WP_INSTALLING', true ); /** * We are blissfully unaware of anything. */ define( 'WP_SETUP_CONFIG', true ); /** * Disable error reporting * * Set this to error_reporting( -1 ) for debugging */ error_reporting( 0 ); if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } require ABSPATH . 'wp-settings.php'; /** Load WordPress Administration Upgrade API */ require_once ABSPATH . 'wp-admin/includes/upgrade.php'; /** Load WordPress Translation Installation API */ require_once ABSPATH . 'wp-admin/includes/translation-install.php'; nocache_headers(); // Support wp-config-sample.php one level up, for the develop repo. if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $config_file = file( ABSPATH . 'wp-config-sample.php' ); } elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) { $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); } else { wp_die( sprintf( /* translators: %s: wp-config-sample.php */ __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ), '<code>wp-config-sample.php</code>' ) ); } // Check if wp-config.php has been created. if ( file_exists( ABSPATH . 'wp-config.php' ) ) { wp_die( '<p>' . 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 <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 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( '<p>' . 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 <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 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' ); ?> <!DOCTYPE html> <html<?php echo $dir_attr; ?>> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex,nofollow" /> <title><?php _e( 'WordPress › Setup Configuration File' ); ?></title> <?php wp_admin_css( 'install', true ); ?> </head> <body class="<?php echo implode( ' ', $body_classes ); ?>"> <p id="logo"><?php _e( 'WordPress' ); ?></p> <?php } // End function setup_config_display_header(); /** * @global string $wp_local_package Locale code of the package. * @global WP_Locale $wp_locale WordPress date and time locale object. */ $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; } switch ( $step ) { case -1: if ( wp_can_install_language_pack() && empty( $language ) ) { $languages = wp_get_available_translations(); if ( $languages ) { setup_config_display_header( 'language-chooser' ); echo '<h1 class="screen-reader-text">Select a default language</h1>'; echo '<form id="setup" method="post" action="?step=0">'; wp_install_language_form( $languages ); echo '</form>'; 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; } ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Before getting started' ); ?> </h1> <p><?php _e( 'Welcome to WordPress. Before getting started, you will need to know the following items.' ); ?></p> <ol> <li><?php _e( 'Database name' ); ?></li> <li><?php _e( 'Database username' ); ?></li> <li><?php _e( 'Database password' ); ?></li> <li><?php _e( 'Database host' ); ?></li> <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li> </ol> <p> <?php printf( /* translators: %s: wp-config.php */ __( 'This information is being used to create a %s file.' ), '<code>wp-config.php</code>' ); ?> <strong> <?php printf( /* translators: 1: wp-config-sample.php, 2: wp-config.php */ __( 'If for any reason this automatic file creation does not work, do not worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ), '<code>wp-config-sample.php</code>', '<code>wp-config.php</code>' ); ?> </strong> <?php printf( /* translators: 1: Documentation URL, 2: wp-config.php */ __( 'Need more help? <a href="%1$s">Read the support article on %2$s</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ), '<code>wp-config.php</code>' ); ?> </p> <p><?php _e( 'In all likelihood, these items were supplied to you by your web host. If you do not have this information, then you will need to contact them before you can continue. If you are ready…' ); ?></p> <p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p> <?php break; case 1: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); setup_config_display_header(); $autofocus = wp_is_mobile() ? '' : ' autofocus'; ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Set up your database connection' ); ?> </h1> <form method="post" action="setup-config.php?step=2"> <p><?php _e( 'Below you should enter your database connection details. If you are not sure about these, contact your host.' ); ?></p> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th> <td><input name="dbname" id="dbname" type="text" aria-describedby="dbname-desc" size="25" placeholder="wordpress"<?php echo $autofocus; ?>/> <p id="dbname-desc"><?php _e( 'The name of the database you want to use with WordPress.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="uname"><?php _e( 'Username' ); ?></label></th> <td><input name="uname" id="uname" type="text" aria-describedby="uname-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /> <p id="uname-desc"><?php _e( 'Your database username.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th> <td> <div class="wp-pwd"> <input name="pwd" id="pwd" type="password" class="regular-text" data-reveal="1" aria-describedby="pwd-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" autocomplete="off" spellcheck="false" /> <button type="button" class="button pwd-toggle hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Show password' ); ?>"> <span class="dashicons dashicons-visibility"></span> <span class="text"><?php _e( 'Show' ); ?></span> </button> </div> <p id="pwd-desc"><?php _e( 'Your database password.' ); ?></p> </td> </tr> <tr> <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th> <td><input name="dbhost" id="dbhost" type="text" aria-describedby="dbhost-desc" size="25" value="localhost" /> <p id="dbhost-desc"> <?php /* translators: %s: localhost */ printf( __( 'You should be able to get this info from your web host, if %s does not work.' ), '<code>localhost</code>' ); ?> </p></td> </tr> <tr> <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th> <td><input name="prefix" id="prefix" type="text" aria-describedby="prefix-desc" value="wp_" size="25" /> <p id="prefix-desc"><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></p></td> </tr> </table> <?php if ( isset( $_GET['noapi'] ) ) { ?> <input name="noapi" type="hidden" value="1" /><?php } ?> <input type="hidden" name="language" value="<?php echo esc_attr( $language ); ?>" /> <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p> </form> <?php wp_print_scripts( 'password-toggle' ); break; case 2: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); $dbname = trim( wp_unslash( $_POST['dbname'] ) ); $uname = trim( wp_unslash( $_POST['uname'] ) ); $pwd = trim( wp_unslash( $_POST['pwd'] ) ); $dbhost = trim( wp_unslash( $_POST['dbhost'] ) ); $prefix = trim( wp_unslash( $_POST['prefix'] ) ); $step_1 = 'setup-config.php?step=1'; $install = 'install.php'; if ( isset( $_REQUEST['noapi'] ) ) { $step_1 .= '&noapi'; } if ( ! empty( $language ) ) { $step_1 .= '&language=' . $language; $install .= '?language=' . $language; } else { $install .= '?language=en_US'; } $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try Again' ) . '</a>'; if ( empty( $prefix ) ) { wp_die( __( '<strong>Error:</strong> "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( __( '<strong>Error:</strong> "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( __( '<strong>Error:</strong> "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(); ?> <p> <?php /* translators: %s: wp-config.php */ printf( __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); ?> </p> <p id="wp-config-description"> <?php /* translators: %s: wp-config.php */ printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' ); $config_text = ''; foreach ( $config_file as $line ) { $config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' ); } ?> </p> <p class="configuration-rules-label"><label for="wp-config"> <?php /* translators: %s: wp-config.php */ printf( __( 'Configuration rules for %s:' ), '<code>wp-config.php</code>' ); ?> </label></p> <textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly" aria-describedby="wp-config-description"><?php echo $config_text; ?></textarea> <p><?php _e( 'After you’ve done that, click “Run the installation”.' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <script> (function(){ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { var el = document.getElementById('wp-config'); el.focus(); el.select(); } })(); </script> <?php else : /* * If this file doesn't exist, then we are using the wp-config-sample.php * file one level up, which is for the develop repo. */ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $path_to_wp_config = ABSPATH . 'wp-config.php'; } else { $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php'; } $error_message = ''; $handle = fopen( $path_to_wp_config, 'w' ); /* * Why check for the absence of false instead of checking for resource with is_resource()? * To future-proof the check for when fopen returns object instead of resource, i.e. a known * change coming in PHP. */ if ( false !== $handle ) { foreach ( $config_file as $line ) { fwrite( $handle, $line ); } fclose( $handle ); } else { $wp_config_perms = fileperms( $path_to_wp_config ); if ( ! empty( $wp_config_perms ) && ! is_writable( $path_to_wp_config ) ) { $error_message = sprintf( /* translators: 1: wp-config.php, 2: Documentation URL. */ __( 'You need to make the file %1$s writable before you can save your changes. See <a href="%2$s">Changing File Permissions</a> for more information.' ), '<code>wp-config.php</code>', __( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ) ); } else { $error_message = sprintf( /* translators: %s: wp-config.php */ __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); } } chmod( $path_to_wp_config, 0666 ); setup_config_display_header(); if ( false !== $handle ) : ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Successful database connection' ); ?> </h1> <p><?php _e( 'All right, sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <?php else : printf( '<p>%s</p>', $error_message ); endif; endif; break; } // End of the steps switch. ?> <?php wp_print_scripts( 'language-chooser' ); ?> </body> </html> comment.php 0000644 00000026546 15024324530 0006732 0 ustar 00 <?php /** * Comment Management Screen * * @package WordPress * @subpackage Administration */ /** Load WordPress Bootstrap */ require_once __DIR__ . '/admin.php'; $parent_file = 'edit-comments.php'; $submenu_file = 'edit-comments.php'; /** * @global string $action */ global $action; $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_POST['deletecomment'] ) ) { $action = 'deletecomment'; } if ( 'cdc' === $action ) { $action = 'delete'; } elseif ( 'mac' === $action ) { $action = 'approve'; } if ( isset( $_GET['dt'] ) ) { if ( 'spam' === $_GET['dt'] ) { $action = 'spam'; } elseif ( 'trash' === $_GET['dt'] ) { $action = 'trash'; } } if ( isset( $_REQUEST['c'] ) ) { $comment_id = absint( $_REQUEST['c'] ); $comment = get_comment( $comment_id ); // Prevent actions on a comment associated with a trashed post. if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) { wp_die( __( 'You cannot edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' ) ); } } else { $comment = null; } switch ( $action ) { case 'editcomment': // Used in the HTML title tag. $title = __( 'Edit Comment' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' . '<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); wp_enqueue_script( 'comment' ); require_once ABSPATH . 'wp-admin/admin-header.php'; if ( ! $comment ) { comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) ); } if ( ! current_user_can( 'edit_comment', $comment_id ) ) { comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) ); } if ( 'trash' === $comment->comment_approved ) { comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) ); } $comment = get_comment_to_edit( $comment_id ); require ABSPATH . 'wp-admin/edit-form-comment.php'; break; case 'delete': case 'approve': case 'trash': case 'spam': // Used in the HTML title tag. $title = __( 'Moderate Comment' ); if ( ! $comment ) { wp_redirect( admin_url( 'edit-comments.php?error=1' ) ); die(); } if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { wp_redirect( admin_url( 'edit-comments.php?error=2' ) ); die(); } // No need to re-approve/re-trash/re-spam a comment. if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) { wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) ); die(); } require_once ABSPATH . 'wp-admin/admin-header.php'; $formaction = $action . 'comment'; $nonce_action = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_'; $nonce_action .= $comment_id; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <?php switch ( $action ) { case 'spam': $caution_msg = __( 'You are about to mark the following comment as spam:' ); $button = _x( 'Mark as spam', 'comment' ); break; case 'trash': $caution_msg = __( 'You are about to move the following comment to the Trash:' ); $button = __( 'Move to Trash' ); break; case 'delete': $caution_msg = __( 'You are about to delete the following comment:' ); $button = __( 'Permanently delete comment' ); break; default: $caution_msg = __( 'You are about to approve the following comment:' ); $button = __( 'Approve comment' ); break; } if ( '0' !== $comment->comment_approved ) { // If not unapproved. $message = ''; switch ( $comment->comment_approved ) { case '1': $message = __( 'This comment is currently approved.' ); break; case 'spam': $message = __( 'This comment is currently marked as spam.' ); break; case 'trash': $message = __( 'This comment is currently in the Trash.' ); break; } if ( $message ) { wp_admin_notice( $message, array( 'type' => 'info', 'id' => 'message', ) ); } } wp_admin_notice( '<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg, array( 'type' => 'warning', 'id' => 'message', ) ); ?> <table class="form-table comment-ays"> <tr> <th scope="row"><?php _e( 'Author' ); ?></th> <td><?php comment_author( $comment ); ?></td> </tr> <?php if ( get_comment_author_email( $comment ) ) { ?> <tr> <th scope="row"><?php _e( 'Email' ); ?></th> <td><?php comment_author_email( $comment ); ?></td> </tr> <?php } ?> <?php if ( get_comment_author_url( $comment ) ) { ?> <tr> <th scope="row"><?php _e( 'URL' ); ?></th> <td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td> </tr> <?php } ?> <tr> <th scope="row"><?php /* translators: Column name or table row header. */ _e( 'In response to' ); ?></th> <td> <?php $post_id = $comment->comment_post_ID; if ( current_user_can( 'edit_post', $post_id ) ) { $post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>"; $post_link .= esc_html( get_the_title( $post_id ) ) . '</a>'; } else { $post_link = esc_html( get_the_title( $post_id ) ); } echo $post_link; if ( $comment->comment_parent ) { $parent = get_comment( $comment->comment_parent ); $parent_link = esc_url( get_comment_link( $parent ) ); $name = get_comment_author( $parent ); printf( /* translators: %s: Comment link. */ ' | ' . __( 'In reply to %s.' ), '<a href="' . $parent_link . '">' . $name . '</a>' ); } ?> </td> </tr> <tr> <th scope="row"><?php _e( 'Submitted on' ); ?></th> <td> <?php $submitted = sprintf( /* translators: 1: Comment date, 2: Comment time. */ __( '%1$s at %2$s' ), /* translators: Comment date format. See https://www.php.net/manual/datetime.format.php */ get_comment_date( __( 'Y/m/d' ), $comment ), /* translators: Comment time format. See https://www.php.net/manual/datetime.format.php */ get_comment_date( __( 'g:i a' ), $comment ) ); if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) { echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>'; } else { echo $submitted; } ?> </td> </tr> <tr> <th scope="row"><?php /* translators: Field name in comment form. */ _ex( 'Comment', 'noun' ); ?></th> <td class="comment-content"> <?php comment_text( $comment ); ?> <p class="edit-comment"> <a href="<?php echo esc_url( admin_url( "comment.php?action=editcomment&c={$comment->comment_ID}" ) ); ?>"><?php esc_html_e( 'Edit' ); ?></a> </p> </td> </tr> </table> <form action="comment.php" method="get" class="comment-ays-submit"> <p> <?php submit_button( $button, 'primary', 'submit', false ); ?> <a href="<?php echo esc_url( admin_url( 'edit-comments.php' ) ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a> </p> <?php wp_nonce_field( $nonce_action ); ?> <input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" /> <input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" /> <input type="hidden" name="noredir" value="1" /> </form> </div> <?php break; case 'deletecomment': case 'trashcomment': case 'untrashcomment': case 'spamcomment': case 'unspamcomment': case 'approvecomment': case 'unapprovecomment': $comment_id = absint( $_REQUEST['c'] ); if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { check_admin_referer( 'approve-comment_' . $comment_id ); } else { check_admin_referer( 'delete-comment_' . $comment_id ); } $noredir = isset( $_REQUEST['noredir'] ); $comment = get_comment( $comment_id ); if ( ! $comment ) { comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) ); } if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) ); } if ( wp_get_referer() && ! $noredir && ! str_contains( wp_get_referer(), 'comment.php' ) ) { $redir = wp_get_referer(); } elseif ( wp_get_original_referer() && ! $noredir ) { $redir = wp_get_original_referer(); } elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) { $redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) ); } else { $redir = admin_url( 'edit-comments.php' ); } $redir = remove_query_arg( array( 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved' ), $redir ); switch ( $action ) { case 'deletecomment': wp_delete_comment( $comment ); $redir = add_query_arg( array( 'deleted' => '1' ), $redir ); break; case 'trashcomment': wp_trash_comment( $comment ); $redir = add_query_arg( array( 'trashed' => '1', 'ids' => $comment_id, ), $redir ); break; case 'untrashcomment': wp_untrash_comment( $comment ); $redir = add_query_arg( array( 'untrashed' => '1' ), $redir ); break; case 'spamcomment': wp_spam_comment( $comment ); $redir = add_query_arg( array( 'spammed' => '1', 'ids' => $comment_id, ), $redir ); break; case 'unspamcomment': wp_unspam_comment( $comment ); $redir = add_query_arg( array( 'unspammed' => '1' ), $redir ); break; case 'approvecomment': wp_set_comment_status( $comment, 'approve' ); $redir = add_query_arg( array( 'approved' => 1 ), $redir ); break; case 'unapprovecomment': wp_set_comment_status( $comment, 'hold' ); $redir = add_query_arg( array( 'unapproved' => 1 ), $redir ); break; } wp_redirect( $redir ); die; case 'editedcomment': $comment_id = absint( $_POST['comment_ID'] ); $comment_post_id = absint( $_POST['comment_post_ID'] ); check_admin_referer( 'update-comment_' . $comment_id ); $updated = edit_comment(); if ( is_wp_error( $updated ) ) { wp_die( $updated->get_error_message() ); } $location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id; /** * Filters the URI the user is redirected to after editing a comment in the admin. * * @since 2.1.0 * * @param string $location The URI the user will be redirected to. * @param int $comment_id The ID of the comment being edited. */ $location = apply_filters( 'comment_edit_redirect', $location, $comment_id ); wp_redirect( $location ); exit; default: wp_die( __( 'Unknown action.' ) ); } // End switch. require_once ABSPATH . 'wp-admin/admin-footer.php'; install-helper.php 0000644 00000015461 15024324530 0010205 0 ustar 00 <?php /** * Plugins may load this file to gain access to special helper functions * for plugin installation. This file is not included by WordPress and it is * recommended, to prevent fatal errors, that this file is included using * require_once. * * These functions are not optimized for speed, but they should only be used * once in a while, so speed shouldn't be a concern. If it is and you are * needing to use these functions a lot, you might experience timeouts. * If you do, then it is advised to just write the SQL code yourself. * * check_column( 'wp_links', 'link_description', 'mediumtext' ); * * if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) { * echo "ok\n"; * } * * // Check the column. * if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' "; * $q = $wpdb->query( $ddl ); * } * * $error_count = 0; * $tablename = $wpdb->links; * * if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) { * $res .= $tablename . ' - ok <br />'; * } else { * $res .= 'There was a problem with ' . $tablename . '<br />'; * ++$error_count; * } * * @package WordPress * @subpackage Plugin */ /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; if ( ! function_exists( 'maybe_create_table' ) ) : /** * Creates a table in the database if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $create_ddl SQL statement to create table. * @return bool True on success or if the table already exists. False on failure. */ function maybe_create_table( $table_name, $create_ddl ) { global $wpdb; foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { if ( $table === $table_name ) { return true; } } return false; } endif; if ( ! function_exists( 'maybe_add_column' ) ) : /** * Adds column to database table, if it doesn't already exist. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $create_ddl SQL statement to add column. * @return bool True on success or if the column already exists. False on failure. */ function maybe_add_column( $table_name, $column_name, $create_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } // Didn't find it, so try to create it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $create_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return true; } } return false; } endif; /** * Drops column from database table, if it exists. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $column_name Table column name. * @param string $drop_ddl SQL statement to drop column. * @return bool True on success or if the column doesn't exist. False on failure. */ function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { // Found it, so try to drop it. // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query. $wpdb->query( $drop_ddl ); // We cannot directly tell whether this succeeded! // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { if ( $column === $column_name ) { return false; } } } } // Else didn't find it. return true; } /** * Checks that database table column matches the criteria. * * Uses the SQL DESC for retrieving the table info for the column. It will help * understand the parameters, if you do more research on what column information * is returned by the SQL statement. Pass in null to skip checking that criteria. * * Column names returned from DESC table are case sensitive and are as listed: * * - Field * - Type * - Null * - Key * - Default * - Extra * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $table_name Database table name. * @param string $col_name Table column name. * @param string $col_type Table column type. * @param bool $is_null Optional. Check is null. * @param mixed $key Optional. Key info. * @param mixed $default_value Optional. Default value. * @param mixed $extra Optional. Extra value. * @return bool True, if matches. False, if not matching. */ function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) { global $wpdb; $diffs = 0; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names. $results = $wpdb->get_results( "DESC $table_name" ); foreach ( $results as $row ) { if ( $row->Field === $col_name ) { // Got our column, check the params. if ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) { ++$diffs; } if ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) { ++$diffs; } if ( ( null !== $key ) && ( $row->Key !== $key ) ) { ++$diffs; } if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) { ++$diffs; } if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) { ++$diffs; } if ( $diffs > 0 ) { return false; } return true; } // End if found our column. } return false; } widgets-form-blocks.php 0000644 00000011736 15024324530 0011145 0 ustar 00 <?php /** * The block-based widgets editor, for use in widgets.php. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } // Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); $block_editor_context = new WP_Block_Editor_Context( array( 'name' => 'core/edit-widgets' ) ); $preload_paths = array( array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), '/wp/v2/widget-types?context=edit&per_page=-1', '/wp/v2/sidebars?context=edit&per_page=-1', '/wp/v2/widgets?context=edit&per_page=-1&_embed=about', ); block_editor_rest_api_preload( $preload_paths, $block_editor_context ); $editor_settings = get_block_editor_settings( array_merge( get_legacy_widget_block_editor_settings(), array( 'styles' => get_block_editor_theme_styles() ) ), $block_editor_context ); // The widgets editor does not support the Block Directory, so don't load any of // its assets. This also prevents 'wp-editor' from being enqueued which we // cannot load in the widgets screen because many widget scripts rely on `wp.editor`. remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); wp_add_inline_script( 'wp-edit-widgets', sprintf( 'wp.domReady( function() { wp.editWidgets.initialize( "widgets-editor", %s ); } );', wp_json_encode( $editor_settings ) ) ); // Preload server-registered block schemas. wp_add_inline_script( 'wp-blocks', 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' ); // Preload server-registered block bindings sources. $registered_sources = get_all_registered_block_bindings_sources(); if ( ! empty( $registered_sources ) ) { $filtered_sources = array(); foreach ( $registered_sources as $source ) { $filtered_sources[] = array( 'name' => $source->name, 'label' => $source->label, 'usesContext' => $source->uses_context, ); } $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) ); wp_add_inline_script( 'wp-blocks', $script ); } wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $block_editor_context ) ) ), 'after' ); wp_enqueue_script( 'wp-edit-widgets' ); wp_enqueue_script( 'admin-widgets' ); wp_enqueue_style( 'wp-edit-widgets' ); /** This action is documented in wp-admin/edit-form-blocks.php */ do_action( 'enqueue_block_editor_assets' ); /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_setup' ); require_once ABSPATH . 'wp-admin/admin-header.php'; /** This action is documented in wp-admin/widgets-form.php */ do_action( 'widgets_admin_page' ); ?> <div id="widgets-editor" class="blocks-widgets-container"> <?php // JavaScript is disabled. ?> <div class="wrap hide-if-js widgets-editor-no-js"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> <?php if ( file_exists( WP_PLUGIN_DIR . '/classic-widgets/classic-widgets.php' ) ) { // If Classic Widgets is already installed, provide a link to activate the plugin. $installed = true; $plugin_activate_url = wp_nonce_url( 'plugins.php?action=activate&plugin=classic-widgets/classic-widgets.php', 'activate-plugin_classic-widgets/classic-widgets.php' ); $message = sprintf( /* translators: %s: Link to activate the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or activate the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_activate_url ) ); } else { // If Classic Widgets is not installed, provide a link to install it. $installed = false; $plugin_install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-widgets' ), 'install-plugin_classic-widgets' ); $message = sprintf( /* translators: %s: A link to install the Classic Widgets plugin. */ __( 'The block widgets require JavaScript. Please enable JavaScript in your browser settings, or install the <a href="%s">Classic Widgets plugin</a>.' ), esc_url( $plugin_install_url ) ); } /** * Filters the message displayed in the block widget interface when JavaScript is * not enabled in the browser. * * @since 6.4.0 * * @param string $message The message being displayed. * @param bool $installed Whether the Classic Widget plugin is installed. */ $message = apply_filters( 'block_widgets_no_javascript_message', $message, $installed ); wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> </div> </div> <?php /** This action is documented in wp-admin/widgets-form.php */ do_action( 'sidebar_admin_page' ); require_once ABSPATH . 'wp-admin/admin-footer.php'; ms-sites.php 0000644 00000000327 15024324530 0007021 0 ustar 00 <?php /** * Multisite sites administration panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ require_once __DIR__ . '/admin.php'; wp_redirect( network_admin_url( 'sites.php' ) ); exit; options-discussion.php 0000644 00000036626 15024324530 0011144 0 ustar 00 <?php /** * Discussion settings administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_options' ) ) { wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) ); } // Used in the HTML title tag. $title = __( 'Discussion Settings' ); $parent_file = 'options-general.php'; add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' ); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( '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.' ) . '</p>' . '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-discussion-screen/">Documentation on Discussion Settings</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <form method="post" action="options.php"> <?php settings_fields( 'discussion' ); ?> <table class="form-table indent-children" role="presentation"> <tr> <th scope="row"><?php _e( 'Default post settings' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Default post settings' ); ?> </span></legend> <label for="default_pingback_flag"> <input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked( '1', get_option( 'default_pingback_flag' ) ); ?> /> <?php _e( 'Attempt to notify any blogs linked to from the post' ); ?></label> <br /> <label for="default_ping_status"> <input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked( 'open', get_option( 'default_ping_status' ) ); ?> /> <?php _e( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new posts' ); ?></label> <br /> <label for="default_comment_status"> <input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked( 'open', get_option( 'default_comment_status' ) ); ?> /> <?php _e( 'Allow people to submit comments on new posts' ); ?></label> <br /> <p class="description"><?php _e( 'Individual posts may override these settings. Changes here will only be applied to new posts.' ); ?></p> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Other comment settings' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Other comment settings' ); ?> </span></legend> <label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked( '1', get_option( 'require_name_email' ) ); ?> /> <?php _e( 'Comment author must fill out name and email' ); ?></label> <br /> <label for="comment_registration"> <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked( '1', get_option( 'comment_registration' ) ); ?> /> <?php _e( 'Users must be registered and logged in to comment' ); ?> <?php if ( ! get_option( 'users_can_register' ) && is_multisite() ) { echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); } ?> </label> <br /> <input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> /> <label for="close_comments_for_old_posts"><?php _e( 'Automatically close comments on old posts' ); ?></label> <ul> <li> <label for="close_comments_days_old"><?php _e( 'Close comments when post is how many days old' ); ?></label> <input name="close_comments_days_old" type="number" step="1" min="0" id="close_comments_days_old" value="<?php echo esc_attr( get_option( 'close_comments_days_old' ) ); ?>" class="small-text"/> </li> </ul> <input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> /> <label for="show_comments_cookies_opt_in"><?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?></label> <br /> <input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> /> <label for="thread_comments"><?php _e( 'Enable threaded (nested) comments' ); ?></label> <?php /** * Filters the maximum depth of threaded/nested comments. * * @since 2.7.0 * * @param int $max_depth The maximum depth of threaded comments. Default 10. */ $maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 ); $thread_comments_depth = '<select name="thread_comments_depth" id="thread_comments_depth">'; for ( $i = 2; $i <= $maxdeep; $i++ ) { $thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'"; if ( (int) get_option( 'thread_comments_depth' ) === $i ) { $thread_comments_depth .= " selected='selected'"; } $thread_comments_depth .= ">$i</option>"; } $thread_comments_depth .= '</select>'; ?> <ul> <li> <label for="thread_comments_depth"><?php _e( 'Number of levels for threaded (nested) comments' ); ?></label> <?php echo $thread_comments_depth; ?> </li> </ul> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Comment Pagination' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Comment Pagination' ); ?> </span></legend> <input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> /> <label for="page_comments"><?php _e( 'Break comments into pages' ); ?></label> <ul> <li> <label for="comments_per_page"><?php _e( 'Top level comments per page' ); ?></label> <input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="<?php echo esc_attr( get_option( 'comments_per_page' ) ); ?>" class="small-text" /> </li> <li> <label for="default_comments_page"><?php _e( 'Comments page to display by default' ); ?></label> <select name="default_comments_page" id="default_comments_page"> <option value="newest" <?php selected( 'newest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'last page' ); ?></option> <option value="oldest" <?php selected( 'oldest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'first page' ); ?></option> </select> </li> <li> <label for="comment_order"><?php _e( 'Comments to display at the top of each page' ); ?></label> <select name="comment_order" id="comment_order"> <option value="asc" <?php selected( 'asc', get_option( 'comment_order' ) ); ?>><?php _e( 'older' ); ?></option> <option value="desc" <?php selected( 'desc', get_option( 'comment_order' ) ); ?>><?php _e( 'newer' ); ?></option> </select> </li> </ul> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Email me whenever' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Email me whenever' ); ?> </span></legend> <label for="comments_notify"> <input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> /> <?php _e( 'Anyone posts a comment' ); ?> </label> <br /> <label for="moderation_notify"> <input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> /> <?php _e( 'A comment is held for moderation' ); ?> </label> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Before a comment appears' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Before a comment appears' ); ?> </span></legend> <label for="comment_moderation"> <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> /> <?php _e( 'Comment must be manually approved' ); ?> </label> <br /> <label for="comment_previously_approved"><input type="checkbox" name="comment_previously_approved" id="comment_previously_approved" value="1" <?php checked( '1', get_option( 'comment_previously_approved' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label> </fieldset></td> </tr> <tr> <th scope="row"><?php _e( 'Comment Moderation' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Comment Moderation' ); ?> </span></legend> <p><label for="comment_max_links"> <?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’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 “press” will match “WordPress”.' ); ?></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"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser’s user agent string, it will be put in the Trash. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.' ); ?></label></p> <p> <textarea name="disallowed_keys" rows="10" cols="50" id="disallowed_keys" class="large-text code"><?php echo esc_textarea( get_option( 'disallowed_keys' ) ); ?></textarea> </p> </fieldset></td> </tr> <?php do_settings_fields( 'discussion', 'default' ); ?> </table> <h2 class="title"><?php _e( 'Avatars' ); ?></h2> <p><?php _e( 'An avatar is an image that can be associated with a user across multiple websites. In this area, you can choose to display avatars of users who interact with the site.' ); ?></p> <?php // The above would be a good place to link to the documentation on the Gravatar functions, for putting it in themes. Anything like that? $show_avatars = get_option( 'show_avatars' ); $show_avatars_class = ''; if ( ! $show_avatars ) { $show_avatars_class = ' hide-if-js'; } ?> <table class="form-table" role="presentation"> <tr> <th scope="row"><?php _e( 'Avatar Display' ); ?></th> <td> <label for="show_avatars"> <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> /> <?php _e( 'Show Avatars' ); ?> </label> </td> </tr> <tr class="avatar-settings<?php echo $show_avatars_class; ?>"> <th scope="row"><?php _e( 'Maximum Rating' ); ?></th> <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Maximum Rating' ); ?> </span></legend> <?php $ratings = array( /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ 'G' => __( 'G — Suitable for all audiences' ), /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ 'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above' ), /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ 'R' => __( 'R — Intended for adult audiences above 17' ), /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */ 'X' => __( 'X — Even more mature than above' ), ); foreach ( $ratings as $key => $rating ) : $selected = ( get_option( 'avatar_rating' ) === $key ) ? 'checked="checked"' : ''; echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr( $key ) . "' $selected/> $rating</label><br />"; endforeach; ?> </fieldset></td> </tr> <tr class="avatar-settings<?php echo $show_avatars_class; ?>"> <th scope="row"><?php _e( 'Default Avatar' ); ?></th> <td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span> <?php /* translators: Hidden accessibility text. */ _e( 'Default Avatar' ); ?> </span></legend> <p> <?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.' ); ?><br /> </p> <?php $avatar_defaults = array( 'mystery' => __( 'Mystery Person' ), 'blank' => __( 'Blank' ), 'gravatar_default' => __( 'Gravatar Logo' ), 'identicon' => __( 'Identicon (Generated)' ), 'wavatar' => __( 'Wavatar (Generated)' ), 'monsterid' => __( 'MonsterID (Generated)' ), 'retro' => __( 'Retro (Generated)' ), 'robohash' => __( 'RoboHash (Generated)' ), ); /** * Filters the default avatars. * * Avatars are stored in key/value pairs, where the key is option value, * and the name is the displayed avatar name. * * @since 2.6.0 * * @param string[] $avatar_defaults Associative array of default avatars. */ $avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults ); $default = get_option( 'avatar_default', 'mystery' ); $avatar_list = ''; // Force avatars on to display these choices. add_filter( 'pre_option_show_avatars', '__return_true', 100 ); foreach ( $avatar_defaults as $default_key => $default_name ) { $selected = ( $default === $default_key ) ? 'checked="checked" ' : ''; $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr( $default_key ) . "' {$selected}/> "; $avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) ); $avatar_list .= ' ' . $default_name . '</label>'; $avatar_list .= '<br />'; } remove_filter( 'pre_option_show_avatars', '__return_true', 100 ); /** * Filters the HTML output of the default avatar list. * * @since 2.6.0 * * @param string $avatar_list HTML markup of the avatar list. */ echo apply_filters( 'default_avatar_select', $avatar_list ); ?> </fieldset></td> </tr> <?php do_settings_fields( 'discussion', 'avatars' ); ?> </table> <?php do_settings_sections( 'discussion' ); ?> <?php submit_button(); ?> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?> profile.php 0000644 00000000433 15024324530 0006713 0 ustar 00 <?php /** * User Profile Administration Screen. * * @package WordPress * @subpackage Administration */ /** * This is a profile page. * * @since 2.5.0 * @var bool */ define( 'IS_PROFILE_PAGE', true ); /** Load User Editing Page */ require_once __DIR__ . '/user-edit.php'; images/spinner.gif 0000644 00000007110 15024324530 0010153 0 ustar 00 GIF89a � ��ݞ�������������뀀����!�NETSCAPE2.0 !� , @\x��.&�I�` V)@+ZD(�$˰���k�b�L��w�,��H�� �@G\��e�7S�(C�*8q��|��%L{�(t'���� !� , Px�0"&��)��C� � ���F0��g� ��H5M�#�$��l:5̧`��L�J���D��E���`����X !� , Px�0"F��)��C� � $PJ!n���g�ậ}����ۭ4��2�l:m�'G"�L�CZw9*e9���(=���4�$ !� , Px�0"F��)��C� �E$PJ!rq�wd�1,Cw ��ІFO3�m��*�ln�N��3�n(�f � d�.��=�EC$!+ !� , Nx�0"F��)��C� č�" ��٨�������n� j��q�<*��&g"����S�Z���SL�xI�� !� , Nx�0"F��)��C� č��=�wd�FYp ��F�G���3 �Uq�ܤ���f"�����3'pݶ$���Xv��Ē !� , Px�0"F��)��C� č��H~G�n���n�B@ͭ�-��'�AR����C2#�'g"�P�L���j\Nɂ�y,��HT$ !� , Ox�0"F��)��C� č��H~G����\�h7���#�|�0�R#�'g"�P\O!�)`ɜ$�C�X �cbI !� , Px�0"F��)��C� č��H~G�������]dn���w�$�@��=���f"�P\�إI�d\�i��y,��1�$ !� , Nx�0"F��)��C� č��H~G������ԯ�Ad�AA�_�C1��a"��h"�P\����d\N��}A��Ē !� , Ox�0"&��)��C� č��H~G������ԯ�o��`�N��Q�<�̄ȡ���K�&`ɶ��C�X �cbI !� , Ox�0"F��)��C� č��H~G������ԯ��)�!��-f���&�@Bq���%`ɶ#�C�X��D�H !� , Ox�0"F��)��C� č��H~G������ԯ����s���( ��2Lp��֬!��%`ɶ��C�X ���H !� , Lx�0"F��)��C� č��H~G������ԯ�����\ �H��f\�l����]z$��%ÒL�cq:�K !� , Mx�0"F��)��C� č��H~G������ԯ�����WORd�I�tQ\*�5���%�rJ�cY4 ��% !� , Lx�0"F��)��C� č��H~G������ԯ�����=��6p&���ek�F��#K���&��"K !� , Px�0"F��)��C� č��H~G������ԯ���> p'��ڇ��P��#z ���%n��x,��1�$ !� , Ox�0"F��)��C� č��H~G������ԯ���> p' n&9���0�'v� ��K� L�C�X �cbI !� , Px�0"F��)��C� č��H~G������ԯ�����Hp#j&� ���P���0�]z��Ȓ�<L�i��y,��1�$ !� , Ox�0"&��)��C� č��H~G������ԯ�����`��LF����4&B0rJE��L ���C�X �cbI !� , Nx�0"F��)��C� č��H~G������ԯ�����FBr�f� �B�M-U�"(�K� �� ��X��ג !� , Ox�0"F��)��C� č��H~G������ԯ�����=��3�&��¥���J���`�%�ڒC�X �ĴH !� , Kx�0"F��)��C� č��H~G������ԯ�����N8�P��,�X�(�A�] ��3-0U�E�H�� !� , Nx�0"F��)��C� č��H~G������ԯ������E�hL��hr\(9�L� ��.�GM��=9%��,Y�i� !� , Mx�0"F��)��C� č��H~G������ԯ���.D@P��7��% �(��%��L�cY4D�" !� , Px�0"F��)��C� č��H~G������ԯ����� ����0PR���|Q���J�d\�i��y,��1�$ !� , Mx�0"F��)��C� č��H~G������ԯ���8�.�a�D�'1 ��ɡ����&`ɶ*�" �t��% !� , Lx�0"F��)��C� č��H~G������ԯc��"����@�b��,��$ʡ���K ȒmU%���K !� , Qx�0"&��)��C� č��H~G������D �֎�5��7ap4��G���Q5��1vI�,�WU�`hˢyL, !� , Px�0"F��)��C� č��H~G���D��j�1(D�:S��J`#>��t4�r(Me�� X��Jx�n<�E�)! !� , Lx�0"F��)��C� č��H~G& *@D(p�5���� �l^�$0��䚆 tׂ�PJ��T�,�Dzh�$�E !� , Ox�0"F��)��C� č��3r�wdq �̚y�u�+�ʱ 25�0�l��N�s4�r(���]�!��y,`GjbI !� , Nx�0"F��)��C� č�P ��&|G&L�����lB���<z.�r�1]��f"�P��ɉ|�M���Xv��Ē !� , Px�0"F��)��C� $QJ!Qr�wdưfw [�йg��i�dD�l�^�H1Z�Q `�w�&c�S�Z`�K)-+ !� , Px�0"F��)��C� dL'PJI !n�w�:s�pq�N@:�HXr�Z�N�$��P9��3��"c���d�$=���1�$ !� , Px�0"F��)��C� d@1p���m����p#A�<0H48�Er�\j�H��7�r(�i`E�t]�j�)z,��1�$ ; images/arrows.png 0000644 00000000363 15024324530 0010034 0 ustar 00 �PNG IHDR { YKǮ $PLTE �����������������������������������"