?PK y[j revision.phpnu [ post_parent ) ) { break; } $post = get_post( $revision->post_parent ); if ( ! $post ) { break; } // Don't restore if revisions are disabled and this is not an autosave. if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { $redirect = 'edit.php?post_type=' . $post->post_type; break; } // Don't restore if the post is locked. if ( wp_check_post_lock( $post->ID ) ) { break; } check_admin_referer( "restore-post_{$revision->ID}" ); /* * Ensure the global $post remains the same after revision is restored. * Because wp_insert_post() and wp_transition_post_status() are called * during the process, plugins can unexpectedly modify $post. */ $backup_global_post = clone $post; wp_restore_post_revision( $revision->ID ); // Restore the global $post as it was before. $post = $backup_global_post; $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID, ), get_edit_post_link( $post->ID, 'url' ) ); break; case 'view': case 'edit': default: $revision = wp_get_post_revision( $revision_id ); if ( ! $revision ) { break; } $post = get_post( $revision->post_parent ); if ( ! $post ) { break; } if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'edit_post', $revision->post_parent ) ) { break; } // Bail if revisions are disabled and this is not an autosave. if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) { $redirect = 'edit.php?post_type=' . $post->post_type; break; } $post_edit_link = get_edit_post_link(); $post_title = '' . _draft_or_post_title() . ''; /* translators: %s: Post title. */ $h1 = sprintf( __( 'Compare Revisions of “%s”' ), $post_title ); $return_to_post = '' . __( '← Go to editor' ) . ''; // Used in the HTML title tag. $title = __( 'Revisions' ); $redirect = false; break; } // Empty post_type means either malformed object found, or no valid parent was found. if ( ! $redirect && empty( $post->post_type ) ) { $redirect = 'edit.php'; } if ( ! empty( $redirect ) ) { wp_redirect( $redirect ); exit; } // This is so that the correct "Edit" menu item is selected. if ( ! empty( $post->post_type ) && 'post' !== $post->post_type ) { $parent_file = 'edit.php?post_type=' . $post->post_type; } else { $parent_file = 'edit.php'; } $submenu_file = $parent_file; wp_enqueue_script( 'revisions' ); wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) ); /* Revisions Help Tab */ $revisions_overview = '
' . __( 'This screen is used for managing your content revisions.' ) . '
'; $revisions_overview .= '' . __( 'Revisions are saved copies of your post or page, which are periodically created as you update your content. The red text on the left shows the content that was removed. The green text on the right shows the content that was added.' ) . '
'; $revisions_overview .= '' . __( 'From this screen you can review, compare, and restore revisions:' ) . '
'; $revisions_overview .= '' . __( 'For more information:' ) . '
'; $revisions_sidebar .= '' . __( 'Revisions Management' ) . '
'; $revisions_sidebar .= '' . __( 'Support forums' ) . '
'; get_current_screen()->set_help_sidebar( $revisions_sidebar ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'Invalid item ID. You can view all media items in the Media Library.' ) . '
', 403 ); } if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) { wp_die( '' . __( 'Sorry, you are not allowed to edit this item.' ) . '
', 403 ); } // Upload type: image, video, file, ...? if ( isset( $_GET['type'] ) ) { $type = (string) $_GET['type']; } else { /** * Filters the default media upload type in the legacy (pre-3.5.0) media popup. * * @since 2.5.0 * * @param string $type The default media upload type. Possible values include * 'image', 'audio', 'video', 'file', etc. Default 'file'. */ $type = apply_filters( 'media_upload_default_type', 'file' ); } // Tab: gallery, library, or type-specific. if ( isset( $_GET['tab'] ) ) { $tab = (string) $_GET['tab']; } else { /** * Filters the default tab in the legacy (pre-3.5.0) media popup. * * @since 2.5.0 * * @param string $tab The default media popup tab. Default 'type' (From Computer). */ $tab = apply_filters( 'media_upload_default_tab', 'type' ); } $body_id = 'media-upload'; // Let the action code decide how to handle the request. if ( 'type' === $tab || 'type_url' === $tab || ! array_key_exists( $tab, media_upload_tabs() ) ) { /** * Fires inside specific upload-type views in the legacy (pre-3.5.0) * media popup based on the current tab. * * The dynamic portion of the hook name, `$type`, refers to the specific * media upload type. * * The hook only fires if the current `$tab` is 'type' (From Computer), * 'type_url' (From URL), or, if the tab does not exist (i.e., has not * been registered via the {@see 'media_upload_tabs'} filter. * * Possible hook names include: * * - `media_upload_audio` * - `media_upload_file` * - `media_upload_image` * - `media_upload_video` * * @since 2.5.0 */ do_action( "media_upload_{$type}" ); } else { /** * Fires inside limited and specific upload-tab views in the legacy * (pre-3.5.0) media popup. * * The dynamic portion of the hook name, `$tab`, refers to the specific * media upload tab. Possible values include 'library' (Media Library), * or any custom tab registered via the {@see 'media_upload_tabs'} filter. * * @since 2.5.0 */ do_action( "media_upload_{$tab}" ); } PK y[eC& & privacy.phpnu [WordPress.org stats page.' ), __( 'https://wordpress.org/about/stats/' ) ); ?>
the WordPress.org Privacy Policy.' ), __( 'https://wordpress.org/about/privacy/' ) ); ?>
' . __( 'You can use the theme file editor to edit the individual CSS and PHP files which make up your theme.' ) . '
' . '' . __( 'Begin by choosing a theme to edit from the dropdown menu and clicking the Select button. A list then appears of the theme’s template files. Clicking once on any file name causes the file to appear in the large Editor box.' ) . '
' . '' . __( 'For PHP files, you can use the documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.' ) . '
' . '' . __( 'When using a keyboard to navigate:' ) . '
' . '' . __( 'After typing in your edits, click Update File.' ) . '
' . '' . __( 'Advice: Think very carefully about your site crashing if you are live-editing the theme currently in use.' ) . '
' . '' . sprintf( /* translators: %s: Link to documentation on child themes. */ __( 'Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a child theme instead.' ), __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) ) . '
' . ( is_network_admin() ? '' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '
' : '' ), ) ); get_current_screen()->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Theme Development' ) . '
' . '' . __( 'Documentation on Editing Themes' ) . '
' . '' . __( 'Documentation on Editing Files' ) . '
' . '' . __( 'Documentation on Template Tags' ) . '
' . '' . __( 'Support forums' ) . '
' ); $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; $theme = ! empty( $_REQUEST['theme'] ) ? sanitize_text_field( $_REQUEST['theme'] ) : ''; $file = ! empty( $_REQUEST['file'] ) ? sanitize_text_field( $_REQUEST['file'] ) : ''; $error = ! empty( $_REQUEST['error'] ); if ( $theme ) { $stylesheet = $theme; } else { $stylesheet = get_stylesheet(); } $theme = wp_get_theme( $stylesheet ); if ( ! $theme->exists() ) { wp_die( __( 'The requested theme does not exist.' ) ); } if ( $theme->errors() && 'theme_no_stylesheet' === $theme->errors()->get_error_code() ) { wp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() ); } $allowed_files = array(); $style_files = array(); $file_types = wp_get_theme_file_editable_extensions( $theme ); foreach ( $file_types as $type ) { switch ( $type ) { case 'php': $allowed_files += $theme->get_files( 'php', -1 ); break; case 'css': $style_files = $theme->get_files( 'css', -1 ); $allowed_files['style.css'] = $style_files['style.css']; $allowed_files += $style_files; break; default: $allowed_files += $theme->get_files( $type, -1 ); break; } } // Move functions.php and style.css to the top. if ( isset( $allowed_files['functions.php'] ) ) { $allowed_files = array( 'functions.php' => $allowed_files['functions.php'] ) + $allowed_files; } if ( isset( $allowed_files['style.css'] ) ) { $allowed_files = array( 'style.css' => $allowed_files['style.css'] ) + $allowed_files; } if ( empty( $file ) ) { $relative_file = 'style.css'; $file = $allowed_files['style.css']; } else { $relative_file = wp_unslash( $file ); $file = $theme->get_stylesheet_directory() . '/' . $relative_file; } validate_file_to_edit( $file, $allowed_files ); // Handle fallback editing of file when JavaScript is not available. $edit_error = null; $posted_content = null; if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { $edit_result = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); if ( is_wp_error( $edit_result ) ) { $edit_error = $edit_result; if ( check_ajax_referer( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) { $posted_content = wp_unslash( $_POST['newcontent'] ); } } else { wp_redirect( add_query_arg( array( 'a' => 1, // This means "success" for some reason. 'theme' => $stylesheet, 'file' => $relative_file, ), admin_url( 'theme-editor.php' ) ) ); exit; } } $settings = array( 'codeEditor' => wp_enqueue_code_editor( compact( 'file' ) ), ); wp_enqueue_script( 'wp-theme-plugin-editor' ); wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) ); wp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = "theme";' ); require_once ABSPATH . 'wp-admin/admin-header.php'; update_recently_edited( $file ); if ( ! is_file( $file ) ) { $error = true; } $content = ''; if ( ! empty( $posted_content ) ) { $content = $posted_content; } elseif ( ! $error && filesize( $file ) > 0 ) { $f = fopen( $file, 'r' ); $content = fread( $f, filesize( $file ) ); if ( str_ends_with( $file, '.php' ) ) { $functions = wp_doc_link_parse( $content ); if ( ! empty( $functions ) ) { $docs_select = ''; } } $content = esc_textarea( $content ); } $file_show = array_search( $file, array_filter( $allowed_files ), true ); ?>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '
' . $error_code . ''; wp_admin_notice( $message, array( 'type' => 'error', 'id' => 'message', ) ); } if ( preg_match( '/\.css$/', $file ) ) { if ( ! wp_is_block_theme() && current_user_can( 'customize' ) ) { $message = '
' . __( 'Did you know?' ) . '
' . sprintf( /* translators: %s: Link to add custom CSS section in either the Customizer (classic themes) or Site Editor (block themes). */ __( 'There is no need to change your CSS here — you can edit and live preview CSS changes in the built-in CSS editor.' ), esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) ) ) . '
'; wp_admin_notice( $message, array( 'type' => 'info', 'id' => 'message', ) ); } elseif ( wp_is_block_theme() && current_user_can( 'edit_theme_options' ) ) { $site_editor_url = admin_url( add_query_arg( urlencode_deep( array( 'p' => '/styles', 'section' => '/css', ) ), 'site-editor.php' ) ); $message = '' . __( 'Did you know?' ) . '
' . sprintf( /* translators: %s: Link to add custom CSS section in either the Customizer (classic themes) or Site Editor (block themes). */ __( 'There is no need to change your CSS here — you can edit and live preview CSS changes in the built-in CSS editor.' ), esc_url( $site_editor_url ) ) . '
'; wp_admin_notice( $message, array( 'type' => 'info', 'id' => 'message', ) ); } if ( file_exists( preg_replace( '/\.css$/', '.min.css', $file ) ) ) { $message = '' . __( 'There is a minified version of this stylesheet.' ) . '
' . __( 'It is likely that this unminified stylesheet will not be served to visitors.' ) . '
'; wp_admin_notice( $message, array( 'type' => 'warning', 'id' => 'wp-css-min-warning', ) ); } } ?>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '
', 403 ); } if ( ! current_theme_supports( 'widgets' ) ) { wp_die( __( 'The theme you are currently using is not widget-aware, meaning that it has no sidebars that you are able to change. For information on making your theme widget-aware, please follow these instructions.' ) ); } // Used in the HTML title tag. $title = __( 'Widgets' ); $parent_file = 'themes.php'; if ( wp_use_widgets_block_editor() ) { require ABSPATH . 'wp-admin/widgets-form-blocks.php'; } else { require ABSPATH . 'wp-admin/widgets-form.php'; } PK y[ link.phpnu [ query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); */ wp_redirect( $this_file ); exit; case 'add': check_admin_referer( 'add-bookmark' ); $redir = wp_get_referer(); if ( add_link() ) { $redir = add_query_arg( 'added', 'true', $redir ); } wp_redirect( $redir ); exit; case 'save': $link_id = (int) $_POST['link_id']; check_admin_referer( 'update-bookmark_' . $link_id ); edit_link( $link_id ); wp_redirect( $this_file ); exit; case 'delete': $link_id = (int) $_GET['link_id']; check_admin_referer( 'delete-bookmark_' . $link_id ); wp_delete_link( $link_id ); wp_redirect( $this_file ); exit; case 'edit': wp_enqueue_script( 'link' ); wp_enqueue_script( 'xfn' ); if ( wp_is_mobile() ) { wp_enqueue_script( 'jquery-touch-punch' ); } $parent_file = 'link-manager.php'; $submenu_file = 'link-manager.php'; // Used in the HTML title tag. $title = __( 'Edit Link' ); $link_id = (int) $_GET['link_id']; $link = get_link_to_edit( $link_id ); if ( ! $link ) { wp_die( __( 'Link not found.' ) ); } require ABSPATH . 'wp-admin/edit-link-form.php'; require_once ABSPATH . 'wp-admin/admin-footer.php'; break; default: break; } PK y[L ms-users.phpnu [ post_type; $post_type_object = get_post_type_object( $post_type ); } if ( isset( $_POST['post_type'] ) && $post && $post_type !== $_POST['post_type'] ) { wp_die( __( 'A post type mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 ); } if ( isset( $_POST['deletepost'] ) ) { $action = 'delete'; } elseif ( isset( $_POST['wp-preview'] ) && 'dopreview' === $_POST['wp-preview'] ) { $action = 'preview'; } $sendback = wp_get_referer(); if ( ! $sendback || str_contains( $sendback, 'post.php' ) || str_contains( $sendback, 'post-new.php' ) ) { if ( 'attachment' === $post_type ) { $sendback = admin_url( 'upload.php' ); } else { $sendback = admin_url( 'edit.php' ); if ( ! empty( $post_type ) ) { $sendback = add_query_arg( 'post_type', $post_type, $sendback ); } } } else { $sendback = remove_query_arg( array( 'trashed', 'untrashed', 'deleted', 'ids' ), $sendback ); } switch ( $action ) { case 'post-quickdraft-save': // Check nonce and capabilities. $nonce = $_REQUEST['_wpnonce']; $error_msg = false; // For output of the Quick Draft dashboard widget. require_once ABSPATH . 'wp-admin/includes/dashboard.php'; if ( ! wp_verify_nonce( $nonce, 'add-post' ) ) { $error_msg = __( 'Unable to submit this form, please refresh and try again.' ); } if ( ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { exit; } if ( $error_msg ) { return wp_dashboard_quick_press( $error_msg ); } $post = get_post( $_REQUEST['post_ID'] ); check_admin_referer( 'add-' . $post->post_type ); $_POST['comment_status'] = get_default_comment_status( $post->post_type ); $_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' ); // Wrap Quick Draft content in the Paragraph block. if ( ! str_contains( $_POST['content'], '' ) ) { $_POST['content'] = sprintf( '%s', str_replace( array( "\r\n", "\r", "\n" ), '' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first.' ) . '
' . '' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '
' . '' . __( 'To delete media items, click the Bulk Select button at the top of the screen. Select any items you wish to delete, then click the Delete Selected button. Clicking the Cancel Selection button takes you back to viewing your media.' ) . '
', ) ); get_current_screen()->add_help_tab( array( 'id' => 'attachment-details', 'title' => __( 'Attachment Details' ), 'content' => '' . __( 'Clicking an item will display an Attachment Details dialog, which allows you to preview media and make quick edits. Any changes you make to the attachment details will be automatically saved.' ) . '
' . '' . __( 'Use the arrow buttons at the top of the dialog, or the left and right arrow keys on your keyboard, to navigate between media items quickly.' ) . '
' . '' . __( 'You can also delete individual items and access the extended edit screen from the details dialog.' ) . '
', ) ); get_current_screen()->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Media Library' ) . '
' . '' . __( 'Support forums' ) . '
' ); // Used in the HTML title tag. $title = __( 'Media Library' ); $parent_file = 'upload.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '
' . '' . __( 'You can narrow the list by file type/status or by date using the dropdown menus above the media table.' ) . '
' . '' . __( 'You can view your media in a simple visual grid or a list with columns. Switch between these views using the icons to the left above the media.' ) . '
', ) ); get_current_screen()->add_help_tab( array( 'id' => 'actions-links', 'title' => __( 'Available Actions' ), 'content' => '' . __( 'Hovering over a row reveals action links that allow you to manage media items. You can perform the following actions:' ) . '
' . '' . __( 'If a media file has not been attached to any content, you will see that in the Uploaded To column, and can click on Attach to launch a small popup that will allow you to search for existing content and attach the file.' ) . '
', ) ); get_current_screen()->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Media Library' ) . '
' . '' . __( 'Support forums' ) . '
' ); get_current_screen()->set_screen_reader_content( array( 'heading_views' => __( 'Filter media items list' ), 'heading_pagination' => __( 'Media items list navigation' ), 'heading_list' => __( 'Media items list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>license, the GPL.' ), __( 'https://wordpress.org/about/license/' ) ); ?>
check out the WordPress Foundation 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/' ) ); ?>