set_parentage( $parent_file ); ?>
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'; } link-manager.php000064400000010415147573123700007634 0ustar00current_action(); if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { check_admin_referer( 'bulk-bookmarks' ); $redirect_to = admin_url( 'link-manager.php' ); $bulklinks = (array) $_REQUEST['linkcheck']; if ( 'delete' === $doaction ) { foreach ( $bulklinks as $link_id ) { $link_id = (int) $link_id; wp_delete_link( $link_id ); } $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to ); } else { $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, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } wp_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(); // Used in the HTML title tag. $title = __( 'Links' ); $this_file = 'link-manager.php'; $parent_file = $this_file; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '

' . sprintf( /* translators: %s: URL to Widgets screen. */ __( 'You can add links here to be displayed on your site, usually using Widgets. By default, links to several sites in the WordPress community are included as examples.' ), 'widgets.php' ) . '

' . '

' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '

' . '

' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '

', ) ); get_current_screen()->add_help_tab( array( 'id' => 'deleting-links', 'title' => __( 'Deleting Links' ), 'content' => '

' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Managing Links' ) . '

' . '

' . __( 'Support forums' ) . '

' ); get_current_screen()->set_screen_reader_content( array( 'heading_list' => __( 'Links list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); } ?>

'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '' ); echo ''; } ?>
'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); } ?>
search_box( __( 'Search Links' ), 'link' ); ?> display(); ?>
name, get_taxonomies( array( 'show_ui' => true ) ), true ) ) { wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) ); } if ( ! current_user_can( $tax->cap->manage_terms ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ) . '

', 403 ); } /** * $post_type is set when the WP_Terms_List_Table instance is created. * * @global string $post_type Global post type. */ global $post_type; $wp_list_table = _get_list_table( 'WP_Terms_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); $title = $tax->labels->name; 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' === $tax->name ) { $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"; } add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $tax->name . '_per_page', ) ); get_current_screen()->set_screen_reader_content( array( 'heading_pagination' => $tax->labels->items_list_navigation, 'heading_list' => $tax->labels->items_list, ) ); $location = false; $referer = wp_get_referer(); if ( ! $referer ) { // For POST requests. $referer = wp_unslash( $_SERVER['REQUEST_URI'] ); } $referer = remove_query_arg( array( '_wp_http_referer', '_wpnonce', 'error', 'message', 'paged' ), $referer ); switch ( $wp_list_table->current_action() ) { case 'add-tag': check_admin_referer( 'add-tag', '_wpnonce_add-tag' ); if ( ! current_user_can( $tax->cap->edit_terms ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to create terms in this taxonomy.' ) . '

', 403 ); } $ret = wp_insert_term( $_POST['tag-name'], $taxonomy, $_POST ); if ( $ret && ! is_wp_error( $ret ) ) { $location = add_query_arg( 'message', 1, $referer ); } else { $location = add_query_arg( array( 'error' => true, 'message' => 4, ), $referer ); } break; case 'delete': if ( ! isset( $_REQUEST['tag_ID'] ) ) { break; } $tag_ID = (int) $_REQUEST['tag_ID']; check_admin_referer( 'delete-tag_' . $tag_ID ); if ( ! current_user_can( 'delete_term', $tag_ID ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete this item.' ) . '

', 403 ); } wp_delete_term( $tag_ID, $taxonomy ); $location = add_query_arg( 'message', 2, $referer ); // When deleting a term, prevent the action from redirecting back to a term that no longer exists. $location = remove_query_arg( array( 'tag_ID', 'action' ), $location ); break; case 'bulk-delete': check_admin_referer( 'bulk-tags' ); if ( ! current_user_can( $tax->cap->delete_terms ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete these items.' ) . '

', 403 ); } $tags = (array) $_REQUEST['delete_tags']; foreach ( $tags as $tag_ID ) { wp_delete_term( $tag_ID, $taxonomy ); } $location = add_query_arg( 'message', 6, $referer ); break; case 'edit': if ( ! isset( $_REQUEST['tag_ID'] ) ) { break; } $term_id = (int) $_REQUEST['tag_ID']; $term = get_term( $term_id ); if ( ! $term instanceof WP_Term ) { wp_die( __( 'You attempted to edit an item that does not exist. Perhaps it was deleted?' ) ); } wp_redirect( sanitize_url( get_edit_term_link( $term_id, $taxonomy, $post_type ) ) ); exit; case 'editedtag': $tag_ID = (int) $_POST['tag_ID']; check_admin_referer( 'update-tag_' . $tag_ID ); if ( ! current_user_can( 'edit_term', $tag_ID ) ) { wp_die( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to edit this item.' ) . '

', 403 ); } $tag = get_term( $tag_ID, $taxonomy ); if ( ! $tag ) { wp_die( __( 'You attempted to edit an item that does not exist. Perhaps it was deleted?' ) ); } $ret = wp_update_term( $tag_ID, $taxonomy, $_POST ); if ( $ret && ! is_wp_error( $ret ) ) { $location = add_query_arg( 'message', 3, $referer ); } else { $location = add_query_arg( array( 'error' => true, 'message' => 5, ), $referer ); } break; default: if ( ! $wp_list_table->current_action() || ! isset( $_REQUEST['delete_tags'] ) ) { break; } check_admin_referer( 'bulk-tags' ); $screen = get_current_screen()->id; $tags = (array) $_REQUEST['delete_tags']; /** This action is documented in wp-admin/edit.php */ $location = apply_filters( "handle_bulk_actions-{$screen}", $location, $wp_list_table->current_action(), $tags ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores break; } if ( ! $location && ! empty( $_REQUEST['_wp_http_referer'] ) ) { $location = remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ); } if ( $location ) { if ( $pagenum > 1 ) { $location = add_query_arg( 'paged', $pagenum, $location ); // $pagenum takes care of $total_pages. } if ( 1 === $pagenum ) { $location = remove_query_arg( 'paged', $location ); } /** * Filters the taxonomy redirect destination URL. * * @since 4.6.0 * * @param string $location The destination URL. * @param WP_Taxonomy $tax The taxonomy object. */ wp_redirect( apply_filters( 'redirect_term_location', $location, $tax ) ); 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; } wp_enqueue_script( 'admin-tags' ); if ( current_user_can( $tax->cap->edit_terms ) ) { wp_enqueue_script( 'inline-edit-tax' ); } if ( 'category' === $taxonomy || 'link_category' === $taxonomy || 'post_tag' === $taxonomy ) { $help = ''; if ( 'category' === $taxonomy ) { $help = '

' . sprintf( /* translators: %s: URL to Writing Settings screen. */ __( 'You can use categories to define sections of your site and group related posts. The default category is “Uncategorized” until you change it in your writing settings.' ), 'options-writing.php' ) . '

'; } elseif ( 'link_category' === $taxonomy ) { $help = '

' . __( 'You can create groups of links by using Link Categories. Link Category names must be unique and Link Categories are separate from the categories you use for posts.' ) . '

'; } else { $help = '

' . __( 'You can assign keywords to your posts using tags. Unlike categories, tags have no hierarchy, meaning there is no relationship from one tag to another.' ) . '

'; } if ( 'link_category' === $taxonomy ) { $help .= '

' . __( 'You can delete Link Categories in the Bulk Action pull-down, but that action does not delete the links within the category. Instead, it moves them to the default Link Category.' ) . '

'; } else { $help .= '

' . __( 'What’s the difference between categories and tags? Normally, tags are ad-hoc keywords that identify important information in your post (names, subjects, etc) that may or may not recur in other posts, while categories are pre-determined sections. If you think of your site like a book, the categories are like the Table of Contents and the tags are like the terms in the index.' ) . '

'; } get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); if ( 'category' === $taxonomy || 'post_tag' === $taxonomy ) { if ( 'category' === $taxonomy ) { $help = '

' . __( 'When adding a new category on this screen, you’ll fill in the following fields:' ) . '

'; } else { $help = '

' . __( 'When adding a new tag on this screen, you’ll fill in the following fields:' ) . '

'; } $help .= '
    ' . '
  • ' . __( 'Name — The name is how it appears on your site.' ) . '
  • '; $help .= '
  • ' . __( 'Slug — The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ) . '
  • '; if ( 'category' === $taxonomy ) { $help .= '
  • ' . __( 'Parent — Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have child categories for Bebop and Big Band. Totally optional. To create a subcategory, just choose another category from the Parent dropdown.' ) . '
  • '; } $help .= '
  • ' . __( 'Description — The description is not prominent by default; however, some themes may display it.' ) . '
  • ' . '
' . '

' . __( 'You can change the display of this screen using the Screen Options tab to set how many items are displayed per screen and to display/hide columns in the table.' ) . '

'; get_current_screen()->add_help_tab( array( 'id' => 'adding-terms', 'title' => 'category' === $taxonomy ? __( 'Adding Categories' ) : __( 'Adding Tags' ), 'content' => $help, ) ); } $help = '

' . __( 'For more information:' ) . '

'; if ( 'category' === $taxonomy ) { $help .= '

' . __( 'Documentation on Categories' ) . '

'; } elseif ( 'link_category' === $taxonomy ) { $help .= '

' . __( 'Documentation on Link Categories' ) . '

'; } else { $help .= '

' . __( 'Documentation on Tags' ) . '

'; } $help .= '

' . __( 'Support forums' ) . '

'; get_current_screen()->set_help_sidebar( $help ); unset( $help ); } require_once ABSPATH . 'wp-admin/admin-header.php'; // Also used by the Edit Tag form. require_once ABSPATH . 'wp-admin/includes/edit-tag-messages.php'; if ( is_plugin_active( 'wpcat2tag-importer/wpcat2tag-importer.php' ) ) { $import_link = admin_url( 'admin.php?import=wpcat2tag' ); } else { $import_link = admin_url( 'import.php' ); } ?>

'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '' ); echo ''; } ?>
'message', 'additional_classes' => array( $class ), 'dismissible' => true, ) ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] ); } ?>
search_box( $tax->labels->search_items, 'tag' ); ?>
cap->edit_terms ); if ( $can_edit_terms ) { ?>
0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' ); } elseif ( 'link_category' === $taxonomy ) { /** * Fires before the link category form. * * @since 2.3.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead. * * @param object $arg Optional arguments cast to an object. */ do_action_deprecated( 'add_link_category_form_pre', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_pre_add_form' ); } else { /** * Fires before the Add Tag form. * * @since 2.5.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_pre_add_form'} instead. * * @param string $taxonomy The taxonomy slug. */ do_action_deprecated( 'add_tag_form_pre', array( $taxonomy ), '3.0.0', '{$taxonomy}_pre_add_form' ); } /** * Fires before the Add Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_pre_add_form` * - `post_tag_pre_add_form` * * @since 3.0.0 * * @param string $taxonomy The taxonomy slug. */ do_action( "{$taxonomy}_pre_add_form", $taxonomy ); ?>

labels->add_new_item; ?>

>

labels->name_field_description; ?>

labels->slug_field_description; ?>

0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __( 'None' ), ); /** * Filters the taxonomy parent drop-down on the Edit Term page. * * @since 3.7.0 * @since 4.2.0 Added `$context` parameter. * * @param array $dropdown_args { * An array of taxonomy parent drop-down arguments. * * @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0. * @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false. * @type string $taxonomy The taxonomy slug. * @type string $name Value of the name attribute to use for the drop-down select element. * Default 'parent'. * @type string $orderby The field to order by. Default 'name'. * @type bool $hierarchical Whether the taxonomy is hierarchical. Default true. * @type string $show_option_none Label to display if there are no terms. Default 'None'. * } * @param string $taxonomy The taxonomy slug. * @param string $context Filter context. Accepts 'new' or 'edit'. */ $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' ); $dropdown_args['aria_describedby'] = 'parent-description'; wp_dropdown_categories( $dropdown_args ); ?>

labels->parent_field_description; ?>

labels->desc_field_description; ?>

labels->add_new_item, 'primary', 'submit', false ); ?>

0 ) ), '3.0.0', '{$taxonomy}_add_form' ); } elseif ( 'link_category' === $taxonomy ) { /** * Fires at the end of the Edit Link form. * * @since 2.3.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead. * * @param object $arg Optional arguments cast to an object. */ do_action_deprecated( 'edit_link_category_form', array( (object) array( 'parent' => 0 ) ), '3.0.0', '{$taxonomy}_add_form' ); } else { /** * Fires at the end of the Add Tag form. * * @since 2.7.0 * @deprecated 3.0.0 Use {@see '{$taxonomy}_add_form'} instead. * * @param string $taxonomy The taxonomy slug. */ do_action_deprecated( 'add_tag_form', array( $taxonomy ), '3.0.0', '{$taxonomy}_add_form' ); } /** * Fires at the end of the Add Term form for all taxonomies. * * The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `category_add_form` * - `post_tag_add_form` * * @since 3.0.0 * * @param string $taxonomy The taxonomy slug. */ do_action( "{$taxonomy}_add_form", $taxonomy ); ?>
views(); ?>
display(); ?>

' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '' ); ?>

category to tag converter.' ), esc_url( $import_link ) ); ?>

tag to category converter.' ), esc_url( $import_link ) ); ?>

inline_edit(); require_once ABSPATH . 'wp-admin/admin-footer.php'; upgrade-functions.php000064400000000525147573123700010725 0ustar00domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) ); /** * Filters whether to redirect the request to the User Admin in Multisite. * * @since 3.2.0 * * @param bool $redirect_user_admin_request Whether the request should be redirected. */ $redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request ); if ( $redirect_user_admin_request ) { wp_redirect( user_admin_url() ); exit; } unset( $redirect_user_admin_request ); user/profile.php000064400000000374147573123700007710 0ustar00db_version(); $php_compat = version_compare( $php_version, $required_php_version, '>=' ); if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) { $mysql_compat = true; } else { $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); } header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); ?> > <?php _e( 'WordPress › Update' ); ?>

' . sprintf( /* translators: %s: URL to Update PHP page. */ __( 'Learn more about updating PHP.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $php_update_message .= '

' . $annotation . ''; } 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 WordPress %2$s 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, $wp_version, $required_php_version, $required_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 WordPress %2$s requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_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 WordPress %2$s requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); } echo '

' . $message . '

'; ?>

widgets-form-blocks.php000064400000011736147573123700011160 0ustar00is_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' ); ?>

Classic Widgets plugin.' ), 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 Classic Widgets plugin.' ), 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' ), ) ); ?>

Version %1$s addressed %2$s bug.', 'Version %1$s addressed %2$s bugs.', 35 ), '6.7.2', '35' ); ?> the release notes.' ), sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), sanitize_title( '6.7.2' ) ) ); ?>

Version %1$s addressed %2$s bug.', 'Version %1$s addressed %2$s bugs.', 16 ), '6.7.1', '16' ); ?> the release notes.' ), sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ), sanitize_title( '6.7.1' ) ) ); ?>






Learn WordPress is a free resource for new and experienced WordPress users. Learn is stocked with how-to videos on using various features in WordPress, interactive workshops for exploring topics in-depth, and lesson plans for diving deep into specific areas of WordPress.' ), 'https://learn.wordpress.org/', 'https://learn.wordpress.org/online-workshops/' ); ?>


%2$s | ', esc_url( self_admin_url( 'update-core.php' ) ), is_multisite() ? __( 'Go to Updates' ) : __( 'Go to Dashboard → Updates' ) ); } printf( '%2$s', esc_url( self_admin_url() ), is_blog_admin() ? __( 'Go to Dashboard → Home' ) : __( 'Go to Dashboard' ) ); ?>
Version %s addressed one security issue.' ); /* translators: %s: WordPress version number. */ __( 'Version %s addressed some security issues.' ); /* translators: 1: WordPress version number, 2: Plural number of bugs. */ _n_noop( 'Version %1$s addressed %2$s bug.', 'Version %1$s addressed %2$s bugs.' ); /* translators: 1: WordPress version number, 2: Plural number of bugs. Singular security issue. */ _n_noop( 'Version %1$s addressed a security issue and fixed %2$s bug.', 'Version %1$s addressed a security issue and fixed %2$s bugs.' ); /* translators: 1: WordPress version number, 2: Plural number of bugs. More than one security issue. */ _n_noop( 'Version %1$s addressed some security issues and fixed %2$s bug.', 'Version %1$s addressed some security issues and fixed %2$s bugs.' ); /* translators: %s: Documentation URL. */ __( 'For more information, see the release notes.' ); /* translators: 1: WordPress version number, 2: Link to update WordPress */ __( 'Important! Your version of WordPress (%1$s) is no longer supported, you will not receive any security updates for your website. To keep your site secure, please update to the latest version of WordPress.' ); /* translators: 1: WordPress version number, 2: Link to update WordPress */ __( 'Important! Your version of WordPress (%1$s) will stop receiving security updates in the near future. To keep your site secure, please update to the latest version of WordPress.' ); /* translators: %s: The major version of WordPress for this branch. */ __( 'This is the final release of WordPress %s' ); /* translators: The localized WordPress download URL. */ __( 'https://wordpress.org/download/' ); options-head.php000064400000001044147573123700007657 0ustar00add_help_tab( array( 'id' => 'converter', 'title' => __( 'Categories and Tags Converter' ), 'content' => '

' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '

' . '

' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Tools' ) . '

' . '

' . __( 'Support forums' ) . '

' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) : ?>

Categories and Tags Converter available from the Import screen.' ), 'import.php' ); ?>

' . __( 'You need a higher level of permission.' ) . '' . '

' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '

', 403 ); } // Used in the HTML title tag. $title = __( 'Menus' ); wp_enqueue_script( 'nav-menu' ); if ( wp_is_mobile() ) { wp_enqueue_script( 'jquery-touch-punch' ); } // Container for any messages displayed to the user. $messages = array(); // Container that stores the name of the active menu. $nav_menu_selected_title = ''; // The menu id of the current menu being edited. $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0; // Get existing menu locations assignments. $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); $num_locations = count( array_keys( $locations ) ); // Allowed actions: add, update, delete. $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit'; /* * If a JSON blob of navigation menu data is found, expand it and inject it * into `$_POST` to avoid PHP `max_input_vars` limitations. See #14134. */ _wp_expand_nav_menu_post_data(); switch ( $action ) { case 'add-menu-item': check_admin_referer( 'add-menu_item', 'menu-settings-column-nonce' ); if ( isset( $_REQUEST['nav-menu-locations'] ) ) { set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_REQUEST['menu-locations'] ) ); } elseif ( isset( $_REQUEST['menu-item'] ) ) { wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] ); } break; case 'move-down-menu-item': // Moving down a menu item is the same as moving up the next in order. check_admin_referer( 'move-menu_item' ); $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0; if ( is_nav_menu_item( $menu_item_id ) ) { $menus = isset( $_REQUEST['menu'] ) ? array( (int) $_REQUEST['menu'] ) : wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) { $menu_id = (int) $menus[0]; $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); // Set up the data we need in one pass through the array of menu items. $dbids_to_orders = array(); $orders_to_dbids = array(); foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) { if ( isset( $ordered_menu_item_object->ID ) ) { if ( isset( $ordered_menu_item_object->menu_order ) ) { $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order; $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID; } } } // Get next in order. if ( isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ] ) ) { $next_item_id = $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] + 1 ]; $next_item_data = (array) wp_setup_nav_menu_item( get_post( $next_item_id ) ); // If not siblings of same parent, bubble menu item up but keep order. if ( ! empty( $menu_item_data['menu_item_parent'] ) && ( empty( $next_item_data['menu_item_parent'] ) || (int) $next_item_data['menu_item_parent'] !== (int) $menu_item_data['menu_item_parent'] ) ) { if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $parent_db_id = (int) $menu_item_data['menu_item_parent']; } else { $parent_db_id = 0; } $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) ); if ( ! is_wp_error( $parent_object ) ) { $parent_data = (array) $parent_object; $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent']; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); } // Make menu item a child of its next sibling. } else { $next_item_data['menu_order'] = $next_item_data['menu_order'] - 1; $menu_item_data['menu_order'] = $menu_item_data['menu_order'] + 1; $menu_item_data['menu_item_parent'] = $next_item_data['ID']; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); wp_update_post( $next_item_data ); } // The item is last but still has a parent, so bubble up. } elseif ( ! empty( $menu_item_data['menu_item_parent'] ) && in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $menu_item_data['menu_item_parent'] = (int) get_post_meta( $menu_item_data['menu_item_parent'], '_menu_item_menu_item_parent', true ); // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); } } } break; case 'move-up-menu-item': check_admin_referer( 'move-menu_item' ); $menu_item_id = isset( $_REQUEST['menu-item'] ) ? (int) $_REQUEST['menu-item'] : 0; if ( is_nav_menu_item( $menu_item_id ) ) { if ( isset( $_REQUEST['menu'] ) ) { $menus = array( (int) $_REQUEST['menu'] ); } else { $menus = wp_get_object_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); } if ( ! is_wp_error( $menus ) && ! empty( $menus[0] ) ) { $menu_id = (int) $menus[0]; $ordered_menu_items = wp_get_nav_menu_items( $menu_id ); $menu_item_data = (array) wp_setup_nav_menu_item( get_post( $menu_item_id ) ); // Set up the data we need in one pass through the array of menu items. $dbids_to_orders = array(); $orders_to_dbids = array(); foreach ( (array) $ordered_menu_items as $ordered_menu_item_object ) { if ( isset( $ordered_menu_item_object->ID ) ) { if ( isset( $ordered_menu_item_object->menu_order ) ) { $dbids_to_orders[ $ordered_menu_item_object->ID ] = $ordered_menu_item_object->menu_order; $orders_to_dbids[ $ordered_menu_item_object->menu_order ] = $ordered_menu_item_object->ID; } } } // If this menu item is not first. if ( ! empty( $dbids_to_orders[ $menu_item_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ) { // If this menu item is a child of the previous. if ( ! empty( $menu_item_data['menu_item_parent'] ) && in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) && isset( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) && ( (int) $menu_item_data['menu_item_parent'] === $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) ) { if ( in_array( (int) $menu_item_data['menu_item_parent'], $orders_to_dbids, true ) ) { $parent_db_id = (int) $menu_item_data['menu_item_parent']; } else { $parent_db_id = 0; } $parent_object = wp_setup_nav_menu_item( get_post( $parent_db_id ) ); if ( ! is_wp_error( $parent_object ) ) { $parent_data = (array) $parent_object; /* * If there is something before the parent and parent a child of it, * make menu item a child also of it. */ if ( ! empty( $dbids_to_orders[ $parent_db_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] ) && ! empty( $parent_data['menu_item_parent'] ) ) { $menu_item_data['menu_item_parent'] = $parent_data['menu_item_parent']; /* * Else if there is something before parent and parent not a child of it, * make menu item a child of that something's parent */ } elseif ( ! empty( $dbids_to_orders[ $parent_db_id ] ) && ! empty( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ] ) ) { $_possible_parent_id = (int) get_post_meta( $orders_to_dbids[ $dbids_to_orders[ $parent_db_id ] - 1 ], '_menu_item_menu_item_parent', true ); if ( in_array( $_possible_parent_id, array_keys( $dbids_to_orders ), true ) ) { $menu_item_data['menu_item_parent'] = $_possible_parent_id; } else { $menu_item_data['menu_item_parent'] = 0; } // Else there isn't something before the parent. } else { $menu_item_data['menu_item_parent'] = 0; } // Set former parent's [menu_order] to that of menu-item's. $parent_data['menu_order'] = $parent_data['menu_order'] + 1; // Set menu-item's [menu_order] to that of former parent. $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1; // Save changes. update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); wp_update_post( $parent_data ); } // Else this menu item is not a child of the previous. } elseif ( empty( $menu_item_data['menu_order'] ) || empty( $menu_item_data['menu_item_parent'] ) || ! in_array( (int) $menu_item_data['menu_item_parent'], array_keys( $dbids_to_orders ), true ) || empty( $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] ) || $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ] !== (int) $menu_item_data['menu_item_parent'] ) { // Just make it a child of the previous; keep the order. $menu_item_data['menu_item_parent'] = (int) $orders_to_dbids[ $dbids_to_orders[ $menu_item_id ] - 1 ]; // Reset invalid `menu_item_parent`. $menu_item_data = _wp_reset_invalid_menu_item_parent( $menu_item_data ); update_post_meta( $menu_item_data['ID'], '_menu_item_menu_item_parent', (int) $menu_item_data['menu_item_parent'] ); wp_update_post( $menu_item_data ); } } } } break; case 'delete-menu-item': $menu_item_id = (int) $_REQUEST['menu-item']; check_admin_referer( 'delete-menu_item_' . $menu_item_id ); if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) { $messages[] = wp_get_admin_notice( __( 'The menu item has been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'delete': check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id ); if ( is_nav_menu( $nav_menu_selected_id ) ) { $deletion = wp_delete_nav_menu( $nav_menu_selected_id ); } else { // Reset the selected menu. $nav_menu_selected_id = 0; unset( $_REQUEST['menu'] ); } if ( ! isset( $deletion ) ) { break; } if ( is_wp_error( $deletion ) ) { $messages[] = wp_get_admin_notice( $deletion->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $messages[] = wp_get_admin_notice( __( 'The menu has been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'delete_menus': check_admin_referer( 'nav_menus_bulk_actions' ); foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) { if ( ! is_nav_menu( $menu_id_to_delete ) ) { continue; } $deletion = wp_delete_nav_menu( $menu_id_to_delete ); if ( is_wp_error( $deletion ) ) { $messages[] = wp_get_admin_notice( $deletion->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $deletion_error = true; } } if ( empty( $deletion_error ) ) { $messages[] = wp_get_admin_notice( __( 'Selected menus have been successfully deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; case 'update': check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' ); // Merge new and existing menu locations if any new ones are set. $new_menu_locations = array(); if ( isset( $_POST['menu-locations'] ) ) { $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); $menu_locations = array_merge( $menu_locations, $new_menu_locations ); } // Add Menu. if ( 0 === $nav_menu_selected_id ) { $new_menu_title = trim( esc_html( $_POST['menu-name'] ) ); if ( $new_menu_title ) { $_nav_menu_selected_id = wp_update_nav_menu_object( 0, array( 'menu-name' => $new_menu_title ) ); if ( is_wp_error( $_nav_menu_selected_id ) ) { $messages[] = wp_get_admin_notice( $_nav_menu_selected_id->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); $nav_menu_selected_id = $_nav_menu_selected_id; $nav_menu_selected_title = $_menu_object->name; if ( isset( $_REQUEST['menu-item'] ) ) { wp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) ); } if ( isset( $_REQUEST['zero-menu-state'] ) || ! empty( $_POST['auto-add-pages'] ) ) { // If there are menu items, add them. wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ); } if ( isset( $_REQUEST['zero-menu-state'] ) ) { // Auto-save nav_menu_locations. $locations = get_nav_menu_locations(); foreach ( $locations as $location => $menu_id ) { $locations[ $location ] = $nav_menu_selected_id; break; // There should only be 1. } set_theme_mod( 'nav_menu_locations', $locations ); } elseif ( count( $new_menu_locations ) > 0 ) { // If locations have been selected for the new menu, save those. $locations = get_nav_menu_locations(); foreach ( array_keys( $new_menu_locations ) as $location ) { $locations[ $location ] = $nav_menu_selected_id; } set_theme_mod( 'nav_menu_locations', $locations ); } if ( isset( $_REQUEST['use-location'] ) ) { $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); if ( isset( $locations[ $_REQUEST['use-location'] ] ) ) { $menu_locations[ $_REQUEST['use-location'] ] = $nav_menu_selected_id; } set_theme_mod( 'nav_menu_locations', $menu_locations ); } wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) ); exit; } } else { $messages[] = wp_get_admin_notice( __( 'Please enter a valid menu name.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } // Update existing menu. } else { // Remove menu locations that have been unchecked. foreach ( $locations as $location => $description ) { if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] === $nav_menu_selected_id ) { unset( $menu_locations[ $location ] ); } } // Set menu locations. set_theme_mod( 'nav_menu_locations', $menu_locations ); $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ); $menu_title = trim( esc_html( $_POST['menu-name'] ) ); if ( ! $menu_title ) { $messages[] = wp_get_admin_notice( __( 'Please enter a valid menu name.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $menu_title = $_menu_object->name; } if ( ! is_wp_error( $_menu_object ) ) { $_nav_menu_selected_id = wp_update_nav_menu_object( $nav_menu_selected_id, array( 'menu-name' => $menu_title ) ); if ( is_wp_error( $_nav_menu_selected_id ) ) { $_menu_object = $_nav_menu_selected_id; $messages[] = wp_get_admin_notice( $_nav_menu_selected_id->get_error_message(), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); } else { $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); $nav_menu_selected_title = $_menu_object->name; } } // Update menu items. if ( ! is_wp_error( $_menu_object ) ) { $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $_nav_menu_selected_id, $nav_menu_selected_title ) ); // If the menu ID changed, redirect to the new URL. if ( $nav_menu_selected_id !== $_nav_menu_selected_id ) { wp_redirect( admin_url( 'nav-menus.php?menu=' . (int) $_nav_menu_selected_id ) ); exit; } } } break; case 'locations': if ( ! $num_locations ) { wp_redirect( admin_url( 'nav-menus.php' ) ); exit; } add_filter( 'screen_options_show_screen', '__return_false' ); if ( isset( $_POST['menu-locations'] ) ) { check_admin_referer( 'save-menu-locations' ); $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] ); $menu_locations = array_merge( $menu_locations, $new_menu_locations ); // Set menu locations. set_theme_mod( 'nav_menu_locations', $menu_locations ); $messages[] = wp_get_admin_notice( __( 'Menu locations updated.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } break; } // Get all nav menus. $nav_menus = wp_get_nav_menus(); $menu_count = count( $nav_menus ); // Are we on the add new screen? $add_new_screen = ( isset( $_GET['menu'] ) && 0 === (int) $_GET['menu'] ) ? true : false; $locations_screen = ( isset( $_GET['action'] ) && 'locations' === $_GET['action'] ) ? true : false; $page_count = wp_count_posts( 'page' ); /* * If we have one theme location, and zero menus, we take them right * into editing their first menu. */ if ( 1 === count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) { $one_theme_location_no_menus = true; } else { $one_theme_location_no_menus = false; } $nav_menus_l10n = array( 'oneThemeLocationNoMenus' => $one_theme_location_no_menus, 'moveUp' => __( 'Move up one' ), 'moveDown' => __( 'Move down one' ), 'moveToTop' => __( 'Move to the top' ), /* translators: %s: Previous item name. */ 'moveUnder' => __( 'Move under %s' ), /* translators: %s: Previous item name. */ 'moveOutFrom' => __( 'Move out from under %s' ), /* translators: %s: Previous item name. */ 'under' => __( 'Under %s' ), /* translators: %s: Previous item name. */ 'outFrom' => __( 'Out from under %s' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items. */ 'menuFocus' => __( 'Edit %1$s (%2$s, %3$d of %4$d)' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent. */ 'subMenuFocus' => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s)' ), /* translators: 1: Item name, 2: Item type, 3: Item index, 4: Total items, 5: Item parent, 6: Item depth. */ 'subMenuMoreDepthFocus' => __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s, level %6$d)' ), /* translators: %s: Item name. */ 'menuItemDeletion' => __( 'item %s' ), /* translators: %s: Item name. */ 'itemsDeleted' => __( 'Deleted menu item: %s.' ), 'itemAdded' => __( 'Menu item added' ), 'itemRemoved' => __( 'Menu item removed' ), 'movedUp' => __( 'Menu item moved up' ), 'movedDown' => __( 'Menu item moved down' ), 'movedTop' => __( 'Menu item moved to the top' ), 'movedLeft' => __( 'Menu item moved out of submenu' ), 'movedRight' => __( 'Menu item is now a sub-item' ), 'parentUpdated' => __( 'Menu parent updated' ), 'orderUpdated' => __( 'Menu order updated' ), ); wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n ); /* * Redirect to add screen if there are no menus and this users has either zero, * or more than 1 theme locations. */ if ( 0 === $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus ) { wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) ); } // Get recently edited nav menu. $recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) ); if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) ) { $recently_edited = $nav_menu_selected_id; } // Use $recently_edited if none are selected. if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) ) { $nav_menu_selected_id = $recently_edited; } // On deletion of menu, if another menu exists, show it. if ( ! $add_new_screen && $menu_count > 0 && isset( $_GET['action'] ) && 'delete' === $_GET['action'] ) { $nav_menu_selected_id = $nav_menus[0]->term_id; } // Set $nav_menu_selected_id to 0 if no menus. if ( $one_theme_location_no_menus ) { $nav_menu_selected_id = 0; } elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) { // If we have no selection yet, and we have menus, set to the first one in the list. $nav_menu_selected_id = $nav_menus[0]->term_id; } // Update the user's setting. if ( $nav_menu_selected_id !== $recently_edited && is_nav_menu( $nav_menu_selected_id ) ) { update_user_meta( $current_user->ID, 'nav_menu_recently_edited', $nav_menu_selected_id ); } // If there's a menu, get its name. if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) { $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id ); $nav_menu_selected_title = ! is_wp_error( $_menu_object ) ? $_menu_object->name : ''; } // Generate truncated menu names. foreach ( (array) $nav_menus as $key => $_nav_menu ) { $nav_menus[ $key ]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '…' ); } // Retrieve menu locations. if ( current_theme_supports( 'menus' ) ) { $locations = get_registered_nav_menus(); $menu_locations = get_nav_menu_locations(); } /* * Ensure the user will be able to scroll horizontally * by adding a class for the max menu depth. * * @global int $_wp_nav_menu_max_depth */ global $_wp_nav_menu_max_depth; $_wp_nav_menu_max_depth = 0; // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth. if ( is_nav_menu( $nav_menu_selected_id ) ) { $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) ); $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); } /** * @global int $_wp_nav_menu_max_depth * * @param string $classes * @return string */ function wp_nav_menu_max_depth( $classes ) { global $_wp_nav_menu_max_depth; return "$classes menu-max-depth-$_wp_nav_menu_max_depth"; } add_filter( 'admin_body_class', 'wp_nav_menu_max_depth' ); wp_nav_menu_setup(); wp_initial_nav_menu_meta_boxes(); if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) { $message_no_theme_support = sprintf( /* translators: %s: URL to Widgets screen. */ __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the Widgets screen.' ), admin_url( 'widgets.php' ) ); $messages[] = wp_get_admin_notice( $message_no_theme_support, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } if ( ! $locations_screen ) : // Main tab. $overview = '

' . __( 'This screen is used for managing your navigation menus.' ) . '

'; $overview .= '

' . sprintf( /* translators: 1: URL to Widgets screen, 2 and 3: The names of the default themes. */ __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a “Navigation Menu” widget on the Widgets screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Twenty', 'Twenty Twenty-One' ) . '

'; $overview .= '

' . __( 'From this screen you can:' ) . '

'; $overview .= '
  • ' . __( 'Create, edit, and delete menus' ) . '
  • '; $overview .= '
  • ' . __( 'Add, organize, and modify individual menu items' ) . '
'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $overview, ) ); $menu_management = '

' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '

'; $menu_management .= '
  • ' . __( 'To edit an existing menu, choose a menu from the dropdown and click Select' ) . '
  • '; $menu_management .= '
  • ' . __( 'If you have not yet created any menus, click the ’create a new menu’ link to get started' ) . '
'; $menu_management .= '

' . __( 'You can assign theme locations to individual menus by selecting the desired settings at the bottom of the menu editor. To assign menus to all theme locations at once, visit the Manage Locations tab at the top of the screen.' ) . '

'; get_current_screen()->add_help_tab( array( 'id' => 'menu-management', 'title' => __( 'Menu Management' ), 'content' => $menu_management, ) ); $editing_menus = '

' . __( 'Each navigation menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '

'; $editing_menus .= '

' . __( 'Clicking the arrow to the right of any menu item in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '

'; $editing_menus .= '
  • ' . __( 'Add one or several items at once by selecting the checkbox next to each item and clicking Add to Menu' ) . '
  • '; $editing_menus .= '
  • ' . __( 'To add a custom link, expand the Custom Links section, enter a URL and link text, and click Add to Menu' ) . '
  • '; $editing_menus .= '
  • ' . __( 'To reorganize menu items, drag and drop items with your mouse or use your keyboard. Drag or move a menu item a little to the right to make it a submenu' ) . '
  • '; $editing_menus .= '
  • ' . __( 'Delete a menu item by expanding it and clicking the Remove link' ) . '
'; get_current_screen()->add_help_tab( array( 'id' => 'editing-menus', 'title' => __( 'Editing Menus' ), 'content' => $editing_menus, ) ); else : // Locations tab. $locations_overview = '

' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '

'; $locations_overview .= '
  • ' . __( 'To assign menus to one or more theme locations, select a menu from each location’s dropdown. When you are finished, click Save Changes' ) . '
  • '; $locations_overview .= '
  • ' . __( 'To edit a menu currently assigned to a theme location, click the adjacent ’Edit’ link' ) . '
  • '; $locations_overview .= '
  • ' . __( 'To add a new menu instead of assigning an existing one, click the ’Use new menu’ link. Your new menu will be automatically assigned to that theme location' ) . '
'; get_current_screen()->add_help_tab( array( 'id' => 'locations-overview', 'title' => __( 'Overview' ), 'content' => $locations_overview, ) ); endif; get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Menus' ) . '

' . '

' . __( 'Support forums' ) . '

' ); // Get the admin header. require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

'menu_locations' ) : array( 'panel' => 'nav_menus' ); printf( ' %2$s', esc_url( add_query_arg( array( array( 'autofocus' => $focus ), 'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), ), admin_url( 'customize.php' ) ) ), __( 'Manage with Live Preview' ) ); endif; $nav_tab_active_class = ''; $nav_aria_current = ''; if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' !== $_GET['action'] ) { $nav_tab_active_class = ' nav-tab-active'; $nav_aria_current = ' aria-current="page"'; } ?>
' . __( 'Your theme supports one menu. Select which menu you would like to use.' ) . '

'; } else { echo '

' . sprintf( /* translators: %s: Number of menus. */ _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '

'; } ?>
create a new menu. Do not forget to save your changes!' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, ), admin_url( 'nav-menus.php' ) ) ) ); ?>
create a new menu. Do not forget to save your changes!' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, ), admin_url( 'nav-menus.php' ) ) ) ); ?>
site-health.php000064400000024313147573123700007500 0ustar00 _x( 'Status', 'Site Health' ), /* translators: Tab heading for Site Health Info page. */ 'debug' => _x( 'Info', 'Site Health' ), ); /** * Filters the extra tabs for the Site Health navigation bar. * * Add a custom page to the Site Health screen, based on a tab slug and label. * The label you provide will also be used as part of the site title. * * @since 5.8.0 * * @param string[] $tabs An associative array of tab labels keyed by their slug. */ $tabs = apply_filters( 'site_health_navigation_tabs', $tabs ); $wrapper_classes = array( 'health-check-tabs-wrapper', 'hide-if-no-js', 'tab-count-' . count( $tabs ), ); $current_tab = ( isset( $_GET['tab'] ) ? $_GET['tab'] : '' ); $title = sprintf( // translators: %s: The currently displayed tab. __( 'Site Health - %s' ), ( isset( $tabs[ $current_tab ] ) ? esc_html( $tabs[ $current_tab ] ) : esc_html( reset( $tabs ) ) ) ); if ( ! current_user_can( 'view_site_health_checks' ) ) { wp_die( __( 'Sorry, you are not allowed to access site health information.' ), '', 403 ); } wp_enqueue_style( 'site-health' ); wp_enqueue_script( 'site-health' ); if ( ! class_exists( 'WP_Site_Health' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php'; } if ( 'update_https' === $action ) { check_admin_referer( 'wp_update_https' ); if ( ! current_user_can( 'update_https' ) ) { wp_die( __( 'Sorry, you are not allowed to update this site to HTTPS.' ), 403 ); } if ( ! wp_is_https_supported() ) { wp_die( __( 'It looks like HTTPS is not supported for your website at this point.' ) ); } $result = wp_update_urls_to_https(); wp_redirect( add_query_arg( 'https_updated', (int) $result, wp_get_referer() ) ); exit; } $health_check_site_status = WP_Site_Health::get_instance(); get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '

' . __( 'This screen allows you to obtain a health diagnosis of your site, and displays an overall rating of the status of your installation.' ) . '

' . '

' . __( 'In the Status tab, you can see critical information about your WordPress configuration, along with anything else that requires your attention.' ) . '

' . '

' . __( 'In the Info tab, you will find all the details about the configuration of your WordPress site, server, and database. There is also an export feature that allows you to copy all of the information about your site to the clipboard, to help solve problems on your site when obtaining support.' ) . '

', ) ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Site Health tool' ) . '

' ); // Start by checking if this is a special request checking for the existence of certain filters. $health_check_site_status->check_wp_version_check_exists(); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

'success', 'id' => 'message', 'dismissible' => true, ) ); } else { wp_admin_notice( __( 'Site URLs could not be switched to HTTPS.' ), array( 'type' => 'error', 'id' => 'message', 'dismissible' => true, ) ); } } ?>

'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?>

' . __( 'You need a higher level of permission.' ) . '' . '

' . __( 'Sorry, you are not allowed to manage options for this site.' ) . '

', 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( '

' . __( 'You need a higher level of permission.' ) . '

' . '

' . __( 'Sorry, you are not allowed to delete these items.' ) . '

', 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. */ __( 'Error: The %s options page is not in the allowed options list.' ), '' . esc_html( $option_page ) . '' ) ); } 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 documentation on the Settings API.' ), '' . esc_html( $option ) . '', __( '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'; ?>

' . __( 'Warning:' ) . ' ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ), array( 'type' => 'warning', ) ); ?>
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 ); ?>
' . __( 'You need a higher level of permission.' ) . '' . '

' . __( 'Sorry, you are not allowed to list users.' ) . '

', 403 ); } $wp_list_table = _get_list_table( 'WP_Users_List_Table' ); $pagenum = $wp_list_table->get_pagenum(); // Used in the HTML title tag. $title = __( 'Users' ); $parent_file = 'users.php'; add_screen_option( 'per_page' ); // 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' => '

' . __( 'This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.' ) . '

' . '

' . __( 'To add a new user for your site, click the Add New User button at the top of the screen or Add New User in the Users menu section.' ) . '

', ) ); get_current_screen()->add_help_tab( array( 'id' => 'screen-content', 'title' => __( 'Screen Content' ), 'content' => '

' . __( 'You can customize the display of this screen in a number of ways:' ) . '

' . '
    ' . '
  • ' . __( 'You can hide/display columns based on your needs and decide how many users to list per screen using the Screen Options tab.' ) . '
  • ' . '
  • ' . __( 'You can filter the list of users by User Role using the text links above the users list to show All, Administrator, Editor, Author, Contributor, or Subscriber. The default view is to show all users. Unused User Roles are not listed.' ) . '
  • ' . '
  • ' . __( 'You can view all posts made by a user by clicking on the number under the Posts column.' ) . '
  • ' . '
', ) ); $help = '

' . __( 'Hovering over a row in the users list will display action links that allow you to manage users. You can perform the following actions:' ) . '

' . '
    ' . '
  • ' . __( 'Edit takes you to the editable profile screen for that user. You can also reach that screen by clicking on the username.' ) . '
  • '; if ( is_multisite() ) { $help .= '
  • ' . __( 'Remove allows you to remove a user from your site. It does not delete their content. You can also remove multiple users at once by using bulk actions.' ) . '
  • '; } else { $help .= '
  • ' . __( 'Delete brings you to the Delete Users screen for confirmation, where you can permanently remove a user from your site and delete their content. You can also delete multiple users at once by using bulk actions.' ) . '
  • '; } $help .= '
  • ' . __( 'View takes you to a public author archive which lists all the posts published by the user.' ) . '
  • '; if ( current_user_can( 'edit_users' ) ) { $help .= '
  • ' . __( 'Send password reset sends the user an email with a link to set a new password.' ) . '
  • '; } $help .= '
'; get_current_screen()->add_help_tab( array( 'id' => 'action-links', 'title' => __( 'Available Actions' ), 'content' => $help, ) ); unset( $help ); get_current_screen()->set_help_sidebar( '

' . __( 'For more information:' ) . '

' . '

' . __( 'Documentation on Managing Users' ) . '

' . '

' . __( 'Descriptions of Roles and Capabilities' ) . '

' . '

' . __( 'Support forums' ) . '

' ); get_current_screen()->set_screen_reader_content( array( 'heading_views' => __( 'Filter users list' ), 'heading_pagination' => __( 'Users list navigation' ), 'heading_list' => __( 'Users list' ), ) ); if ( empty( $_REQUEST ) ) { $referer = ''; } elseif ( isset( $_REQUEST['wp_http_referer'] ) ) { $redirect = remove_query_arg( array( 'wp_http_referer', 'updated', 'delete_count' ), wp_unslash( $_REQUEST['wp_http_referer'] ) ); $referer = ''; } else { $redirect = 'users.php'; $referer = ''; } $update = ''; switch ( $wp_list_table->current_action() ) { /* Bulk Dropdown menu Role changes */ case 'promote': check_admin_referer( 'bulk-users' ); if ( ! current_user_can( 'promote_users' ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 ); } if ( empty( $_REQUEST['users'] ) ) { wp_redirect( $redirect ); exit; } $editable_roles = get_editable_roles(); $role = $_REQUEST['new_role']; // Mocking the `none` role so we are able to save it to the database $editable_roles['none'] = array( 'name' => __( '— No role for this site —' ), ); if ( ! $role || empty( $editable_roles[ $role ] ) ) { wp_die( __( 'Sorry, you are not allowed to give users that role.' ), 403 ); } if ( 'none' === $role ) { $role = ''; } $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); $update = 'promote'; foreach ( $user_ids as $id ) { if ( ! current_user_can( 'promote_user', $id ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ), 403 ); } // The new role of the current user must also have the promote_users cap or be a multisite super admin. if ( $id === $current_user->ID && ! $wp_roles->role_objects[ $role ]->has_cap( 'promote_users' ) && ! ( is_multisite() && current_user_can( 'manage_network_users' ) ) ) { $update = 'err_admin_role'; continue; } // If the user doesn't already belong to the blog, bail. if ( is_multisite() && ! is_user_member_of_blog( $id ) ) { wp_die( '

' . __( 'Something went wrong.' ) . '

' . '

' . __( 'One of the selected users is not a member of this site.' ) . '

', 403 ); } $user = get_userdata( $id ); $user->set_role( $role ); } wp_redirect( add_query_arg( 'update', $update, $redirect ) ); exit; case 'dodelete': if ( is_multisite() ) { wp_die( __( 'User deletion is not allowed from this screen.' ), 400 ); } check_admin_referer( 'delete-users' ); if ( empty( $_REQUEST['users'] ) ) { wp_redirect( $redirect ); exit; } $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); if ( empty( $_REQUEST['delete_option'] ) ) { $url = self_admin_url( 'users.php?action=delete&users[]=' . implode( '&users[]=', $user_ids ) . '&error=true' ); $url = str_replace( '&', '&', wp_nonce_url( $url, 'bulk-users' ) ); wp_redirect( $url ); exit; } if ( ! current_user_can( 'delete_users' ) ) { wp_die( __( 'Sorry, you are not allowed to delete users.' ), 403 ); } $update = 'del'; $delete_count = 0; foreach ( $user_ids as $id ) { if ( ! current_user_can( 'delete_user', $id ) ) { wp_die( __( 'Sorry, you are not allowed to delete that user.' ), 403 ); } if ( $id === $current_user->ID ) { $update = 'err_admin_del'; continue; } switch ( $_REQUEST['delete_option'] ) { case 'delete': wp_delete_user( $id ); break; case 'reassign': wp_delete_user( $id, $_REQUEST['reassign_user'] ); break; } ++$delete_count; } $redirect = add_query_arg( array( 'delete_count' => $delete_count, 'update' => $update, ), $redirect ); wp_redirect( $redirect ); exit; case 'resetpassword': check_admin_referer( 'bulk-users' ); if ( ! current_user_can( 'edit_users' ) ) { $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to edit users.' ) ); } if ( empty( $_REQUEST['users'] ) ) { wp_redirect( $redirect ); exit(); } $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); $reset_count = 0; foreach ( $user_ids as $id ) { if ( ! current_user_can( 'edit_user', $id ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); } if ( $id === $current_user->ID ) { $update = 'err_admin_reset'; continue; } // Send the password reset link. $user = get_userdata( $id ); if ( true === retrieve_password( $user->user_login ) ) { ++$reset_count; } } $redirect = add_query_arg( array( 'reset_count' => $reset_count, 'update' => 'resetpassword', ), $redirect ); wp_redirect( $redirect ); exit; case 'delete': if ( is_multisite() ) { wp_die( __( 'User deletion is not allowed from this screen.' ), 400 ); } check_admin_referer( 'bulk-users' ); if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) { wp_redirect( $redirect ); exit; } if ( ! current_user_can( 'delete_users' ) ) { $errors = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to delete users.' ) ); } if ( empty( $_REQUEST['users'] ) ) { $user_ids = array( (int) $_REQUEST['user'] ); } else { $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); } $all_user_ids = $user_ids; if ( in_array( $current_user->ID, $user_ids, true ) ) { $user_ids = array_diff( $user_ids, array( $current_user->ID ) ); } /** * Filters whether the users being deleted have additional content * associated with them outside of the `post_author` and `link_owner` relationships. * * @since 5.2.0 * * @param bool $users_have_additional_content Whether the users have additional content. Default false. * @param int[] $user_ids Array of IDs for users being deleted. */ $users_have_content = (bool) apply_filters( 'users_have_additional_content', false, $user_ids ); if ( $user_ids && ! $users_have_content ) { if ( $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE post_author IN( " . implode( ',', $user_ids ) . ' ) LIMIT 1' ) ) { $users_have_content = true; } elseif ( $wpdb->get_var( "SELECT link_id FROM {$wpdb->links} WHERE link_owner IN( " . implode( ',', $user_ids ) . ' ) LIMIT 1' ) ) { $users_have_content = true; } } if ( $users_have_content ) { add_action( 'admin_head', 'delete_users_add_js' ); } require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

' . __( 'Error:' ) . ' ' . __( 'Please select an option.' ), array( 'additional_classes' => array( 'error' ), ) ); endif; ?>

    ID ) { echo '
  • '; printf( /* translators: 1: User ID, 2: User login. */ __( 'ID #%1$s: %2$s The current user will not be deleted.' ), $id, $user->user_login ); echo "
  • \n"; } else { echo '
  • '; printf( '', esc_attr( $id ) ); printf( /* translators: 1: User ID, 2: User login. */ __( 'ID #%1$s: %2$s' ), $id, $user->user_login ); echo "
  • \n"; ++$go_delete; } } ?>

  • 'reassign_user', 'exclude' => $user_ids, 'show' => 'display_name_with_login', ) ); ?>

$update ), $redirect ); wp_redirect( $redirect ); exit; case 'remove': check_admin_referer( 'bulk-users' ); if ( ! is_multisite() ) { wp_die( __( 'You cannot remove users.' ), 400 ); } if ( empty( $_REQUEST['users'] ) && empty( $_REQUEST['user'] ) ) { wp_redirect( $redirect ); exit; } if ( ! current_user_can( 'remove_users' ) ) { $error = new WP_Error( 'edit_users', __( 'Sorry, you are not allowed to remove users.' ) ); } if ( empty( $_REQUEST['users'] ) ) { $user_ids = array( (int) $_REQUEST['user'] ); } else { $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); } require_once ABSPATH . 'wp-admin/admin-header.php'; ?>

    '; printf( /* translators: 1: User ID, 2: User login. */ __( 'ID #%1$s: %2$s Sorry, you are not allowed to remove this user.' ), $id, $user->user_login ); echo "\n"; } else { echo '
  • '; printf( '', esc_attr( $id ) ); printf( /* translators: 1: User ID, 2: User login. */ __( 'ID #%1$s: %2$s' ), $id, $user->user_login ); echo "
  • \n"; $go_remove = true; } } ?>

current_action() && ! empty( $_REQUEST['users'] ) ) { $screen = get_current_screen()->id; $sendback = wp_get_referer(); $user_ids = array_map( 'intval', (array) $_REQUEST['users'] ); /** This action is documented in wp-admin/edit.php */ $sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $wp_list_table->current_action(), $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores wp_safe_redirect( $sendback ); 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; } require_once ABSPATH . 'wp-admin/admin-header.php'; $messages = array(); if ( isset( $_GET['update'] ) ) : switch ( $_GET['update'] ) { case 'del': case 'del_many': $delete_count = isset( $_GET['delete_count'] ) ? (int) $_GET['delete_count'] : 0; if ( 1 === $delete_count ) { $message = __( 'User deleted.' ); } else { /* translators: %s: Number of users. */ $message = _n( '%s user deleted.', '%s users deleted.', $delete_count ); } $message = sprintf( $message, number_format_i18n( $delete_count ) ); $messages[] = wp_get_admin_notice( $message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'add': $message = __( 'New user created.' ); $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false; if ( $user_id && current_user_can( 'edit_user', $user_id ) ) { $message .= sprintf( ' %2$s', esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), self_admin_url( 'user-edit.php?user_id=' . $user_id ) ) ), __( 'Edit user' ) ); } $messages[] = wp_get_admin_notice( $message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'resetpassword': $reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0; if ( 1 === $reset_count ) { $message = __( 'Password reset link sent.' ); } else { /* translators: %s: Number of users. */ $message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count ); } $message = sprintf( $message, number_format_i18n( $reset_count ) ); $messages[] = wp_get_admin_notice( $message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'promote': $messages[] = wp_get_admin_notice( __( 'Changed roles.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'err_admin_role': $messages[] = wp_get_admin_notice( __( 'The current user’s role must have user editing capabilities.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $messages[] = wp_get_admin_notice( __( 'Other user roles have been changed.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'err_admin_del': $messages[] = wp_get_admin_notice( __( 'You cannot delete the current user.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $messages[] = wp_get_admin_notice( __( 'Other users have been deleted.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); break; case 'remove': $messages[] = wp_get_admin_notice( __( 'User removed from this site.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated', 'fade' ), 'dismissible' => true, ) ); break; case 'err_admin_remove': $messages[] = wp_get_admin_notice( __( 'You cannot remove the current user.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), 'dismissible' => true, ) ); $messages[] = wp_get_admin_notice( __( 'Other users have been removed.' ), array( 'id' => 'message', 'additional_classes' => array( 'updated', 'fade' ), 'dismissible' => true, ) ); break; } endif; ?> get_error_messages() as $err ) { $error_message .= "
  • $err
  • \n"; } wp_admin_notice( '
      ' . $error_message . '
    ', array( 'additional_classes' => array( 'error' ), ) ); endif; if ( ! empty( $messages ) ) { foreach ( $messages as $msg ) { echo $msg; } } ?>

    %2$s', esc_url( admin_url( 'user-new.php' ) ), esc_html__( 'Add New User' ) ); } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { printf( '%2$s', esc_url( admin_url( 'user-new.php' ) ), esc_html__( 'Add Existing User' ) ); } if ( strlen( $usersearch ) ) { echo ''; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '' . esc_html( $usersearch ) . '' ); echo ''; } ?>
    views(); ?>
    search_box( __( 'Search Users' ), 'user' ); ?> display(); ?>

    license, the GPL.' ), __( 'https://wordpress.org/about/license/' ) ); ?>

    check out our trademark guidelines first.' ), 'https://wordpressfoundation.org/trademark-policy/' ); ?>

    plugins and themes there. If you get a plugin or theme from another source, make sure to ask them if it’s GPL first. If they do not respect the WordPress license, it is not recommended to use them.' ), $plugins_url, $themes_url, __( 'https://wordpress.org/about/license/' ) ); ?>

    admin-footer.php000064400000005422147573123700007655 0ustar00