| Current File : /home/mmdealscpanel/yummmdeals.com/wp-admin.zip |
PK Y�ZՋ@ª � link-add.phpnu �[��� <?php
/**
* Add Link Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_links' ) ) {
wp_die( __( 'Sorry, you are not allowed to add links to this site.' ) );
}
// Used in the HTML title tag.
$title = __( 'Add New Link' );
$parent_file = 'link-manager.php';
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
wp_enqueue_script( 'link' );
wp_enqueue_script( 'xfn' );
if ( wp_is_mobile() ) {
wp_enqueue_script( 'jquery-touch-punch' );
}
$link = get_default_link_to_edit();
require ABSPATH . 'wp-admin/edit-link-form.php';
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z� ���L �L widgets-form.phpnu �[��� <?php
/**
* The classic widget administration screen, for use in widgets.php.
*
* @package WordPress
* @subpackage Administration
*/
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
$widgets_access = get_user_setting( 'widgets_access' );
if ( isset( $_GET['widgets-access'] ) ) {
check_admin_referer( 'widgets-access' );
$widgets_access = 'on' === $_GET['widgets-access'] ? 'on' : 'off';
set_user_setting( 'widgets_access', $widgets_access );
}
if ( 'on' === $widgets_access ) {
add_filter( 'admin_body_class', 'wp_widgets_access_body_class' );
} else {
wp_enqueue_script( 'admin-widgets' );
if ( wp_is_mobile() ) {
wp_enqueue_script( 'jquery-touch-punch' );
}
}
/**
* Fires early before the Widgets administration screen loads,
* after scripts are enqueued.
*
* @since 2.2.0
*/
do_action( 'sidebar_admin_setup' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'Widgets are independent sections of content that can be placed into any widgetized area provided by your theme (commonly called sidebars). To populate your sidebars/widget areas with individual widgets, drag and drop the title bars into the desired area. By default, only the first widget area is expanded. To populate additional widget areas, click on their title bars to expand them.' ) . '</p>
<p>' . __( 'The Available Widgets section contains all the widgets you can choose from. Once you drag a widget into a sidebar, it will open to allow you to configure its settings. When you are happy with the widget settings, click the Save button and the widget will go live on your site. If you click Delete, it will remove the widget.' ) . '</p>',
)
);
get_current_screen()->add_help_tab(
array(
'id' => 'removing-reusing',
'title' => __( 'Removing and Reusing' ),
'content' =>
'<p>' . __( 'If you want to remove the widget but save its setting for possible future use, just drag it into the Inactive Widgets area. You can add them back anytime from there. This is especially helpful when you switch to a theme with fewer or different widget areas.' ) . '</p>
<p>' . __( 'Widgets may be used multiple times. You can give each widget a title, to display on your site, but it’s not required.' ) . '</p>
<p>' . __( 'Enabling Accessibility Mode, via Screen Options, allows you to use Add and Edit buttons instead of using drag and drop.' ) . '</p>',
)
);
get_current_screen()->add_help_tab(
array(
'id' => 'missing-widgets',
'title' => __( 'Missing Widgets' ),
'content' =>
'<p>' . __( 'Many themes show some sidebar widgets by default until you edit your sidebars, but they are not automatically displayed in your sidebar management tool. After you make your first widget change, you can re-add the default widgets by adding them from the Available Widgets area.' ) . '</p>' .
'<p>' . __( 'When changing themes, there is often some variation in the number and setup of widget areas/sidebars and sometimes these conflicts make the transition a bit less smooth. If you changed themes and seem to be missing widgets, scroll down on this screen to the Inactive Widgets area, where all of your widgets and their settings will have been saved.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-widgets-screen-classic-editor/">Documentation on Widgets</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
// These are the widgets grouped by sidebar.
$sidebars_widgets = wp_get_sidebars_widgets();
if ( empty( $sidebars_widgets ) ) {
$sidebars_widgets = wp_get_widget_defaults();
}
foreach ( $sidebars_widgets as $sidebar_id => $widgets ) {
if ( 'wp_inactive_widgets' === $sidebar_id ) {
continue;
}
if ( ! is_registered_sidebar( $sidebar_id ) ) {
if ( ! empty( $widgets ) ) { // Register the inactive_widgets area as sidebar.
register_sidebar(
array(
'name' => __( 'Inactive Sidebar (not used)' ),
'id' => $sidebar_id,
'class' => 'inactive-sidebar orphan-sidebar',
'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
)
);
} else {
unset( $sidebars_widgets[ $sidebar_id ] );
}
}
}
// Register the inactive_widgets area as sidebar.
register_sidebar(
array(
'name' => __( 'Inactive Widgets' ),
'id' => 'wp_inactive_widgets',
'class' => 'inactive-sidebar',
'description' => __( 'Drag widgets here to remove them from the sidebar but keep their settings.' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
)
);
retrieve_widgets();
// We're saving a widget without JS.
if ( isset( $_POST['savewidget'] ) || isset( $_POST['removewidget'] ) ) {
$widget_id = $_POST['widget-id'];
check_admin_referer( "save-delete-widget-$widget_id" );
$number = isset( $_POST['multi_number'] ) ? (int) $_POST['multi_number'] : '';
if ( $number ) {
foreach ( $_POST as $key => $val ) {
if ( is_array( $val ) && preg_match( '/__i__|%i%/', key( $val ) ) ) {
$_POST[ $key ] = array( $number => array_shift( $val ) );
break;
}
}
}
$sidebar_id = $_POST['sidebar'];
$position = isset( $_POST[ $sidebar_id . '_position' ] ) ? (int) $_POST[ $sidebar_id . '_position' ] - 1 : 0;
$id_base = $_POST['id_base'];
$sidebar = isset( $sidebars_widgets[ $sidebar_id ] ) ? $sidebars_widgets[ $sidebar_id ] : array();
// Delete.
if ( isset( $_POST['removewidget'] ) && $_POST['removewidget'] ) {
if ( ! in_array( $widget_id, $sidebar, true ) ) {
wp_redirect( admin_url( 'widgets.php?error=0' ) );
exit;
}
$sidebar = array_diff( $sidebar, array( $widget_id ) );
$_POST = array(
'sidebar' => $sidebar_id,
'widget-' . $id_base => array(),
'the-widget-id' => $widget_id,
'delete_widget' => '1',
);
/**
* Fires immediately after a widget has been marked for deletion.
*
* @since 4.4.0
*
* @param string $widget_id ID of the widget marked for deletion.
* @param string $sidebar_id ID of the sidebar the widget was deleted from.
* @param string $id_base ID base for the widget.
*/
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
}
$_POST['widget-id'] = $sidebar;
foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {
continue;
}
ob_start();
call_user_func_array( $control['callback'], $control['params'] );
ob_end_clean();
break;
}
$sidebars_widgets[ $sidebar_id ] = $sidebar;
// Remove old position.
if ( ! isset( $_POST['delete_widget'] ) ) {
foreach ( $sidebars_widgets as $key => $sb ) {
if ( is_array( $sb ) ) {
$sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) );
}
}
array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id );
}
wp_set_sidebars_widgets( $sidebars_widgets );
wp_redirect( admin_url( 'widgets.php?message=0' ) );
exit;
}
// Remove inactive widgets without JS.
if ( isset( $_POST['removeinactivewidgets'] ) ) {
check_admin_referer( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' );
if ( $_POST['removeinactivewidgets'] ) {
foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) {
$pieces = explode( '-', $widget_id );
$multi_number = array_pop( $pieces );
$id_base = implode( '-', $pieces );
$widget = get_option( 'widget_' . $id_base );
unset( $widget[ $multi_number ] );
update_option( 'widget_' . $id_base, $widget );
unset( $sidebars_widgets['wp_inactive_widgets'][ $key ] );
}
wp_set_sidebars_widgets( $sidebars_widgets );
}
wp_redirect( admin_url( 'widgets.php?message=0' ) );
exit;
}
// Output the widget form without JS.
if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) {
$widget_id = $_GET['editwidget'];
if ( isset( $_GET['addnew'] ) ) {
// Default to the first sidebar.
$keys = array_keys( $wp_registered_sidebars );
$sidebar = reset( $keys );
if ( isset( $_GET['base'] ) && isset( $_GET['num'] ) ) { // Multi-widget.
// Copy minimal info from an existing instance of this widget to a new instance.
foreach ( $wp_registered_widget_controls as $control ) {
if ( $_GET['base'] === $control['id_base'] ) {
$control_callback = $control['callback'];
$multi_number = (int) $_GET['num'];
$control['params'][0]['number'] = -1;
$control['id'] = $control['id_base'] . '-' . $multi_number;
$widget_id = $control['id'];
$wp_registered_widget_controls[ $control['id'] ] = $control;
break;
}
}
}
}
if ( isset( $wp_registered_widget_controls[ $widget_id ] ) && ! isset( $control ) ) {
$control = $wp_registered_widget_controls[ $widget_id ];
$control_callback = $control['callback'];
} elseif ( ! isset( $wp_registered_widget_controls[ $widget_id ] ) && isset( $wp_registered_widgets[ $widget_id ] ) ) {
$name = esc_html( strip_tags( $wp_registered_widgets[ $widget_id ]['name'] ) );
}
if ( ! isset( $name ) ) {
$name = esc_html( strip_tags( $control['name'] ) );
}
if ( ! isset( $sidebar ) ) {
$sidebar = isset( $_GET['sidebar'] ) ? $_GET['sidebar'] : 'wp_inactive_widgets';
}
if ( ! isset( $multi_number ) ) {
$multi_number = isset( $control['params'][0]['number'] ) ? $control['params'][0]['number'] : '';
}
$id_base = isset( $control['id_base'] ) ? $control['id_base'] : $control['id'];
// Show the widget form.
$width = ' style="width:' . max( $control['width'], 350 ) . 'px"';
$key = isset( $_GET['key'] ) ? (int) $_GET['key'] : 0;
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<div class="editwidget"<?php echo $width; ?>>
<h2>
<?php
/* translators: %s: Widget name. */
printf( __( 'Widget %s' ), $name );
?>
</h2>
<form action="widgets.php" method="post">
<div class="widget-inside">
<?php
if ( is_callable( $control_callback ) ) {
call_user_func_array( $control_callback, $control['params'] );
} else {
echo '<p>' . __( 'There are no options for this widget.' ) . "</p>\n";
}
?>
</div>
<p class="describe"><?php _e( 'Select both the sidebar for this widget and the position of the widget in that sidebar.' ); ?></p>
<div class="widget-position">
<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Position' ); ?></th></tr></thead><tbody>
<?php
foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr( $sbname ) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
if ( 'wp_inactive_widgets' === $sbname || str_starts_with( $sbname, 'orphaned_widgets' ) ) {
echo ' ';
} else {
if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
$j = 1;
$sidebars_widgets[ $sbname ] = array();
} else {
$j = count( $sidebars_widgets[ $sbname ] );
if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
++$j;
}
}
$selected = '';
echo "\t\t<select name='{$sbname}_position'>\n";
echo "\t\t<option value=''>" . __( '— Select —' ) . "</option>\n";
for ( $i = 1; $i <= $j; $i++ ) {
if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
$selected = selected( $i, $key + 1, false );
}
echo "\t\t<option value='$i'$selected> $i </option>\n";
}
echo "\t\t</select>\n";
}
echo "</td></tr>\n";
}
?>
</tbody></table>
</div>
<div class="widget-control-actions">
<div class="alignleft">
<?php if ( ! isset( $_GET['addnew'] ) ) : ?>
<input type="submit" name="removewidget" id="removewidget" class="button-link button-link-delete widget-control-remove" value="<?php esc_attr_e( 'Delete' ); ?>" />
<span class="widget-control-close-wrapper">
| <a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a>
</span>
<?php else : ?>
<a href="widgets.php" class="button-link widget-control-close"><?php _e( 'Cancel' ); ?></a>
<?php endif; ?>
</div>
<div class="alignright">
<?php submit_button( __( 'Save Widget' ), 'primary alignright', 'savewidget', false ); ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr( $widget_id ); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr( $id_base ); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr( $multi_number ); ?>" />
<?php wp_nonce_field( "save-delete-widget-$widget_id" ); ?>
</div>
<br class="clear" />
</div>
</form>
</div>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
}
$messages = array(
__( 'Changes saved.' ),
);
$errors = array(
__( 'Error while saving.' ),
__( 'Error in displaying the widget settings form.' ),
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( current_user_can( 'customize' ) ) {
printf(
' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
esc_url(
add_query_arg(
array(
array( 'autofocus' => array( 'panel' => 'widgets' ) ),
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
),
admin_url( 'customize.php' )
)
),
__( 'Manage with Live Preview' )
);
}
$nonce = wp_create_nonce( 'widgets-access' );
?>
<div class="widget-access-link">
<a id="access-on" href="widgets.php?widgets-access=on&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Enable accessibility mode' ); ?></a><a id="access-off" href="widgets.php?widgets-access=off&_wpnonce=<?php echo urlencode( $nonce ); ?>"><?php _e( 'Disable accessibility mode' ); ?></a>
</div>
<hr class="wp-header-end">
<?php
if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
wp_admin_notice(
$messages[ $_GET['message'] ],
array(
'id' => 'message',
'additional_classes' => array( 'updated' ),
'dismissible' => true,
)
);
}
if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) {
wp_admin_notice(
$errors[ $_GET['error'] ],
array(
'id' => 'message',
'additional_classes' => array( 'error' ),
'dismissible' => true,
)
);
}
/**
* Fires before the Widgets administration page content loads.
*
* @since 3.0.0
*/
do_action( 'widgets_admin_page' );
?>
<div class="widget-liquid-left">
<div id="widgets-left">
<div id="available-widgets" class="widgets-holder-wrap">
<div class="sidebar-name">
<button type="button" class="handlediv hide-if-no-js" aria-expanded="true">
<span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Available Widgets' );
?>
</span>
<span class="toggle-indicator" aria-hidden="true"></span>
</button>
<h2><?php _e( 'Available Widgets' ); ?> <span id="removing-widget"><?php _ex( 'Deactivate', 'removing-widget' ); ?> <span></span></span></h2>
</div>
<div class="widget-holder">
<div class="sidebar-description">
<p class="description"><?php _e( 'To activate a widget drag it to a sidebar or click on it. To deactivate a widget and delete its settings, drag it back.' ); ?></p>
</div>
<div id="widget-list">
<?php wp_list_widgets(); ?>
</div>
<br class='clear' />
</div>
<br class="clear" />
</div>
<?php
$theme_sidebars = array();
foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
if ( str_contains( $registered_sidebar['class'], 'inactive-sidebar' ) || str_starts_with( $sidebar, 'orphaned_widgets' ) ) {
$wrap_class = 'widgets-holder-wrap';
if ( ! empty( $registered_sidebar['class'] ) ) {
$wrap_class .= ' ' . $registered_sidebar['class'];
}
$is_inactive_widgets = 'wp_inactive_widgets' === $registered_sidebar['id'];
?>
<div class="<?php echo esc_attr( $wrap_class ); ?>">
<div class="widget-holder inactive">
<?php wp_list_widget_controls( $registered_sidebar['id'], $registered_sidebar['name'] ); ?>
<?php if ( $is_inactive_widgets ) { ?>
<div class="remove-inactive-widgets">
<form method="post">
<p>
<?php
$attributes = array( 'id' => 'inactive-widgets-control-remove' );
if ( empty( $sidebars_widgets['wp_inactive_widgets'] ) ) {
$attributes['disabled'] = '';
}
submit_button( __( 'Clear Inactive Widgets' ), 'delete', 'removeinactivewidgets', false, $attributes );
?>
<span class="spinner"></span>
</p>
<?php wp_nonce_field( 'remove-inactive-widgets', '_wpnonce_remove_inactive_widgets' ); ?>
</form>
</div>
<?php } ?>
</div>
<?php if ( $is_inactive_widgets ) { ?>
<p class="description"><?php _e( 'This will clear all items from the inactive widgets list. You will not be able to restore any customizations.' ); ?></p>
<?php } ?>
</div>
<?php
} else {
$theme_sidebars[ $sidebar ] = $registered_sidebar;
}
}
?>
</div>
</div>
<?php
$i = 0;
$split = 0;
$single_sidebar_class = '';
$sidebars_count = count( $theme_sidebars );
if ( $sidebars_count > 1 ) {
$split = (int) ceil( $sidebars_count / 2 );
} else {
$single_sidebar_class = ' single-sidebar';
}
?>
<div class="widget-liquid-right">
<div id="widgets-right" class="wp-clearfix<?php echo $single_sidebar_class; ?>">
<div class="sidebars-column-1">
<?php
foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
$wrap_class = 'widgets-holder-wrap';
if ( ! empty( $registered_sidebar['class'] ) ) {
$wrap_class .= ' sidebar-' . $registered_sidebar['class'];
}
if ( $i > 0 ) {
$wrap_class .= ' closed';
}
if ( $split && $i === $split ) {
?>
</div><div class="sidebars-column-2">
<?php
}
?>
<div class="<?php echo esc_attr( $wrap_class ); ?>">
<?php
// Show the control forms for each of the widgets in this sidebar.
wp_list_widget_controls( $sidebar, $registered_sidebar['name'] );
?>
</div>
<?php
++$i;
}
?>
</div>
</div>
</div>
<form method="post">
<?php wp_nonce_field( 'save-sidebar-widgets', '_wpnonce_widgets', false ); ?>
</form>
<br class="clear" />
</div>
<div class="widgets-chooser">
<ul class="widgets-chooser-sidebars"></ul>
<div class="widgets-chooser-actions">
<button class="button widgets-chooser-cancel"><?php _e( 'Cancel' ); ?></button>
<button class="button button-primary widgets-chooser-add"><?php _e( 'Add Widget' ); ?></button>
</div>
</div>
<?php
/**
* Fires after the available widgets and sidebars have loaded, before the admin footer.
*
* @since 2.2.0
*/
do_action( 'sidebar_admin_page' );
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z�8�\X X widgets.phpnu �[��� <?php
/**
* Widget administration screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
/** WordPress Administration Widgets API */
require_once ABSPATH . 'wp-admin/includes/widgets.php';
if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die(
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
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 <a href="https://developer.wordpress.org/themes/functionality/widgets/">follow these instructions</a>.' ) );
}
// 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�Z�@g5� � async-upload.phpnu �[��� <?php
/**
* Server-side file upload handler from wp-plupload or other asynchronous upload methods.
*
* @package WordPress
* @subpackage Administration
*/
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
define( 'DOING_AJAX', true );
}
if ( ! defined( 'WP_ADMIN' ) ) {
define( 'WP_ADMIN', true );
}
if ( defined( 'ABSPATH' ) ) {
require_once ABSPATH . 'wp-load.php';
} else {
require_once dirname( __DIR__ ) . '/wp-load.php';
}
require_once ABSPATH . 'wp-admin/admin.php';
header( 'Content-Type: text/plain; charset=' . get_option( 'blog_charset' ) );
if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
require ABSPATH . 'wp-admin/includes/ajax-actions.php';
send_nosniff_header();
nocache_headers();
wp_ajax_upload_attachment();
die( '0' );
}
if ( ! current_user_can( 'upload_files' ) ) {
wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
}
// Just fetch the detail form for that attachment.
if ( isset( $_REQUEST['attachment_id'] ) && (int) $_REQUEST['attachment_id'] && $_REQUEST['fetch'] ) {
$id = (int) $_REQUEST['attachment_id'];
$post = get_post( $id );
if ( 'attachment' !== $post->post_type ) {
wp_die( __( 'Invalid post type.' ) );
}
switch ( $_REQUEST['fetch'] ) {
case 3:
?>
<div class="media-item-wrapper">
<div class="attachment-details">
<?php
$thumb_url = wp_get_attachment_image_src( $id, 'thumbnail', true );
if ( $thumb_url ) {
echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
}
// Title shouldn't ever be empty, but use filename just in case.
$file = get_attached_file( $post->ID );
$file_url = wp_get_attachment_url( $post->ID );
$title = $post->post_title ? $post->post_title : wp_basename( $file );
?>
<div class="filename new">
<span class="media-list-title"><strong><?php echo esc_html( wp_html_excerpt( $title, 60, '…' ) ); ?></strong></span>
<span class="media-list-subtitle"><?php echo esc_html( wp_basename( $file ) ); ?></span>
<div class="attachment-tools">
<?php
if ( current_user_can( 'edit_post', $id ) ) {
echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '">' . _x( 'Edit', 'media item' ) . '</a>';
} else {
echo '<span class="edit-attachment">' . _x( 'Success', 'media item' ) . '</span>';
}
?>
<span class="media-item-copy-container copy-to-clipboard-container edit-attachment">
<button type="button" class="button button-small copy-attachment-url"
data-clipboard-text="<?php echo esc_url( $file_url ); ?>"
><?php _e( 'Copy URL to clipboard' ); ?></button>
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
</span>
</div>
</div>
</div>
</div>
<?php
break;
case 2:
add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
echo get_media_item(
$id,
array(
'send' => false,
'delete' => true,
)
);
break;
default:
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
echo get_media_item( $id );
break;
}
exit;
}
check_admin_referer( 'media-form' );
$post_id = 0;
if ( isset( $_REQUEST['post_id'] ) ) {
$post_id = absint( $_REQUEST['post_id'] );
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
$post_id = 0;
}
}
$id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $id ) ) {
$message = sprintf(
'%s <strong>%s</strong><br />%s',
sprintf(
'<button type="button" class="dismiss button-link" onclick="jQuery(this).parents(\'div.media-item\').slideUp(200, function(){jQuery(this).remove();});">%s</button>',
__( 'Dismiss' )
),
sprintf(
/* translators: %s: Name of the file that failed to upload. */
__( '“%s” has failed to upload.' ),
esc_html( $_FILES['async-upload']['name'] )
),
esc_html( $id->get_error_message() )
);
wp_admin_notice(
$message,
array(
'additional_classes' => array( 'error-div', 'error' ),
'paragraph_wrap' => false,
)
);
exit;
}
if ( $_REQUEST['short'] ) {
// Short form response - attachment ID only.
echo $id;
} else {
// Long form response - big chunk of HTML.
$type = $_REQUEST['type'];
/**
* Filters the returned ID of an uploaded attachment.
*
* The dynamic portion of the hook name, `$type`, refers to the attachment type.
*
* Possible hook names include:
*
* - `async_upload_audio`
* - `async_upload_file`
* - `async_upload_image`
* - `async_upload_video`
*
* @since 2.5.0
*
* @param int $id Uploaded attachment ID.
*/
echo apply_filters( "async_upload_{$type}", $id );
}
PK Y�Z^�SÖ= �= options-discussion.phpnu �[��� <?php
/**
* Discussion settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
}
// Used in the HTML title tag.
$title = __( 'Discussion Settings' );
$parent_file = 'options-general.php';
add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => '<p>' . __( 'This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they will not all fit here! :) Use the documentation links to get information on what each discussion setting does.' ) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-discussion-screen/">Documentation on Discussion Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<form method="post" action="options.php">
<?php settings_fields( 'discussion' ); ?>
<table class="form-table indent-children" role="presentation">
<tr>
<th scope="row"><?php _e( 'Default post settings' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Default post settings' );
?>
</span></legend>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked( '1', get_option( 'default_pingback_flag' ) ); ?> />
<?php _e( 'Attempt to notify any blogs linked to from the post' ); ?></label>
<br />
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked( 'open', get_option( 'default_ping_status' ) ); ?> />
<?php _e( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new posts' ); ?></label>
<br />
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked( 'open', get_option( 'default_comment_status' ) ); ?> />
<?php _e( 'Allow people to submit comments on new posts' ); ?></label>
<br />
<p class="description"><?php _e( 'Individual posts may override these settings. Changes here will only be applied to new posts.' ); ?></p>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Other comment settings' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Other comment settings' );
?>
</span></legend>
<label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked( '1', get_option( 'require_name_email' ) ); ?> /> <?php _e( 'Comment author must fill out name and email' ); ?></label>
<br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked( '1', get_option( 'comment_registration' ) ); ?> />
<?php _e( 'Users must be registered and logged in to comment' ); ?>
<?php
if ( ! get_option( 'users_can_register' ) && is_multisite() ) {
echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' );
}
?>
</label>
<br />
<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> /> <label for="close_comments_for_old_posts"><?php _e( 'Automatically close comments on old posts' ); ?></label>
<ul>
<li>
<label for="close_comments_days_old"><?php _e( 'Close comments when post is how many days old' ); ?></label>
<input name="close_comments_days_old" type="number" step="1" min="0" id="close_comments_days_old" value="<?php echo esc_attr( get_option( 'close_comments_days_old' ) ); ?>" class="small-text"/>
</li>
</ul>
<input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />
<label for="show_comments_cookies_opt_in"><?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?></label>
<br />
<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />
<label for="thread_comments"><?php _e( 'Enable threaded (nested) comments' ); ?></label>
<?php
/**
* Filters the maximum depth of threaded/nested comments.
*
* @since 2.7.0
*
* @param int $max_depth The maximum depth of threaded comments. Default 10.
*/
$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
$thread_comments_depth = '<select name="thread_comments_depth" id="thread_comments_depth">';
for ( $i = 2; $i <= $maxdeep; $i++ ) {
$thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
if ( (int) get_option( 'thread_comments_depth' ) === $i ) {
$thread_comments_depth .= " selected='selected'";
}
$thread_comments_depth .= ">$i</option>";
}
$thread_comments_depth .= '</select>';
?>
<ul>
<li>
<label for="thread_comments_depth"><?php _e( 'Number of levels for threaded (nested) comments' ); ?></label>
<?php echo $thread_comments_depth; ?>
</li>
</ul>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Comment Pagination' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Comment Pagination' );
?>
</span></legend>
<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> />
<label for="page_comments"><?php _e( 'Break comments into pages' ); ?></label>
<ul>
<li>
<label for="comments_per_page"><?php _e( 'Top level comments per page' ); ?></label>
<input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="<?php echo esc_attr( get_option( 'comments_per_page' ) ); ?>" class="small-text" />
</li>
<li>
<label for="default_comments_page"><?php _e( 'Comments page to display by default' ); ?></label>
<select name="default_comments_page" id="default_comments_page">
<option value="newest" <?php selected( 'newest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'last page' ); ?></option>
<option value="oldest" <?php selected( 'oldest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'first page' ); ?></option>
</select>
</li>
<li>
<label for="comment_order"><?php _e( 'Comments to display at the top of each page' ); ?></label>
<select name="comment_order" id="comment_order">
<option value="asc" <?php selected( 'asc', get_option( 'comment_order' ) ); ?>><?php _e( 'older' ); ?></option>
<option value="desc" <?php selected( 'desc', get_option( 'comment_order' ) ); ?>><?php _e( 'newer' ); ?></option>
</select>
</li>
</ul>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Email me whenever' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Email me whenever' );
?>
</span></legend>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />
<?php _e( 'Anyone posts a comment' ); ?> </label>
<br />
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />
<?php _e( 'A comment is held for moderation' ); ?> </label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Before a comment appears' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Before a comment appears' );
?>
</span></legend>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> />
<?php _e( 'Comment must be manually approved' ); ?> </label>
<br />
<label for="comment_previously_approved"><input type="checkbox" name="comment_previously_approved" id="comment_previously_approved" value="1" <?php checked( '1', get_option( 'comment_previously_approved' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Comment Moderation' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Comment Moderation' );
?>
</span></legend>
<p><label for="comment_max_links">
<?php
printf(
/* translators: %s: Number of links. */
__( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ),
'<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />'
);
?>
</label></p>
<p><label for="moderation_keys"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser’s user agent string, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.' ); ?></label></p>
<p>
<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Disallowed Comment Keys' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Disallowed Comment Keys' );
?>
</span></legend>
<p><label for="disallowed_keys"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser’s user agent string, it will be put in the Trash. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.' ); ?></label></p>
<p>
<textarea name="disallowed_keys" rows="10" cols="50" id="disallowed_keys" class="large-text code"><?php echo esc_textarea( get_option( 'disallowed_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<?php do_settings_fields( 'discussion', 'default' ); ?>
</table>
<h2 class="title"><?php _e( 'Avatars' ); ?></h2>
<p><?php _e( 'An avatar is an image that can be associated with a user across multiple websites. In this area, you can choose to display avatars of users who interact with the site.' ); ?></p>
<?php
// The above would be a good place to link to the documentation on the Gravatar functions, for putting it in themes. Anything like that?
$show_avatars = get_option( 'show_avatars' );
$show_avatars_class = '';
if ( ! $show_avatars ) {
$show_avatars_class = ' hide-if-js';
}
?>
<table class="form-table" role="presentation">
<tr>
<th scope="row"><?php _e( 'Avatar Display' ); ?></th>
<td>
<label for="show_avatars">
<input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> />
<?php _e( 'Show Avatars' ); ?>
</label>
</td>
</tr>
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e( 'Maximum Rating' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Maximum Rating' );
?>
</span></legend>
<?php
$ratings = array(
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'G' => __( 'G — Suitable for all audiences' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'R' => __( 'R — Intended for adult audiences above 17' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'X' => __( 'X — Even more mature than above' ),
);
foreach ( $ratings as $key => $rating ) :
$selected = ( get_option( 'avatar_rating' ) === $key ) ? 'checked="checked"' : '';
echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr( $key ) . "' $selected/> $rating</label><br />";
endforeach;
?>
</fieldset></td>
</tr>
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e( 'Default Avatar' ); ?></th>
<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Default Avatar' );
?>
</span></legend>
<p>
<?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.' ); ?><br />
</p>
<?php
$avatar_defaults = array(
'mystery' => __( 'Mystery Person' ),
'blank' => __( 'Blank' ),
'gravatar_default' => __( 'Gravatar Logo' ),
'identicon' => __( 'Identicon (Generated)' ),
'wavatar' => __( 'Wavatar (Generated)' ),
'monsterid' => __( 'MonsterID (Generated)' ),
'retro' => __( 'Retro (Generated)' ),
'robohash' => __( 'RoboHash (Generated)' ),
);
/**
* Filters the default avatars.
*
* Avatars are stored in key/value pairs, where the key is option value,
* and the name is the displayed avatar name.
*
* @since 2.6.0
*
* @param string[] $avatar_defaults Associative array of default avatars.
*/
$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
$default = get_option( 'avatar_default', 'mystery' );
$avatar_list = '';
// Force avatars on to display these choices.
add_filter( 'pre_option_show_avatars', '__return_true', 100 );
foreach ( $avatar_defaults as $default_key => $default_name ) {
$selected = ( $default === $default_key ) ? 'checked="checked" ' : '';
$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr( $default_key ) . "' {$selected}/> ";
$avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );
$avatar_list .= ' ' . $default_name . '</label>';
$avatar_list .= '<br />';
}
remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
/**
* Filters the HTML output of the default avatar list.
*
* @since 2.6.0
*
* @param string $avatar_list HTML markup of the avatar list.
*/
echo apply_filters( 'default_avatar_select', $avatar_list );
?>
</fieldset></td>
</tr>
<?php do_settings_fields( 'discussion', 'avatars' ); ?>
</table>
<?php do_settings_sections( 'discussion' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�ZU�f1 1 install-helper.phpnu �[��� <?php
/**
* Plugins may load this file to gain access to special helper functions
* for plugin installation. This file is not included by WordPress and it is
* recommended, to prevent fatal errors, that this file is included using
* require_once.
*
* These functions are not optimized for speed, but they should only be used
* once in a while, so speed shouldn't be a concern. If it is and you are
* needing to use these functions a lot, you might experience timeouts.
* If you do, then it is advised to just write the SQL code yourself.
*
* check_column( 'wp_links', 'link_description', 'mediumtext' );
*
* if ( check_column( $wpdb->comments, 'comment_author', 'tinytext' ) ) {
* echo "ok\n";
* }
*
* // Check the column.
* if ( ! check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
* $ddl = "ALTER TABLE $wpdb->links MODIFY COLUMN link_description varchar(255) NOT NULL DEFAULT '' ";
* $q = $wpdb->query( $ddl );
* }
*
* $error_count = 0;
* $tablename = $wpdb->links;
*
* if ( check_column( $wpdb->links, 'link_description', 'varchar( 255 )' ) ) {
* $res .= $tablename . ' - ok <br />';
* } else {
* $res .= 'There was a problem with ' . $tablename . '<br />';
* ++$error_count;
* }
*
* @package WordPress
* @subpackage Plugin
*/
/** Load WordPress Bootstrap */
require_once dirname( __DIR__ ) . '/wp-load.php';
if ( ! function_exists( 'maybe_create_table' ) ) :
/**
* Creates a table in the database if it doesn't already exist.
*
* @since 1.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $table_name Database table name.
* @param string $create_ddl SQL statement to create table.
* @return bool True on success or if the table already exists. False on failure.
*/
function maybe_create_table( $table_name, $create_ddl ) {
global $wpdb;
foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {
if ( $table === $table_name ) {
return true;
}
}
// Didn't find it, so try to create it.
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
$wpdb->query( $create_ddl );
// We cannot directly tell whether this succeeded!
foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) {
if ( $table === $table_name ) {
return true;
}
}
return false;
}
endif;
if ( ! function_exists( 'maybe_add_column' ) ) :
/**
* Adds column to database table, if it doesn't already exist.
*
* @since 1.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $table_name Database table name.
* @param string $column_name Table column name.
* @param string $create_ddl SQL statement to add column.
* @return bool True on success or if the column already exists. False on failure.
*/
function maybe_add_column( $table_name, $column_name, $create_ddl ) {
global $wpdb;
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
if ( $column === $column_name ) {
return true;
}
}
// Didn't find it, so try to create it.
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
$wpdb->query( $create_ddl );
// We cannot directly tell whether this succeeded!
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
if ( $column === $column_name ) {
return true;
}
}
return false;
}
endif;
/**
* Drops column from database table, if it exists.
*
* @since 1.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $table_name Database table name.
* @param string $column_name Table column name.
* @param string $drop_ddl SQL statement to drop column.
* @return bool True on success or if the column doesn't exist. False on failure.
*/
function maybe_drop_column( $table_name, $column_name, $drop_ddl ) {
global $wpdb;
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
if ( $column === $column_name ) {
// Found it, so try to drop it.
// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- No applicable variables for this query.
$wpdb->query( $drop_ddl );
// We cannot directly tell whether this succeeded!
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) {
if ( $column === $column_name ) {
return false;
}
}
}
}
// Else didn't find it.
return true;
}
/**
* Checks that database table column matches the criteria.
*
* Uses the SQL DESC for retrieving the table info for the column. It will help
* understand the parameters, if you do more research on what column information
* is returned by the SQL statement. Pass in null to skip checking that criteria.
*
* Column names returned from DESC table are case sensitive and are as listed:
*
* - Field
* - Type
* - Null
* - Key
* - Default
* - Extra
*
* @since 1.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $table_name Database table name.
* @param string $col_name Table column name.
* @param string $col_type Table column type.
* @param bool $is_null Optional. Check is null.
* @param mixed $key Optional. Key info.
* @param mixed $default_value Optional. Default value.
* @param mixed $extra Optional. Extra value.
* @return bool True, if matches. False, if not matching.
*/
function check_column( $table_name, $col_name, $col_type, $is_null = null, $key = null, $default_value = null, $extra = null ) {
global $wpdb;
$diffs = 0;
// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Cannot be prepared. Fetches columns for table names.
$results = $wpdb->get_results( "DESC $table_name" );
foreach ( $results as $row ) {
if ( $row->Field === $col_name ) {
// Got our column, check the params.
if ( ( null !== $col_type ) && ( $row->Type !== $col_type ) ) {
++$diffs;
}
if ( ( null !== $is_null ) && ( $row->Null !== $is_null ) ) {
++$diffs;
}
if ( ( null !== $key ) && ( $row->Key !== $key ) ) {
++$diffs;
}
if ( ( null !== $default_value ) && ( $row->Default !== $default_value ) ) {
++$diffs;
}
if ( ( null !== $extra ) && ( $row->Extra !== $extra ) ) {
++$diffs;
}
if ( $diffs > 0 ) {
return false;
}
return true;
} // End if found our column.
}
return false;
}
PK Y�Zo�� � custom-background.phpnu �[��� <?php
/**
* Custom background script.
*
* This file is deprecated, use 'wp-admin/includes/class-custom-background.php' instead.
*
* @deprecated 5.3.0
* @package WordPress
* @subpackage Administration
*/
_deprecated_file( basename( __FILE__ ), '5.3.0', 'wp-admin/includes/class-custom-background.php' );
/** Custom_Background class */
require_once ABSPATH . 'wp-admin/includes/class-custom-background.php';
PK Y�Z���Ն9 �9 edit-comments.phpnu �[��� <?php
/**
* Edit Comments Administration Screen.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'edit_posts' ) ) {
wp_die(
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit comments.' ) . '</p>',
403
);
}
$wp_list_table = _get_list_table( 'WP_Comments_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
$doaction = $wp_list_table->current_action();
if ( $doaction ) {
check_admin_referer( 'bulk-comments' );
if ( 'delete_all' === $doaction && ! empty( $_REQUEST['pagegen_timestamp'] ) ) {
/**
* @global wpdb $wpdb WordPress database abstraction object.
*/
global $wpdb;
$comment_status = wp_unslash( $_REQUEST['comment_status'] );
$delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] );
$comment_ids = $wpdb->get_col(
$wpdb->prepare(
"SELECT comment_ID FROM $wpdb->comments
WHERE comment_approved = %s AND %s > comment_date_gmt",
$comment_status,
$delete_time
)
);
$doaction = 'delete';
} elseif ( isset( $_REQUEST['delete_comments'] ) ) {
$comment_ids = $_REQUEST['delete_comments'];
$doaction = $_REQUEST['action'];
} elseif ( isset( $_REQUEST['ids'] ) ) {
$comment_ids = array_map( 'absint', explode( ',', $_REQUEST['ids'] ) );
} elseif ( wp_get_referer() ) {
wp_safe_redirect( wp_get_referer() );
exit;
}
$approved = 0;
$unapproved = 0;
$spammed = 0;
$unspammed = 0;
$trashed = 0;
$untrashed = 0;
$deleted = 0;
$redirect_to = remove_query_arg(
array(
'trashed',
'untrashed',
'deleted',
'spammed',
'unspammed',
'approved',
'unapproved',
'ids',
),
wp_get_referer()
);
$redirect_to = add_query_arg( 'paged', $pagenum, $redirect_to );
wp_defer_comment_counting( true );
foreach ( $comment_ids as $comment_id ) { // Check the permissions on each.
if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
continue;
}
switch ( $doaction ) {
case 'approve':
wp_set_comment_status( $comment_id, 'approve' );
++$approved;
break;
case 'unapprove':
wp_set_comment_status( $comment_id, 'hold' );
++$unapproved;
break;
case 'spam':
wp_spam_comment( $comment_id );
++$spammed;
break;
case 'unspam':
wp_unspam_comment( $comment_id );
++$unspammed;
break;
case 'trash':
wp_trash_comment( $comment_id );
++$trashed;
break;
case 'untrash':
wp_untrash_comment( $comment_id );
++$untrashed;
break;
case 'delete':
wp_delete_comment( $comment_id );
++$deleted;
break;
}
}
if ( ! in_array( $doaction, array( 'approve', 'unapprove', 'spam', 'unspam', 'trash', 'delete' ), true ) ) {
$screen = get_current_screen()->id;
/** This action is documented in wp-admin/edit.php */
$redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $comment_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}
wp_defer_comment_counting( false );
if ( $approved ) {
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
}
if ( $unapproved ) {
$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
}
if ( $spammed ) {
$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
}
if ( $unspammed ) {
$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
}
if ( $trashed ) {
$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
}
if ( $untrashed ) {
$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
}
if ( $deleted ) {
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
}
if ( $trashed || $spammed ) {
$redirect_to = add_query_arg( 'ids', implode( ',', $comment_ids ), $redirect_to );
}
wp_safe_redirect( $redirect_to );
exit;
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
exit;
}
$wp_list_table->prepare_items();
wp_enqueue_script( 'admin-comments' );
enqueue_comment_hotkeys_js();
/**
* @global int $post_id
*/
global $post_id;
if ( $post_id ) {
$comments_count = wp_count_comments( $post_id );
$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
if ( $comments_count->moderated > 0 ) {
// Used in the HTML title tag.
$title = sprintf(
/* translators: 1: Comments count, 2: Post title. */
__( 'Comments (%1$s) on “%2$s”' ),
number_format_i18n( $comments_count->moderated ),
$draft_or_post_title
);
} else {
// Used in the HTML title tag.
$title = sprintf(
/* translators: %s: Post title. */
__( 'Comments on “%s”' ),
$draft_or_post_title
);
}
} else {
$comments_count = wp_count_comments();
if ( $comments_count->moderated > 0 ) {
// Used in the HTML title tag.
$title = sprintf(
/* translators: %s: Comments count. */
__( 'Comments (%s)' ),
number_format_i18n( $comments_count->moderated )
);
} else {
// Used in the HTML title tag.
$title = __( 'Comments' );
}
}
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'You can manage comments made on your site similar to the way you manage posts and other content. This screen is customizable in the same ways as other management screens, and you can act on comments using the on-hover action links or the bulk actions.' ) . '</p>',
)
);
get_current_screen()->add_help_tab(
array(
'id' => 'moderating-comments',
'title' => __( 'Moderating Comments' ),
'content' =>
'<p>' . __( 'A red bar on the left means the comment is waiting for you to moderate it.' ) . '</p>' .
'<p>' . __( 'In the <strong>Author</strong> column, in addition to the author’s name, email address, and site URL, the commenter’s IP address is shown. Clicking on this link will show you all the comments made from this IP address.' ) . '</p>' .
'<p>' . __( 'In the <strong>Comment</strong> column, hovering over any comment gives you options to approve, reply (and approve), quick edit, edit, spam mark, or trash that comment.' ) . '</p>' .
'<p>' . __( 'In the <strong>In response to</strong> column, there are three elements. The text is the name of the post that inspired the comment, and links to the post editor for that entry. The View Post link leads to that post on your live site. The small bubble with the number in it shows the number of approved comments that post has received. If there are pending comments, a red notification circle with the number of pending comments is displayed. Clicking the notification circle will filter the comments screen to show only pending comments on that post.' ) . '</p>' .
'<p>' . __( 'In the <strong>Submitted on</strong> column, the date and time the comment was left on your site appears. Clicking on the date/time link will take you to that comment on your live site.' ) . '</p>' .
'<p>' . __( 'Many people take advantage of keyboard shortcuts to moderate their comments more quickly. Use the link to the side to learn more.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/understand-comment-spam/">Documentation on Comment Spam</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/keyboard-shortcuts-classic-editor/#keyboard-shortcuts-for-comments">Documentation on Keyboard Shortcuts</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_views' => __( 'Filter comments list' ),
'heading_pagination' => __( 'Comments list navigation' ),
'heading_list' => __( 'Comments list' ),
)
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 class="wp-heading-inline">
<?php
if ( $post_id ) {
printf(
/* translators: %s: Link to post. */
__( 'Comments on “%s”' ),
sprintf(
'<a href="%1$s">%2$s</a>',
get_edit_post_link( $post_id ),
wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' )
)
);
} else {
_e( 'Comments' );
}
?>
</h1>
<?php
if ( $post_id ) {
$post_type_object = get_post_type_object( get_post_type( $post_id ) );
if ( $post_type_object ) {
printf(
'<a href="%1$s" class="comments-view-item-link">%2$s</a>',
get_permalink( $post_id ),
$post_type_object->labels->view_item
);
}
}
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
echo '<span class="subtitle">';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
'<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>'
);
echo '</span>';
}
?>
<hr class="wp-header-end">
<?php
if ( isset( $_REQUEST['error'] ) ) {
$error = (int) $_REQUEST['error'];
$error_msg = '';
switch ( $error ) {
case 1:
$error_msg = __( 'Invalid comment ID.' );
break;
case 2:
$error_msg = __( 'Sorry, you are not allowed to edit comments on this post.' );
break;
}
if ( $error_msg ) {
wp_admin_notice(
$error_msg,
array(
'id' => 'moderated',
'additional_classes' => array( 'error' ),
)
);
}
}
if ( isset( $_REQUEST['approved'] )
|| isset( $_REQUEST['deleted'] )
|| isset( $_REQUEST['trashed'] )
|| isset( $_REQUEST['untrashed'] )
|| isset( $_REQUEST['spammed'] )
|| isset( $_REQUEST['unspammed'] )
|| isset( $_REQUEST['same'] )
) {
$approved = isset( $_REQUEST['approved'] ) ? (int) $_REQUEST['approved'] : 0;
$deleted = isset( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0;
$trashed = isset( $_REQUEST['trashed'] ) ? (int) $_REQUEST['trashed'] : 0;
$untrashed = isset( $_REQUEST['untrashed'] ) ? (int) $_REQUEST['untrashed'] : 0;
$spammed = isset( $_REQUEST['spammed'] ) ? (int) $_REQUEST['spammed'] : 0;
$unspammed = isset( $_REQUEST['unspammed'] ) ? (int) $_REQUEST['unspammed'] : 0;
$same = isset( $_REQUEST['same'] ) ? (int) $_REQUEST['same'] : 0;
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 || $same > 0 ) {
if ( $approved > 0 ) {
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment approved.', '%s comments approved.', $approved ),
$approved
);
}
if ( $spammed > 0 ) {
$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ),
$spammed
) . sprintf(
' <a href="%1$s">%2$s</a><br />',
esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", 'bulk-comments' ) ),
__( 'Undo' )
);
}
if ( $unspammed > 0 ) {
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment restored from the spam.', '%s comments restored from the spam.', $unspammed ),
$unspammed
);
}
if ( $trashed > 0 ) {
$ids = isset( $_REQUEST['ids'] ) ? $_REQUEST['ids'] : 0;
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment moved to the Trash.', '%s comments moved to the Trash.', $trashed ),
$trashed
) . sprintf(
' <a href="%1$s">%2$s</a><br />',
esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", 'bulk-comments' ) ),
__( 'Undo' )
);
}
if ( $untrashed > 0 ) {
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment restored from the Trash.', '%s comments restored from the Trash.', $untrashed ),
$untrashed
);
}
if ( $deleted > 0 ) {
$messages[] = sprintf(
/* translators: %s: Number of comments. */
_n( '%s comment permanently deleted.', '%s comments permanently deleted.', $deleted ),
$deleted
);
}
if ( $same > 0 ) {
$comment = get_comment( $same );
if ( $comment ) {
switch ( $comment->comment_approved ) {
case '1':
$messages[] = __( 'This comment is already approved.' ) . sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ),
__( 'Edit comment' )
);
break;
case 'trash':
$messages[] = __( 'This comment is already in the Trash.' ) . sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( admin_url( 'edit-comments.php?comment_status=trash' ) ),
__( 'View Trash' )
);
break;
case 'spam':
$messages[] = __( 'This comment is already marked as spam.' ) . sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( admin_url( "comment.php?action=editcomment&c=$same" ) ),
__( 'Edit comment' )
);
break;
}
}
}
wp_admin_notice(
implode( "<br />\n", $messages ),
array(
'id' => 'moderated',
'additional_classes' => array( 'updated' ),
'dismissible' => true,
)
);
}
}
?>
<?php $wp_list_table->views(); ?>
<form id="comments-form" method="get">
<?php $wp_list_table->search_box( __( 'Search Comments' ), 'comment' ); ?>
<?php if ( $post_id ) : ?>
<input type="hidden" name="p" value="<?php echo esc_attr( (int) $post_id ); ?>" />
<?php endif; ?>
<input type="hidden" name="comment_status" value="<?php echo esc_attr( $comment_status ); ?>" />
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr( current_time( 'mysql', 1 ) ); ?>" />
<input type="hidden" name="_total" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'total_items' ) ); ?>" />
<input type="hidden" name="_per_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'per_page' ) ); ?>" />
<input type="hidden" name="_page" value="<?php echo esc_attr( $wp_list_table->get_pagination_arg( 'page' ) ); ?>" />
<?php if ( isset( $_REQUEST['paged'] ) ) { ?>
<input type="hidden" name="paged" value="<?php echo esc_attr( absint( $_REQUEST['paged'] ) ); ?>" />
<?php } ?>
<?php $wp_list_table->display(); ?>
</form>
</div>
<div id="ajax-response"></div>
<?php
wp_comment_reply( '-1', true, 'detail' );
wp_comment_trashnotice();
require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�Za�W�i i options-media.phpnu �[��� <?php
/**
* Media settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
}
// Used in the HTML title tag.
$title = __( 'Media Settings' );
$parent_file = 'options-general.php';
$media_options_help = '<p>' . __( 'You can set maximum sizes for images inserted into your written content; you can also insert an image as Full Size.' ) . '</p>';
if ( ! is_multisite()
&& ( get_option( 'upload_url_path' )
|| get_option( 'upload_path' ) && 'wp-content/uploads' !== get_option( 'upload_path' ) )
) {
$media_options_help .= '<p>' . __( 'Uploading Files allows you to choose the folder and path for storing your uploaded files.' ) . '</p>';
}
$media_options_help .= '<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $media_options_help,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-media-screen/">Documentation on Media Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<form action="options.php" method="post">
<?php settings_fields( 'media' ); ?>
<h2 class="title"><?php _e( 'Image sizes' ); ?></h2>
<p><?php _e( 'The sizes listed below determine the maximum dimensions in pixels to use when adding an image to the Media Library.' ); ?></p>
<table class="form-table" role="presentation">
<tr>
<th scope="row"><?php _e( 'Thumbnail size' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Thumbnail size' );
?>
</span></legend>
<label for="thumbnail_size_w"><?php _e( 'Width' ); ?></label>
<input name="thumbnail_size_w" type="number" step="1" min="0" id="thumbnail_size_w" value="<?php form_option( 'thumbnail_size_w' ); ?>" class="small-text" />
<br />
<label for="thumbnail_size_h"><?php _e( 'Height' ); ?></label>
<input name="thumbnail_size_h" type="number" step="1" min="0" id="thumbnail_size_h" value="<?php form_option( 'thumbnail_size_h' ); ?>" class="small-text" />
</fieldset>
<input name="thumbnail_crop" type="checkbox" id="thumbnail_crop" value="1" <?php checked( '1', get_option( 'thumbnail_crop' ) ); ?>/>
<label for="thumbnail_crop"><?php _e( 'Crop thumbnail to exact dimensions (normally thumbnails are proportional)' ); ?></label>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Medium size' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Medium size' );
?>
</span></legend>
<label for="medium_size_w"><?php _e( 'Max Width' ); ?></label>
<input name="medium_size_w" type="number" step="1" min="0" id="medium_size_w" value="<?php form_option( 'medium_size_w' ); ?>" class="small-text" />
<br />
<label for="medium_size_h"><?php _e( 'Max Height' ); ?></label>
<input name="medium_size_h" type="number" step="1" min="0" id="medium_size_h" value="<?php form_option( 'medium_size_h' ); ?>" class="small-text" />
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Large size' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Large size' );
?>
</span></legend>
<label for="large_size_w"><?php _e( 'Max Width' ); ?></label>
<input name="large_size_w" type="number" step="1" min="0" id="large_size_w" value="<?php form_option( 'large_size_w' ); ?>" class="small-text" />
<br />
<label for="large_size_h"><?php _e( 'Max Height' ); ?></label>
<input name="large_size_h" type="number" step="1" min="0" id="large_size_h" value="<?php form_option( 'large_size_h' ); ?>" class="small-text" />
</fieldset></td>
</tr>
<?php do_settings_fields( 'media', 'default' ); ?>
</table>
<?php
/**
* @global array $wp_settings
*/
if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
?>
<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
<table class="form-table" role="presentation">
<?php do_settings_fields( 'media', 'embeds' ); ?>
</table>
<?php endif; ?>
<?php if ( ! is_multisite() ) : ?>
<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
<table class="form-table" role="presentation">
<?php
/*
* 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' ) ) :
?>
<tr>
<th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
<p class="description">
<?php
/* translators: %s: wp-content/uploads */
printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
?>
</p>
</td>
</tr>
<tr>
<th scope="row"><label for="upload_url_path"><?php _e( 'Full URL path to files' ); ?></label></th>
<td><input name="upload_url_path" type="text" id="upload_url_path" value="<?php echo esc_attr( get_option( 'upload_url_path' ) ); ?>" class="regular-text code" />
<p class="description"><?php _e( 'Configuring this is optional. By default, it should be blank.' ); ?></p>
</td>
</tr>
<tr>
<td colspan="2" class="td-full">
<?php else : ?>
<tr>
<td class="td-full">
<?php endif; ?>
<label for="uploads_use_yearmonth_folders">
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />
<?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
</label>
</td>
</tr>
<?php do_settings_fields( 'media', 'uploads' ); ?>
</table>
<?php endif; ?>
<?php do_settings_sections( 'media' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�Z^�� � index.phpnu �[��� <?php
/**
* Dashboard Administration Screen
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Bootstrap */
require_once __DIR__ . '/admin.php';
/** Load WordPress dashboard API */
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
wp_dashboard_setup();
wp_enqueue_script( 'dashboard' );
if ( current_user_can( 'install_plugins' ) ) {
wp_enqueue_script( 'plugin-install' );
wp_enqueue_script( 'updates' );
}
if ( current_user_can( 'upload_files' ) ) {
wp_enqueue_script( 'media-upload' );
}
add_thickbox();
if ( wp_is_mobile() ) {
wp_enqueue_script( 'jquery-touch-punch' );
}
// Used in the HTML title tag.
$title = __( 'Dashboard' );
$parent_file = 'index.php';
$help = '<p>' . __( 'Welcome to your WordPress Dashboard!' ) . '</p>';
$help .= '<p>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '</p>';
$screen = get_current_screen();
$screen->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $help,
)
);
// Help tabs.
$help = '<p>' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '</p>';
$help .= '<p>' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '</p>';
$screen->add_help_tab(
array(
'id' => 'help-navigation',
'title' => __( 'Navigation' ),
'content' => $help,
)
);
$help = '<p>' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '</p>';
$help .= '<p>' . __( '<strong>Screen Options</strong> — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '</p>';
$help .= '<p>' . __( '<strong>Drag and Drop</strong> — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '</p>';
$help .= '<p>' . __( '<strong>Box Controls</strong> — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '</p>';
$screen->add_help_tab(
array(
'id' => 'help-layout',
'title' => __( 'Layout' ),
'content' => $help,
)
);
$help = '<p>' . __( 'The boxes on your Dashboard screen are:' ) . '</p>';
if ( current_user_can( 'edit_theme_options' ) ) {
$help .= '<p>' . __( '<strong>Welcome</strong> — Shows links for some of the most common tasks when setting up a new site.' ) . '</p>';
}
if ( current_user_can( 'view_site_health_checks' ) ) {
$help .= '<p>' . __( '<strong>Site Health Status</strong> — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '</p>';
}
if ( current_user_can( 'edit_posts' ) ) {
$help .= '<p>' . __( '<strong>At a Glance</strong> — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '</p>';
}
$help .= '<p>' . __( '<strong>Activity</strong> — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '</p>';
if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) {
$help .= '<p>' . __( "<strong>Quick Draft</strong> — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '</p>';
}
$help .= '<p>' . sprintf(
/* translators: %s: WordPress Planet URL. */
__( '<strong>WordPress Events and News</strong> — Upcoming events near you as well as the latest news from the official WordPress project and the <a href="%s">WordPress Planet</a>.' ),
__( 'https://planet.wordpress.org/' )
) . '</p>';
$screen->add_help_tab(
array(
'id' => 'help-content',
'title' => __( 'Content' ),
'content' => $help,
)
);
unset( $help );
$wp_version = get_bloginfo( 'version', 'display' );
/* translators: %s: WordPress version. */
$wp_version_text = sprintf( __( 'Version %s' ), $wp_version );
$is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version );
if ( ! $is_dev_version ) {
$version_url = sprintf(
/* translators: %s: WordPress version. */
esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ),
sanitize_title( $wp_version )
);
$wp_version_text = sprintf(
'<a href="%1$s">%2$s</a>',
$version_url,
$wp_version_text
);
}
$screen->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/dashboard-screen/">Documentation on Dashboard</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' .
'<p>' . $wp_version_text . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<?php
if ( ! empty( $_GET['admin_email_remind_later'] ) ) :
/** This filter is documented in wp-login.php */
$remind_interval = (int) apply_filters( 'admin_email_remind_interval', 3 * DAY_IN_SECONDS );
$postponed_time = get_option( 'admin_email_lifespan' );
/*
* Calculate how many seconds it's been since the reminder was postponed.
* This allows us to not show it if the query arg is set, but visited due to caches, bookmarks or similar.
*/
$time_passed = time() - ( $postponed_time - $remind_interval );
// Only show the dashboard notice if it's been less than a minute since the message was postponed.
if ( $time_passed < MINUTE_IN_SECONDS ) :
$message = sprintf(
/* translators: %s: Human-readable time interval. */
__( 'The admin email verification page will reappear after %s.' ),
human_time_diff( time() + $remind_interval )
);
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
)
);
endif;
endif;
?>
<?php
if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
$classes = 'welcome-panel';
$option = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
// 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner.
$hide = ( 0 === $option || ( 2 === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) );
if ( $hide ) {
$classes .= ' hidden';
}
?>
<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
<a class="welcome-panel-close" href="<?php echo esc_url( admin_url( '?welcome=0' ) ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the welcome panel' ); ?>"><?php _e( 'Dismiss' ); ?></a>
<?php
/**
* Fires when adding content to the welcome panel on the admin dashboard.
*
* To remove the default welcome panel, use remove_action():
*
* remove_action( 'welcome_panel', 'wp_welcome_panel' );
*
* @since 3.5.0
*/
do_action( 'welcome_panel' );
?>
</div>
<?php endif; ?>
<div id="dashboard-widgets-wrap">
<?php wp_dashboard(); ?>
</div><!-- dashboard-widgets-wrap -->
</div><!-- wrap -->
<?php
wp_print_community_events_templates();
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z��s^ ^ network/site-info.phpnu �[��� <?php
/**
* Edit Site Info Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_sites' ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
}
get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
$id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;
if ( ! $id ) {
wp_die( __( 'Invalid site ID.' ) );
}
$details = get_site( $id );
if ( ! $details ) {
wp_die( __( 'The requested site does not exist.' ) );
}
if ( ! can_edit_network( $details->site_id ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );
$is_main_site = is_main_site( $id );
if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
check_admin_referer( 'edit-site' );
switch_to_blog( $id );
// Rewrite rules can't be flushed during switch to blog.
delete_option( 'rewrite_rules' );
$blog_data = wp_unslash( $_POST['blog'] );
$blog_data['scheme'] = $parsed_scheme;
if ( $is_main_site ) {
// On the network's main site, don't allow the domain or path to change.
$blog_data['domain'] = $details->domain;
$blog_data['path'] = $details->path;
} else {
// For any other site, the scheme, domain, and path can all be changed. We first
// need to ensure a scheme has been provided, otherwise fallback to the existing.
$new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );
if ( ! $new_url_scheme ) {
$blog_data['url'] = esc_url( $parsed_scheme . '://' . $blog_data['url'] );
}
$update_parsed_url = parse_url( $blog_data['url'] );
// If a path is not provided, use the default of `/`.
if ( ! isset( $update_parsed_url['path'] ) ) {
$update_parsed_url['path'] = '/';
}
$blog_data['scheme'] = $update_parsed_url['scheme'];
// Make sure to not lose the port if it was provided.
$blog_data['domain'] = $update_parsed_url['host'];
if ( isset( $update_parsed_url['port'] ) ) {
$blog_data['domain'] .= ':' . $update_parsed_url['port'];
}
$blog_data['path'] = $update_parsed_url['path'];
}
$existing_details = get_site( $id );
$blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
foreach ( $blog_data_checkboxes as $c ) {
if ( ! in_array( (int) $existing_details->$c, array( 0, 1 ), true ) ) {
$blog_data[ $c ] = $existing_details->$c;
} else {
$blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
}
}
update_blog_details( $id, $blog_data );
// Maybe update home and siteurl options.
$new_details = get_site( $id );
$old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
$old_home_parsed = parse_url( $old_home_url );
$old_home_host = $old_home_parsed['host'] . ( isset( $old_home_parsed['port'] ) ? ':' . $old_home_parsed['port'] : '' );
if ( $old_home_host === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
$new_home_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'home', $new_home_url );
}
$old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );
$old_site_parsed = parse_url( $old_site_url );
$old_site_host = $old_site_parsed['host'] . ( isset( $old_site_parsed['port'] ) ? ':' . $old_site_parsed['port'] : '' );
if ( $old_site_host === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
$new_site_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
update_option( 'siteurl', $new_site_url );
}
restore_current_blog();
wp_redirect(
add_query_arg(
array(
'update' => 'updated',
'id' => $id,
),
'site-info.php'
)
);
exit;
}
if ( isset( $_GET['update'] ) ) {
$messages = array();
if ( 'updated' === $_GET['update'] ) {
$messages[] = __( 'Site info updated.' );
}
}
// Used in the HTML title tag.
/* translators: %s: Site title. */
$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 id="edit-site"><?php echo $title; ?></h1>
<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
<?php
network_edit_site_nav(
array(
'blog_id' => $id,
'selected' => 'site-info',
)
);
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
wp_admin_notice( $msg, $notice_args );
}
}
?>
<form method="post" action="site-info.php?action=update-site">
<?php wp_nonce_field( 'edit-site' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<table class="form-table" role="presentation">
<?php
// The main site of the network should not be updated on this page.
if ( $is_main_site ) :
?>
<tr class="form-field">
<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
<td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>
</tr>
<?php
// For any other site, the scheme, domain, and path can all be changed.
else :
?>
<tr class="form-field form-required">
<th scope="row"><label for="url"><?php _e( 'Site Address (URL)' ); ?></label></th>
<td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
</tr>
<?php endif; ?>
<tr class="form-field">
<th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ); ?></label></th>
<td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ); ?>" /></td>
</tr>
<tr class="form-field">
<th scope="row"><label for="blog_last_updated"><?php _e( 'Last Updated' ); ?></label></th>
<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ); ?>" /></td>
</tr>
<?php
$attribute_fields = array( 'public' => _x( 'Public', 'site' ) );
if ( ! $is_main_site ) {
$attribute_fields['archived'] = __( 'Archived' );
$attribute_fields['spam'] = _x( 'Spam', 'site' );
$attribute_fields['deleted'] = __( 'Deleted' );
}
$attribute_fields['mature'] = __( 'Mature' );
?>
<tr>
<th scope="row"><?php _e( 'Attributes' ); ?></th>
<td>
<fieldset>
<legend class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Set site attributes' );
?>
</legend>
<?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); ?> <?php disabled( ! in_array( (int) $details->$field_key, array( 0, 1 ), true ) ); ?> />
<?php echo $field_label; ?></label><br />
<?php endforeach; ?>
<fieldset>
</td>
</tr>
</table>
<?php
/**
* Fires at the end of the site info form in network admin.
*
* @since 5.6.0
*
* @param int $id The site ID.
*/
do_action( 'network_site_info_form', $id );
submit_button();
?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z���_ _ network/index.phpnu �[��� <?php
/**
* Multisite administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
/** Load WordPress dashboard API */
require_once ABSPATH . 'wp-admin/includes/dashboard.php';
if ( ! current_user_can( 'manage_network' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
// Used in the HTML title tag.
$title = __( 'Dashboard' );
$parent_file = 'index.php';
$overview = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>';
$overview .= '<p>' . __( 'From here you can:' ) . '</p>';
$overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>';
$overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>';
$overview .= '<li>' . __( 'Update your network' ) . '</li>';
$overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $overview,
)
);
$quick_tasks = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>';
$quick_tasks .= '<ul><li>' . __( 'To add a new user, <strong>click Create a New User</strong>.' ) . '</li>';
$quick_tasks .= '<li>' . __( 'To add a new site, <strong>click Create a New Site</strong>.' ) . '</li></ul>';
$quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>';
$quick_tasks .= '<ul><li>' . __( 'To search for a user, <strong>enter an email address or username</strong>. Use a wildcard to search for a partial username, such as user*.' ) . '</li>';
$quick_tasks .= '<li>' . __( 'To search for a site, <strong>enter the path or domain</strong>.' ) . '</li></ul>';
get_current_screen()->add_help_tab(
array(
'id' => 'quick-tasks',
'title' => __( 'Quick Tasks' ),
'content' => $quick_tasks,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/">Documentation on the Network Admin</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
wp_dashboard_setup();
wp_enqueue_script( 'dashboard' );
wp_enqueue_script( 'plugin-install' );
add_thickbox();
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<div id="dashboard-widgets-wrap">
<?php wp_dashboard(); ?>
<div class="clear"></div>
</div><!-- dashboard-widgets-wrap -->
</div><!-- wrap -->
<?php
wp_print_community_events_templates();
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z network/263976/index.phpnu �[��� PK Y�Z����y y network/plugin-install.phpnu �[��� <?php
/**
* Install plugin network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
if ( isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) {
define( 'IFRAME_REQUEST', true );
}
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/plugin-install.php';
PK Y�Z����
network/plugin-editor.phpnu �[��� <?php
/**
* Plugin file editor network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/plugin-editor.php';
PK Y�Z!d��� � network/site-settings.phpnu �[��� <?php
/**
* Edit Site Settings Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_sites' ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
}
get_current_screen()->add_help_tab( get_site_screen_help_tab_args() );
get_current_screen()->set_help_sidebar( get_site_screen_help_sidebar_content() );
$id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;
if ( ! $id ) {
wp_die( __( 'Invalid site ID.' ) );
}
$details = get_site( $id );
if ( ! $details ) {
wp_die( __( 'The requested site does not exist.' ) );
}
if ( ! can_edit_network( $details->site_id ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
$is_main_site = is_main_site( $id );
if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] && is_array( $_POST['option'] ) ) {
check_admin_referer( 'edit-site' );
switch_to_blog( $id );
$skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
foreach ( (array) $_POST['option'] as $key => $val ) {
$key = wp_unslash( $key );
$val = wp_unslash( $val );
if ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) {
continue; // Avoids "0 is a protected WP option and may not be modified" error when editing blog options.
}
update_option( $key, $val );
}
/**
* Fires after the site options are updated.
*
* @since 3.0.0
* @since 4.4.0 Added `$id` parameter.
*
* @param int $id The ID of the site being updated.
*/
do_action( 'wpmu_update_blog_options', $id );
restore_current_blog();
wp_redirect(
add_query_arg(
array(
'update' => 'updated',
'id' => $id,
),
'site-settings.php'
)
);
exit;
}
if ( isset( $_GET['update'] ) ) {
$messages = array();
if ( 'updated' === $_GET['update'] ) {
$messages[] = __( 'Site options updated.' );
}
}
// Used in the HTML title tag.
/* translators: %s: Site title. */
$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
$parent_file = 'sites.php';
$submenu_file = 'sites.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 id="edit-site"><?php echo $title; ?></h1>
<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
<?php
network_edit_site_nav(
array(
'blog_id' => $id,
'selected' => 'site-settings',
)
);
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
wp_admin_notice( $msg, $notice_args );
}
}
?>
<form method="post" action="site-settings.php?action=update-site">
<?php wp_nonce_field( 'edit-site' ); ?>
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<table class="form-table" role="presentation">
<?php
$blog_prefix = $wpdb->get_blog_prefix( $id );
$sql = "SELECT * FROM {$blog_prefix}options
WHERE option_name NOT LIKE %s
AND option_name NOT LIKE %s";
$query = $wpdb->prepare(
$sql,
$wpdb->esc_like( '_' ) . '%',
'%' . $wpdb->esc_like( 'user_roles' )
);
$options = $wpdb->get_results( $query );
foreach ( $options as $option ) {
if ( 'default_role' === $option->option_name ) {
$editblog_default_role = $option->option_value;
}
$disabled = false;
$class = 'all-options';
if ( is_serialized( $option->option_value ) ) {
if ( is_serialized_string( $option->option_value ) ) {
$option->option_value = esc_html( maybe_unserialize( $option->option_value ) );
} else {
$option->option_value = 'SERIALIZED DATA';
$disabled = true;
$class = 'all-options disabled';
}
}
if ( str_contains( $option->option_value, "\n" ) ) {
?>
<tr class="form-field">
<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th>
<td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>
</tr>
<?php
} else {
?>
<tr class="form-field">
<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>" class="code"><?php echo esc_html( $option->option_name ); ?></label></th>
<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ), true ) ) { ?>
<td><code><?php echo esc_html( $option->option_value ); ?></code></td>
<?php } else { ?>
<td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td>
<?php } ?>
</tr>
<?php
}
} // End foreach.
/**
* Fires at the end of the Edit Site form, before the submit button.
*
* @since 3.0.0
*
* @param int $id Site ID.
*/
do_action( 'wpmueditblogaction', $id );
?>
</table>
<?php submit_button(); ?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z�lf network/error_lognu �[��� [15-Jun-2025 10:14:00 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[27-Jun-2025 23:33:49 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[05-Jul-2025 12:15:41 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[11-Jul-2025 07:32:39 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[22-Jul-2025 15:04:15 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[28-Jul-2025 17:54:06 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[04-Aug-2025 06:54:23 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
[04-Aug-2025 13:57:43 UTC] PHP Warning: fileperms(): stat failed for /home/mmdealscpanel/yummmdeals.com/index.php in /home/mmdealscpanel/yummmdeals.com/wp-admin/includes/file.php on line 2211
PK Y�ZP�h network/admin.phpnu �[��� <?php
/**
* WordPress Network Administration Bootstrap
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
define( 'WP_NETWORK_ADMIN', true );
/** Load WordPress Administration Bootstrap */
require_once dirname( __DIR__ ) . '/admin.php';
// Do not remove this check. It is required by individual network admin pages.
if ( ! is_multisite() ) {
wp_die( __( 'Multisite support is not enabled.' ) );
}
$redirect_network_admin_request = ( 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) );
/**
* Filters whether to redirect the request to the Network Admin.
*
* @since 3.2.0
*
* @param bool $redirect_network_admin_request Whether the request should be redirected.
*/
$redirect_network_admin_request = apply_filters( 'redirect_network_admin_request', $redirect_network_admin_request );
if ( $redirect_network_admin_request ) {
wp_redirect( network_admin_url() );
exit;
}
unset( $redirect_network_admin_request );
PK Y�Zs�<� � network/setup.phpnu �[��� <?php
/**
* Network Setup administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/network.php';
PK Y�Z.��>v v network/theme-install.phpnu �[��� <?php
/**
* Install theme network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
if ( isset( $_GET['tab'] ) && ( 'theme-information' === $_GET['tab'] ) ) {
define( 'IFRAME_REQUEST', true );
}
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/theme-install.php';
PK Y�Z��f f network/upgrade.phpnu �[��� <?php
/**
* Multisite upgrade administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require_once ABSPATH . WPINC . '/http.php';
// Used in the HTML title tag.
$title = __( 'Upgrade Network' );
$parent_file = 'upgrade.php';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.' ) . '</p>' .
'<p>' . __( 'If a version update to core has not happened, clicking this button will not affect anything.' ) . '</p>' .
'<p>' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-updates-screen">Documentation on Upgrade Network</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( ! current_user_can( 'upgrade_network' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
echo '<div class="wrap">';
echo '<h1>' . __( 'Upgrade Network' ) . '</h1>';
$action = isset( $_GET['action'] ) ? $_GET['action'] : 'show';
switch ( $action ) {
case 'upgrade':
$n = ( isset( $_GET['n'] ) ) ? (int) $_GET['n'] : 0;
if ( $n < 5 ) {
/**
* @global int $wp_db_version WordPress database version.
*/
global $wp_db_version;
update_site_option( 'wpmu_upgrade_site', $wp_db_version );
}
$site_ids = get_sites(
array(
'spam' => 0,
'deleted' => 0,
'archived' => 0,
'network_id' => get_current_network_id(),
'number' => 5,
'offset' => $n,
'fields' => 'ids',
'order' => 'DESC',
'orderby' => 'id',
'update_site_meta_cache' => false,
)
);
if ( empty( $site_ids ) ) {
echo '<p>' . __( 'All done!' ) . '</p>';
break;
}
echo '<ul>';
foreach ( (array) $site_ids as $site_id ) {
switch_to_blog( $site_id );
$siteurl = site_url();
$upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' );
restore_current_blog();
echo "<li>$siteurl</li>";
$response = wp_remote_get(
$upgrade_url,
array(
'timeout' => 120,
'httpversion' => '1.1',
'sslverify' => false,
)
);
if ( is_wp_error( $response ) ) {
wp_die(
sprintf(
/* translators: 1: Site URL, 2: Server error message. */
__( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ),
$siteurl,
'<em>' . $response->get_error_message() . '</em>'
)
);
}
/**
* Fires after the Multisite DB upgrade for each site is complete.
*
* @since MU (3.0.0)
*
* @param array $response The upgrade response array.
*/
do_action( 'after_mu_upgrade', $response );
/**
* Fires after each site has been upgraded.
*
* @since MU (3.0.0)
*
* @param int $site_id The Site ID.
*/
do_action( 'wpmu_upgrade_site', $site_id );
}
echo '</ul>';
?><p><?php _e( 'If your browser does not start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Sites' ); ?></a></p>
<script type="text/javascript">
<!--
function nextpage() {
location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>";
}
setTimeout( "nextpage()", 250 );
//-->
</script>
<?php
break;
case 'show':
default:
if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $GLOBALS['wp_db_version'] ) :
?>
<h2><?php _e( 'Database Update Required' ); ?></h2>
<p><?php _e( 'WordPress has been updated! Next and final step is to individually upgrade the sites in your network.' ); ?></p>
<?php endif; ?>
<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
<p><a class="button button-primary" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p>
<?php
/**
* Fires before the footer on the network upgrade screen.
*
* @since MU (3.0.0)
*/
do_action( 'wpmu_upgrade_page' );
break;
}
?>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�ZIS\� � network/menu.phpnu �[��� <?php
/**
* Build Network Administration Menu.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/* translators: Network menu item. */
$menu[2] = array( __( 'Dashboard' ), 'manage_network', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' );
$submenu['index.php'][0] = array( __( 'Home' ), 'read', 'index.php' );
if ( current_user_can( 'update_core' ) ) {
$cap = 'update_core';
} elseif ( current_user_can( 'update_plugins' ) ) {
$cap = 'update_plugins';
} elseif ( current_user_can( 'update_themes' ) ) {
$cap = 'update_themes';
} else {
$cap = 'update_languages';
}
$update_data = wp_get_update_data();
if ( $update_data['counts']['total'] ) {
$submenu['index.php'][10] = array(
sprintf(
/* translators: %s: Number of available updates. */
__( 'Updates %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="update-count">%s</span></span>',
$update_data['counts']['total'],
number_format_i18n( $update_data['counts']['total'] )
)
),
$cap,
'update-core.php',
);
} else {
$submenu['index.php'][10] = array( __( 'Updates' ), $cap, 'update-core.php' );
}
unset( $cap );
$submenu['index.php'][15] = array( __( 'Upgrade Network' ), 'upgrade_network', 'upgrade.php' );
$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
/* translators: Sites menu item. */
$menu[5] = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );
$submenu['sites.php'][5] = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );
$submenu['sites.php'][10] = array( __( 'Add New Site' ), 'create_sites', 'site-new.php' );
$menu[10] = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
$submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'users.php' );
$submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
$menu[15] = array(
sprintf(
/* translators: %s: Number of available theme updates. */
__( 'Themes %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="theme-count">%s</span></span>',
$update_data['counts']['themes'],
number_format_i18n( $update_data['counts']['themes'] )
)
),
'manage_network_themes',
'themes.php',
'',
'menu-top menu-icon-appearance',
'menu-appearance',
'dashicons-admin-appearance',
);
} else {
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
}
$submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
$submenu['themes.php'][10] = array( __( 'Add New Theme' ), 'install_themes', 'theme-install.php' );
$submenu['themes.php'][15] = array( __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' );
if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
$menu[20] = array(
sprintf(
/* translators: %s: Number of available plugin updates. */
__( 'Plugins %s' ),
sprintf(
'<span class="update-plugins count-%s"><span class="plugin-count">%s</span></span>',
$update_data['counts']['plugins'],
number_format_i18n( $update_data['counts']['plugins'] )
)
),
'manage_network_plugins',
'plugins.php',
'',
'menu-top menu-icon-plugins',
'menu-plugins',
'dashicons-admin-plugins',
);
} else {
$menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
}
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
$submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' );
$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );
if ( defined( 'MULTISITE' ) && defined( 'WP_ALLOW_MULTISITE' ) && WP_ALLOW_MULTISITE ) {
$submenu['settings.php'][5] = array( __( 'Network Settings' ), 'manage_network_options', 'settings.php' );
$submenu['settings.php'][10] = array( __( 'Network Setup' ), 'setup_network', 'setup.php' );
}
unset( $update_data );
$menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' );
require_once ABSPATH . 'wp-admin/includes/menu.php';
PK Y�Z4�� � network/update-core.phpnu �[��� <?php
/**
* Updates network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/update-core.php';
PK Y�Zf�)�x x network/user-new.phpnu �[��� <?php
/**
* Add New User network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'create_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to add users to this network.' ) );
}
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'Add User will set up a new user account on the network and send that person an email with username and password.' ) . '</p>' .
'<p>' . __( 'Users who are signed up to the network without a site are added as subscribers to the main or primary dashboard site, giving them profile pages to manage their accounts. These users will only see Dashboard and My Sites in the main navigation until a site is created for them.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
if ( isset( $_REQUEST['action'] ) && 'add-user' === $_REQUEST['action'] ) {
check_admin_referer( 'add-user', '_wpnonce_add-user' );
if ( ! current_user_can( 'manage_network_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
if ( ! is_array( $_POST['user'] ) ) {
wp_die( __( 'Cannot create an empty user.' ) );
}
$user = wp_unslash( $_POST['user'] );
$user_details = wpmu_validate_user_signup( $user['username'], $user['email'] );
if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) {
$add_user_errors = $user_details['errors'];
} else {
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, sanitize_email( $user['email'] ) );
if ( ! $user_id ) {
$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
} else {
/**
* Fires after a new user has been created via the network user-new.php page.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
*/
do_action( 'network_user_new_created_user', $user_id );
wp_redirect(
add_query_arg(
array(
'update' => 'added',
'user_id' => $user_id,
),
'user-new.php'
)
);
exit;
}
}
}
$message = '';
if ( isset( $_GET['update'] ) ) {
if ( 'added' === $_GET['update'] ) {
$edit_link = '';
if ( isset( $_GET['user_id'] ) ) {
$user_id_new = absint( $_GET['user_id'] );
if ( $user_id_new ) {
$edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) );
}
}
$message = __( 'User added.' );
if ( $edit_link ) {
$message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) );
}
}
}
// Used in the HTML title tag.
$title = __( 'Add New User' );
$parent_file = 'users.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 id="add-new-user"><?php _e( 'Add New User' ); ?></h1>
<?php
if ( '' !== $message ) {
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
$error_messages = '';
foreach ( $add_user_errors->get_error_messages() as $error ) {
$error_messages .= "<p>$error</p>";
}
wp_admin_notice(
$error_messages,
array(
'type' => 'error',
'dismissible' => true,
'id' => 'message',
'paragraph_wrap' => false,
)
);
}
?>
<form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate">
<p><?php echo wp_required_field_message(); ?></p>
<table class="form-table" role="presentation">
<tr class="form-field form-required">
<th scope="row"><label for="username"><?php _e( 'Username' ); ?> <?php echo wp_required_field_indicator(); ?></label></th>
<td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" required="required" /></td>
</tr>
<tr class="form-field form-required">
<th scope="row"><label for="email"><?php _e( 'Email' ); ?> <?php echo wp_required_field_indicator(); ?></label></th>
<td><input type="email" class="regular-text" name="user[email]" id="email" required="required" /></td>
</tr>
<tr class="form-field">
<td colspan="2" class="td-full"><?php _e( 'A password reset link will be sent to the user via email.' ); ?></td>
</tr>
</table>
<?php
/**
* Fires at the end of the new user form in network admin.
*
* @since 4.5.0
*/
do_action( 'network_user_new_form' );
wp_nonce_field( 'add-user', '_wpnonce_add-user' );
submit_button( __( 'Add User' ), 'primary', 'add-user' );
?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Z�� � network/privacy.phpnu �[��� <?php
/**
* Network Privacy administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 4.9.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/privacy.php';
PK Y�Z$F�^� � network/credits.phpnu �[��� <?php
/**
* Network Credits administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.4.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/credits.php';
PK Y�Z�w�,� � network/user-edit.phpnu �[��� <?php
/**
* Edit user network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/user-edit.php';
PK Y�Z.�:/5 5 network/sites.phpnu �[��� <?php
/**
* Multisite sites administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_sites' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
$wp_list_table = _get_list_table( 'WP_MS_Sites_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
// Used in the HTML title tag.
$title = __( 'Sites' );
$parent_file = 'sites.php';
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'Add New Site takes you to the screen for adding a new site to the network. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '</p>' .
'<p>' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '</p>' .
'<p>' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '</p>' .
'<ul><li>' . __( 'An Edit link to a separate Edit Site screen.' ) . '</li>' .
'<li>' . __( 'Dashboard leads to the Dashboard for that site.' ) . '</li>' .
'<li>' . __( 'Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.' ) . '</li>' .
'<li>' . __( 'Delete which is a permanent action after the confirmation screen.' ) . '</li>' .
'<li>' . __( 'Visit to go to the front-end of the live site.' ) . '</li></ul>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_pagination' => __( 'Sites list navigation' ),
'heading_list' => __( 'Sites list' ),
)
);
$id = isset( $_REQUEST['id'] ) ? (int) $_REQUEST['id'] : 0;
if ( isset( $_GET['action'] ) ) {
/** This action is documented in wp-admin/network/edit.php */
do_action( 'wpmuadminedit' );
// A list of valid actions and their associated messaging for confirmation output.
$manage_actions = array(
/* translators: %s: Site URL. */
'activateblog' => __( 'You are about to activate the site %s.' ),
/* translators: %s: Site URL. */
'deactivateblog' => __( 'You are about to deactivate the site %s.' ),
/* translators: %s: Site URL. */
'unarchiveblog' => __( 'You are about to unarchive the site %s.' ),
/* translators: %s: Site URL. */
'archiveblog' => __( 'You are about to archive the site %s.' ),
/* translators: %s: Site URL. */
'unspamblog' => __( 'You are about to unspam the site %s.' ),
/* translators: %s: Site URL. */
'spamblog' => __( 'You are about to mark the site %s as spam.' ),
/* translators: %s: Site URL. */
'deleteblog' => __( 'You are about to delete the site %s.' ),
/* translators: %s: Site URL. */
'unmatureblog' => __( 'You are about to mark the site %s as mature.' ),
/* translators: %s: Site URL. */
'matureblog' => __( 'You are about to mark the site %s as not mature.' ),
);
if ( 'confirm' === $_GET['action'] ) {
// The action2 parameter contains the action being taken on the site.
$site_action = $_GET['action2'];
if ( ! array_key_exists( $site_action, $manage_actions ) ) {
wp_die( __( 'The requested action is not valid.' ) );
}
// The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility.
if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) {
check_admin_referer( 'confirm' );
} else {
check_admin_referer( $site_action . '_' . $id );
}
if ( ! headers_sent() ) {
nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' );
}
if ( is_main_site( $id ) ) {
wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
}
$site_details = get_site( $id );
$site_address = untrailingslashit( $site_details->domain . $site_details->path );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php _e( 'Confirm your action' ); ?></h1>
<form action="sites.php?action=<?php echo esc_attr( $site_action ); ?>" method="post">
<input type="hidden" name="action" value="<?php echo esc_attr( $site_action ); ?>" />
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>
<?php
if ( 'deleteblog' === $site_action ) {
$submit = __( 'Delete this site permanently' );
?>
<div class="notice notice-warning inline">
<p><?php _e( 'Deleting a site is a permanent action that cannot be undone. This will delete the entire site and its uploads directory.' ); ?>
</div>
<?php
} else {
$submit = __( 'Confirm' );
}
?>
<p><?php printf( $manage_actions[ $site_action ], "<strong>{$site_address}</strong>" ); ?></p>
<?php submit_button( $submit, 'primary' ); ?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
} elseif ( array_key_exists( $_GET['action'], $manage_actions ) ) {
$action = $_GET['action'];
check_admin_referer( $action . '_' . $id );
} elseif ( 'allblogs' === $_GET['action'] ) {
check_admin_referer( 'bulk-sites' );
}
$updated_action = '';
switch ( $_GET['action'] ) {
case 'deleteblog':
if ( ! current_user_can( 'delete_sites' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), '', array( 'response' => 403 ) );
}
$updated_action = 'not_deleted';
if ( 0 !== $id && ! is_main_site( $id ) && current_user_can( 'delete_site', $id ) ) {
wpmu_delete_blog( $id, true );
$updated_action = 'delete';
}
break;
case 'delete_sites':
check_admin_referer( 'ms-delete-sites' );
foreach ( (array) $_POST['site_ids'] as $site_id ) {
$site_id = (int) $site_id;
if ( is_main_site( $site_id ) ) {
continue;
}
if ( ! current_user_can( 'delete_site', $site_id ) ) {
$site = get_site( $site_id );
$site_address = untrailingslashit( $site->domain . $site->path );
wp_die(
sprintf(
/* translators: %s: Site URL. */
__( 'Sorry, you are not allowed to delete the site %s.' ),
$site_address
),
403
);
}
$updated_action = 'all_delete';
wpmu_delete_blog( $site_id, true );
}
break;
case 'allblogs':
if ( isset( $_POST['action'] ) && isset( $_POST['allblogs'] ) ) {
$doaction = $_POST['action'];
foreach ( (array) $_POST['allblogs'] as $site_id ) {
$site_id = (int) $site_id;
if ( 0 !== $site_id && ! is_main_site( $site_id ) ) {
switch ( $doaction ) {
case 'delete':
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php _e( 'Confirm your action' ); ?></h1>
<form action="sites.php?action=delete_sites" method="post">
<input type="hidden" name="action" value="delete_sites" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( 'ms-delete-sites', '_wpnonce', false ); ?>
<p><?php _e( 'You are about to delete the following sites:' ); ?></p>
<ul class="ul-disc">
<?php
foreach ( $_POST['allblogs'] as $site_id ) :
$site_id = (int) $site_id;
$site = get_site( $site_id );
$site_address = untrailingslashit( $site->domain . $site->path );
?>
<li>
<?php echo $site_address; ?>
<input type="hidden" name="site_ids[]" value="<?php echo esc_attr( $site_id ); ?>" />
</li>
<?php endforeach; ?>
</ul>
<?php submit_button( __( 'Confirm' ), 'primary' ); ?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
break;
case 'spam':
case 'notspam':
$updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam';
update_blog_status( $site_id, 'spam', ( 'spam' === $doaction ) ? '1' : '0' );
break;
}
} else {
wp_die( __( 'Sorry, you are not allowed to change the current site.' ) );
}
}
if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {
$redirect_to = wp_get_referer();
$blogs = (array) $_POST['allblogs'];
/** This action is documented in wp-admin/network/site-themes.php */
$redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $redirect_to );
exit;
}
} else {
// Process query defined by WP_MS_Site_List_Table::extra_table_nav().
$location = remove_query_arg(
array( '_wp_http_referer', '_wpnonce' ),
add_query_arg( $_POST, network_admin_url( 'sites.php' ) )
);
wp_redirect( $location );
exit;
}
break;
case 'archiveblog':
case 'unarchiveblog':
update_blog_status( $id, 'archived', ( 'archiveblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'activateblog':
update_blog_status( $id, 'deleted', '0' );
/**
* Fires after a network site is activated.
*
* @since MU (3.0.0)
*
* @param int $id The ID of the activated site.
*/
do_action( 'activate_blog', $id );
break;
case 'deactivateblog':
/**
* Fires before a network site is deactivated.
*
* @since MU (3.0.0)
*
* @param int $id The ID of the site being deactivated.
*/
do_action( 'deactivate_blog', $id );
update_blog_status( $id, 'deleted', '1' );
break;
case 'unspamblog':
case 'spamblog':
update_blog_status( $id, 'spam', ( 'spamblog' === $_GET['action'] ) ? '1' : '0' );
break;
case 'unmatureblog':
case 'matureblog':
update_blog_status( $id, 'mature', ( 'matureblog' === $_GET['action'] ) ? '1' : '0' );
break;
}
if ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) {
$updated_action = $_GET['action'];
}
if ( ! empty( $updated_action ) ) {
wp_safe_redirect( add_query_arg( array( 'updated' => $updated_action ), wp_get_referer() ) );
exit;
}
}
$msg = '';
if ( isset( $_GET['updated'] ) ) {
$action = $_GET['updated'];
switch ( $action ) {
case 'all_notspam':
$msg = __( 'Sites removed from spam.' );
break;
case 'all_spam':
$msg = __( 'Sites marked as spam.' );
break;
case 'all_delete':
$msg = __( 'Sites deleted.' );
break;
case 'delete':
$msg = __( 'Site deleted.' );
break;
case 'not_deleted':
$msg = __( 'Sorry, you are not allowed to delete that site.' );
break;
case 'archiveblog':
$msg = __( 'Site archived.' );
break;
case 'unarchiveblog':
$msg = __( 'Site unarchived.' );
break;
case 'activateblog':
$msg = __( 'Site activated.' );
break;
case 'deactivateblog':
$msg = __( 'Site deactivated.' );
break;
case 'unspamblog':
$msg = __( 'Site removed from spam.' );
break;
case 'spamblog':
$msg = __( 'Site marked as spam.' );
break;
default:
/**
* Filters a specific, non-default, site-updated message in the Network admin.
*
* The dynamic portion of the hook name, `$action`, refers to the non-default
* site update action.
*
* @since 3.1.0
*
* @param string $msg The update message. Default 'Settings saved'.
*/
$msg = apply_filters( "network_sites_updated_message_{$action}", __( 'Settings saved.' ) );
break;
}
if ( ! empty( $msg ) ) {
$msg = wp_get_admin_notice(
$msg,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
}
$wp_list_table->prepare_items();
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php _e( 'Sites' ); ?></h1>
<?php if ( current_user_can( 'create_sites' ) ) : ?>
<a href="<?php echo esc_url( network_admin_url( 'site-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New Site' ); ?></a>
<?php endif; ?>
<?php
if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
echo '<span class="subtitle">';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
'<strong>' . esc_html( $s ) . '</strong>'
);
echo '</span>';
}
?>
<hr class="wp-header-end">
<?php $wp_list_table->views(); ?>
<?php echo $msg; ?>
<form method="get" id="ms-search" class="wp-clearfix">
<?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
<input type="hidden" name="action" value="blogs" />
</form>
<form id="form-site-list" action="sites.php?action=allblogs" method="post">
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�Z��V� � network/plugins.phpnu �[��� <?php
/**
* Network Plugins administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/plugins.php';
PK Y�Zu�k% k% network/site-new.phpnu �[��� <?php
/**
* Add Site Administration Screen
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
/** WordPress Translation Installation API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
if ( ! current_user_can( 'create_sites' ) ) {
wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
}
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '</p>' .
'<p>' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
if ( isset( $_REQUEST['action'] ) && 'add-site' === $_REQUEST['action'] ) {
check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
if ( ! is_array( $_POST['blog'] ) ) {
wp_die( __( 'Cannot create an empty site.' ) );
}
$blog = $_POST['blog'];
$domain = '';
$blog['domain'] = trim( $blog['domain'] );
if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
$domain = strtolower( $blog['domain'] );
}
// If not a subdomain installation, make sure the domain isn't a reserved word.
if ( ! is_subdomain_install() ) {
$subdirectory_reserved_names = get_subdirectory_reserved_names();
if ( in_array( $domain, $subdirectory_reserved_names, true ) ) {
wp_die(
sprintf(
/* translators: %s: Reserved names list. */
__( 'The following words are reserved for use by WordPress functions and cannot be used as site names: %s' ),
'<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
)
);
}
}
$title = $blog['title'];
$meta = array(
'public' => 1,
);
// Handle translation installation for the new site.
if ( isset( $_POST['WPLANG'] ) ) {
if ( '' === $_POST['WPLANG'] ) {
$meta['WPLANG'] = ''; // en_US
} elseif ( in_array( $_POST['WPLANG'], get_available_languages(), true ) ) {
$meta['WPLANG'] = $_POST['WPLANG'];
} elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
if ( $language ) {
$meta['WPLANG'] = $language;
}
}
}
if ( empty( $title ) ) {
wp_die( __( 'Missing site title.' ) );
}
if ( empty( $domain ) ) {
wp_die( __( 'Missing or invalid site address.' ) );
}
if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
wp_die( __( 'Missing email address.' ) );
}
$email = sanitize_email( $blog['email'] );
if ( ! is_email( $email ) ) {
wp_die( __( 'Invalid email address.' ) );
}
if ( is_subdomain_install() ) {
$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain );
$path = get_network()->path;
} else {
$newdomain = get_network()->domain;
$path = get_network()->path . $domain . '/';
}
$password = 'N/A';
$user_id = email_exists( $email );
if ( ! $user_id ) { // Create a new user with a random password.
/**
* Fires immediately before a new user is created via the network site-new.php page.
*
* @since 4.5.0
*
* @param string $email Email of the non-existent user.
*/
do_action( 'pre_network_site_new_created_user', $email );
$user_id = username_exists( $domain );
if ( $user_id ) {
wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
}
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false === $user_id ) {
wp_die( __( 'There was an error creating the user.' ) );
}
/**
* Fires after a new user has been created via the network site-new.php page.
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
*/
do_action( 'network_site_new_created_user', $user_id );
}
$wpdb->hide_errors();
$id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );
$wpdb->show_errors();
if ( ! is_wp_error( $id ) ) {
if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {
update_user_option( $user_id, 'primary_blog', $id, true );
}
wpmu_new_site_admin_notification( $id, $user_id );
wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
wp_redirect(
add_query_arg(
array(
'update' => 'added',
'id' => $id,
),
'site-new.php'
)
);
exit;
} else {
wp_die( $id->get_error_message() );
}
}
if ( isset( $_GET['update'] ) ) {
$messages = array();
if ( 'added' === $_GET['update'] ) {
$messages[] = sprintf(
/* translators: 1: Dashboard URL, 2: Network admin edit URL. */
__( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
);
}
}
// Used in the HTML title tag.
$title = __( 'Add New Site' );
$parent_file = 'sites.php';
wp_enqueue_script( 'user-suggest' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
<?php
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
wp_admin_notice( $msg, $notice_args );
}
}
?>
<p><?php echo wp_required_field_message(); ?></p>
<form method="post" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
<table class="form-table" role="presentation">
<tr class="form-field form-required">
<th scope="row">
<label for="site-address">
<?php
_e( 'Site Address (URL)' );
echo ' ' . wp_required_field_indicator();
?>
</label>
</th>
<td>
<?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
<?php
} else {
echo get_network()->domain . get_network()->path
?>
<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
<?php
}
echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
?>
</td>
</tr>
<tr class="form-field form-required">
<th scope="row">
<label for="site-title">
<?php
_e( 'Site Title' );
echo ' ' . wp_required_field_indicator();
?>
</label>
</th>
<td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td>
</tr>
<?php
$languages = get_available_languages();
$translations = wp_get_available_translations();
if ( ! empty( $languages ) || ! empty( $translations ) ) :
?>
<tr class="form-field form-required">
<th scope="row"><label for="site-language"><?php _e( 'Site Language' ); ?></label></th>
<td>
<?php
// Network default.
$lang = get_site_option( 'WPLANG' );
// Use English if the default isn't available.
if ( ! in_array( $lang, $languages, true ) ) {
$lang = '';
}
wp_dropdown_languages(
array(
'name' => 'WPLANG',
'id' => 'site-language',
'selected' => $lang,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
)
);
?>
</td>
</tr>
<?php endif; // Languages. ?>
<tr class="form-field form-required">
<th scope="row">
<label for="admin-email">
<?php
_e( 'Admin Email' );
echo ' ' . wp_required_field_indicator();
?>
</label>
</th>
<td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td>
</tr>
<tr class="form-field">
<td colspan="2" class="td-full"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>
</tr>
</table>
<?php
/**
* Fires at the end of the new site form in network admin.
*
* @since 4.5.0
*/
do_action( 'network_site_new_form' );
submit_button( __( 'Add Site' ), 'primary', 'add-site' );
?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK Y�Zv�̫� � network/contribute.phpnu �[��� <?php
/**
* Network Contribute administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 6.3.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/contribute.php';
PK Y�Z�]Z}� � network/profile.phpnu �[��� <?php
/**
* User profile network administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.1.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/profile.php';
PK Y�Z�� � network/about.phpnu �[��� <?php
/**
* Network About administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.4.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/about.php';
PK Y�Z�s߽% % network/users.phpnu �[��� <?php
/**
* Multisite users administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_network_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
if ( isset( $_GET['action'] ) ) {
/** This action is documented in wp-admin/network/edit.php */
do_action( 'wpmuadminedit' );
switch ( $_GET['action'] ) {
case 'deleteuser':
if ( ! current_user_can( 'manage_network_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
check_admin_referer( 'deleteuser' );
$id = (int) $_GET['id'];
if ( $id > 1 ) {
$_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays.
// Used in the HTML title tag.
$title = __( 'Users' );
$parent_file = 'users.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
} else {
wp_redirect( network_admin_url( 'users.php' ) );
}
exit;
case 'allusers':
if ( ! current_user_can( 'manage_network_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
if ( isset( $_POST['action'] ) && isset( $_POST['allusers'] ) ) {
check_admin_referer( 'bulk-users-network' );
$doaction = $_POST['action'];
$userfunction = '';
foreach ( (array) $_POST['allusers'] as $user_id ) {
if ( ! empty( $user_id ) ) {
switch ( $doaction ) {
case 'delete':
if ( ! current_user_can( 'delete_users' ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
// Used in the HTML title tag.
$title = __( 'Users' );
$parent_file = 'users.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
echo '<div class="wrap">';
confirm_delete_users( $_POST['allusers'] );
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
case 'spam':
$user = get_userdata( $user_id );
if ( is_super_admin( $user->ID ) ) {
wp_die(
sprintf(
/* translators: %s: User login. */
__( 'Warning! User cannot be modified. The user %s is a network administrator.' ),
esc_html( $user->user_login )
)
);
}
$userfunction = 'all_spam';
$blogs = get_blogs_of_user( $user_id, true );
foreach ( (array) $blogs as $details ) {
if ( ! is_main_site( $details->userblog_id ) ) { // Main site is not a spam!
update_blog_status( $details->userblog_id, 'spam', '1' );
}
}
$user_data = $user->to_array();
$user_data['spam'] = '1';
wp_update_user( $user_data );
break;
case 'notspam':
$user = get_userdata( $user_id );
$userfunction = 'all_notspam';
$blogs = get_blogs_of_user( $user_id, true );
foreach ( (array) $blogs as $details ) {
update_blog_status( $details->userblog_id, 'spam', '0' );
}
$user_data = $user->to_array();
$user_data['spam'] = '0';
wp_update_user( $user_data );
break;
}
}
}
if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) {
$sendback = wp_get_referer();
$user_ids = (array) $_POST['allusers'];
/** This action is documented in wp-admin/network/site-themes.php */
$sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $sendback );
exit;
}
wp_safe_redirect(
add_query_arg(
array(
'updated' => 'true',
'action' => $userfunction,
),
wp_get_referer()
)
);
} else {
$location = network_admin_url( 'users.php' );
if ( ! empty( $_REQUEST['paged'] ) ) {
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
}
wp_redirect( $location );
}
exit;
case 'dodelete':
check_admin_referer( 'ms-users-delete' );
if ( ! ( current_user_can( 'manage_network_users' ) && current_user_can( 'delete_users' ) ) ) {
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
}
if ( ! empty( $_POST['blog'] ) && is_array( $_POST['blog'] ) ) {
foreach ( $_POST['blog'] as $id => $users ) {
foreach ( $users as $blogid => $user_id ) {
if ( ! current_user_can( 'delete_user', $id ) ) {
continue;
}
if ( ! empty( $_POST['delete'] ) && 'reassign' === $_POST['delete'][ $blogid ][ $id ] ) {
remove_user_from_blog( $id, $blogid, (int) $user_id );
} else {
remove_user_from_blog( $id, $blogid );
}
}
}
}
$i = 0;
if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) ) {
foreach ( $_POST['user'] as $id ) {
if ( ! current_user_can( 'delete_user', $id ) ) {
continue;
}
wpmu_delete_user( $id );
++$i;
}
}
if ( 1 === $i ) {
$deletefunction = 'delete';
} else {
$deletefunction = 'all_delete';
}
wp_redirect(
add_query_arg(
array(
'updated' => 'true',
'action' => $deletefunction,
),
network_admin_url( 'users.php' )
)
);
exit;
}
}
$wp_list_table = _get_list_table( 'WP_MS_Users_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
$wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit;
}
// Used in the HTML title tag.
$title = __( 'Users' );
$parent_file = 'users.php';
add_screen_option( 'per_page' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'This table shows all users across the network and the sites to which they are assigned.' ) . '</p>' .
'<p>' . __( 'Hover over any user on the list to make the edit links appear. The Edit link on the left will take you to their Edit User profile page; the Edit link on the right by any site name goes to an Edit Site screen for that site.' ) . '</p>' .
'<p>' . __( 'You can also go to the user’s profile page by clicking on the individual username.' ) . '</p>' .
'<p>' . __( 'You can sort the table by clicking on any of the table headings and switch between list and excerpt views by using the icons above the users list.' ) . '</p>' .
'<p>' . __( 'The bulk action will permanently delete selected users, or mark/unmark those selected as spam. Spam users will have posts removed and will be unable to sign up again with the same email addresses.' ) . '</p>' .
'<p>' . __( 'You can make an existing user an additional super admin by going to the Edit User profile page and checking the box to grant that privilege.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Users_Screen">Documentation on Network Users</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_views' => __( 'Filter users list' ),
'heading_pagination' => __( 'Users list navigation' ),
'heading_list' => __( 'Users list' ),
)
);
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
$message = '';
switch ( $_REQUEST['action'] ) {
case 'delete':
$message = __( 'User deleted.' );
break;
case 'all_spam':
$message = __( 'Users marked as spam.' );
break;
case 'all_notspam':
$message = __( 'Users removed from spam.' );
break;
case 'all_delete':
$message = __( 'Users deleted.' );
break;
case 'add':
$message = __( 'User added.' );
break;
}
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Users' ); ?></h1>
<?php
if ( current_user_can( 'create_users' ) ) :
?>
<a href="<?php echo esc_url( network_admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New User' ); ?></a>
<?php
endif;
if ( strlen( $usersearch ) ) {
echo '<span class="subtitle">';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
'<strong>' . esc_html( $usersearch ) . '</strong>'
);
echo '</span>';
}
?>
<hr class="wp-header-end">
<?php $wp_list_table->views(); ?>
<form method="get" class="search-form">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
</form>
<form id="form-user-list" action="users.php?action=allusers" method="post">
<?php $wp_list_table->display(); ?>
</form>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK Y�Zf�y>