mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-08 17:38:26 +01:00
Fix some hackificator
odds and ends in wp-admin
:
* `wp-activate.php` and `wp-admin/themes.php` don't need the closing PHP tag * Switch single quotes for HTML attribute values to double in a few places * Convert `include_once file.php` syntax to `include_once( 'file.php' )` * Add access modifiers to methods/members in: `_WP_List_Table_Compat`, `Walker_Nav_Menu_Edit`, `Walker_Nav_Menu_Checklist`, `WP_Screen`, `Walker_Category_Checklist` * `edit_user()` doesn't need to import the `$wpdb` global * `wp_list_widgets()` doesn't need to import the `$sidebars_widgets` global * switch/endswitch syntax is not supported in Hack * A `<ul>` in `wp-admin/users.php` is unclosed See #27881. Built from https://develop.svn.wordpress.org/trunk@28500 git-svn-id: http://core.svn.wordpress.org/trunk@28326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
511eabe5f3
commit
2f513d3320
@ -128,4 +128,4 @@ get_header();
|
|||||||
var key_input = document.getElementById('key');
|
var key_input = document.getElementById('key');
|
||||||
key_input && key_input.focus();
|
key_input && key_input.focus();
|
||||||
</script>
|
</script>
|
||||||
<?php get_footer(); ?>
|
<?php get_footer();
|
||||||
|
@ -248,7 +248,7 @@ class WP_Comments_List_Table extends WP_List_Table {
|
|||||||
) );
|
) );
|
||||||
|
|
||||||
foreach ( $comment_types as $type => $label )
|
foreach ( $comment_types as $type => $label )
|
||||||
echo "\t<option value='" . esc_attr( $type ) . "'" . selected( $comment_type, $type, false ) . ">$label</option>\n";
|
echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
<?php
|
<?php
|
||||||
|
@ -24,8 +24,9 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
|||||||
$this->errors = new WP_Error();
|
$this->errors = new WP_Error();
|
||||||
|
|
||||||
// Check if possible to use ftp functions.
|
// Check if possible to use ftp functions.
|
||||||
if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
|
if ( ! @include_once( ABSPATH . 'wp-admin/includes/class-ftp.php' ) ) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
$this->ftp = new ftp();
|
$this->ftp = new ftp();
|
||||||
|
|
||||||
if ( empty($opt['port']) )
|
if ( empty($opt['port']) )
|
||||||
|
@ -421,7 +421,7 @@ class WP_List_Table {
|
|||||||
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
||||||
?>
|
?>
|
||||||
<select name="m">
|
<select name="m">
|
||||||
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
|
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
|
||||||
<?php
|
<?php
|
||||||
foreach ( $months as $arc_row ) {
|
foreach ( $months as $arc_row ) {
|
||||||
if ( 0 == $arc_row->year )
|
if ( 0 == $arc_row->year )
|
||||||
|
@ -227,6 +227,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
|
|||||||
$this->error = $this->upgrader->strings[$error];
|
$this->error = $this->upgrader->strings[$error];
|
||||||
|
|
||||||
if ( is_wp_error($error) ) {
|
if ( is_wp_error($error) ) {
|
||||||
|
$messages = array();
|
||||||
foreach ( $error->get_error_messages() as $emessage ) {
|
foreach ( $error->get_error_messages() as $emessage ) {
|
||||||
if ( $error->get_error_data() && is_string( $error->get_error_data() ) )
|
if ( $error->get_error_data() && is_string( $error->get_error_data() ) )
|
||||||
$messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );
|
$messages[] = $emessage . ' ' . esc_html( strip_tags( $error->get_error_data() ) );
|
||||||
|
@ -441,8 +441,9 @@ function export_wp( $args = array() ) {
|
|||||||
<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
|
<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
|
||||||
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
|
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
|
||||||
</wp:postmeta>
|
</wp:postmeta>
|
||||||
<?php endforeach; ?>
|
<?php endforeach;
|
||||||
<?php $comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
|
|
||||||
|
$comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
|
||||||
foreach ( $comments as $c ) : ?>
|
foreach ( $comments as $c ) : ?>
|
||||||
<wp:comment>
|
<wp:comment>
|
||||||
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
|
<wp:comment_id><?php echo $c->comment_ID; ?></wp:comment_id>
|
||||||
|
@ -84,10 +84,10 @@ function print_column_headers($screen, $id = true) {
|
|||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*/
|
*/
|
||||||
class _WP_List_Table_Compat extends WP_List_Table {
|
class _WP_List_Table_Compat extends WP_List_Table {
|
||||||
var $_screen;
|
public $_screen;
|
||||||
var $_columns;
|
public $_columns;
|
||||||
|
|
||||||
function _WP_List_Table_Compat( $screen, $columns = array() ) {
|
public function _WP_List_Table_Compat( $screen, $columns = array() ) {
|
||||||
if ( is_string( $screen ) )
|
if ( is_string( $screen ) )
|
||||||
$screen = convert_to_screen( $screen );
|
$screen = convert_to_screen( $screen );
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ class _WP_List_Table_Compat extends WP_List_Table {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_column_info() {
|
public function get_column_info() {
|
||||||
$columns = get_column_headers( $this->_screen );
|
$columns = get_column_headers( $this->_screen );
|
||||||
$hidden = get_hidden_columns( $this->_screen );
|
$hidden = get_hidden_columns( $this->_screen );
|
||||||
$sortable = array();
|
$sortable = array();
|
||||||
@ -107,7 +107,7 @@ class _WP_List_Table_Compat extends WP_List_Table {
|
|||||||
return array( $columns, $hidden, $sortable );
|
return array( $columns, $hidden, $sortable );
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_columns() {
|
public function get_columns() {
|
||||||
return $this->_columns;
|
return $this->_columns;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,22 +71,19 @@ unset($menu_page, $compat);
|
|||||||
$_wp_submenu_nopriv = array();
|
$_wp_submenu_nopriv = array();
|
||||||
$_wp_menu_nopriv = array();
|
$_wp_menu_nopriv = array();
|
||||||
// Loop over submenus and remove pages for which the user does not have privs.
|
// Loop over submenus and remove pages for which the user does not have privs.
|
||||||
foreach ( array( 'submenu' ) as $sub_loop ) {
|
foreach ($submenu as $parent => $sub) {
|
||||||
foreach ($$sub_loop as $parent => $sub) {
|
|
||||||
foreach ($sub as $index => $data) {
|
foreach ($sub as $index => $data) {
|
||||||
if ( ! current_user_can($data[1]) ) {
|
if ( ! current_user_can($data[1]) ) {
|
||||||
unset(${$sub_loop}[$parent][$index]);
|
unset($submenu[$parent][$index]);
|
||||||
$_wp_submenu_nopriv[$parent][$data[2]] = true;
|
$_wp_submenu_nopriv[$parent][$data[2]] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($index, $data);
|
unset($index, $data);
|
||||||
|
|
||||||
if ( empty(${$sub_loop}[$parent]) )
|
if ( empty($submenu[$parent]) )
|
||||||
unset(${$sub_loop}[$parent]);
|
unset($submenu[$parent]);
|
||||||
}
|
|
||||||
unset($sub, $parent);
|
|
||||||
}
|
}
|
||||||
unset($sub_loop);
|
unset($sub, $parent);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Loop over the top-level menu.
|
* Loop over the top-level menu.
|
||||||
|
@ -19,7 +19,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||||||
* @param int $depth Depth of menu item. Used for padding.
|
* @param int $depth Depth of menu item. Used for padding.
|
||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
*/
|
*/
|
||||||
function start_lvl( &$output, $depth = 0, $args = array() ) {}
|
public function start_lvl( &$output, $depth = 0, $args = array() ) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ends the list of after the elements are added.
|
* Ends the list of after the elements are added.
|
||||||
@ -32,7 +32,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||||||
* @param int $depth Depth of menu item. Used for padding.
|
* @param int $depth Depth of menu item. Used for padding.
|
||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
*/
|
*/
|
||||||
function end_lvl( &$output, $depth = 0, $args = array() ) {}
|
public function end_lvl( &$output, $depth = 0, $args = array() ) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start the element output.
|
* Start the element output.
|
||||||
@ -46,7 +46,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
* @param int $id Not used.
|
* @param int $id Not used.
|
||||||
*/
|
*/
|
||||||
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
||||||
global $_wp_nav_menu_max_depth;
|
global $_wp_nav_menu_max_depth;
|
||||||
$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
|
$_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
|
|||||||
* @uses Walker_Nav_Menu
|
* @uses Walker_Nav_Menu
|
||||||
*/
|
*/
|
||||||
class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
||||||
function __construct( $fields = false ) {
|
public function __construct( $fields = false ) {
|
||||||
if ( $fields ) {
|
if ( $fields ) {
|
||||||
$this->db_fields = $fields;
|
$this->db_fields = $fields;
|
||||||
}
|
}
|
||||||
@ -252,7 +252,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
|||||||
* @param int $depth Depth of page. Used for padding.
|
* @param int $depth Depth of page. Used for padding.
|
||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
*/
|
*/
|
||||||
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
public function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||||
$indent = str_repeat( "\t", $depth );
|
$indent = str_repeat( "\t", $depth );
|
||||||
$output .= "\n$indent<ul class='children'>\n";
|
$output .= "\n$indent<ul class='children'>\n";
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
|||||||
* @param int $depth Depth of page. Used for padding.
|
* @param int $depth Depth of page. Used for padding.
|
||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
*/
|
*/
|
||||||
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
public function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||||
$indent = str_repeat( "\t", $depth );
|
$indent = str_repeat( "\t", $depth );
|
||||||
$output .= "\n$indent</ul>";
|
$output .= "\n$indent</ul>";
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
|
|||||||
* @param array $args Not used.
|
* @param array $args Not used.
|
||||||
* @param int $id Not used.
|
* @param int $id Not used.
|
||||||
*/
|
*/
|
||||||
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
|
||||||
global $_nav_menu_placeholder;
|
global $_nav_menu_placeholder;
|
||||||
|
|
||||||
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
|
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
|
||||||
|
@ -126,6 +126,7 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
|
|||||||
cache_users( wp_list_pluck( $revisions, 'post_author' ) );
|
cache_users( wp_list_pluck( $revisions, 'post_author' ) );
|
||||||
|
|
||||||
$can_restore = current_user_can( 'edit_post', $post->ID );
|
$can_restore = current_user_can( 'edit_post', $post->ID );
|
||||||
|
$current_id = false;
|
||||||
|
|
||||||
foreach ( $revisions as $revision ) {
|
foreach ( $revisions as $revision ) {
|
||||||
$modified = strtotime( $revision->post_modified );
|
$modified = strtotime( $revision->post_modified );
|
||||||
|
@ -530,7 +530,7 @@ final class WP_Screen {
|
|||||||
* @see set_current_screen()
|
* @see set_current_screen()
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
function set_current_screen() {
|
public function set_current_screen() {
|
||||||
global $current_screen, $taxnow, $typenow;
|
global $current_screen, $taxnow, $typenow;
|
||||||
$current_screen = $this;
|
$current_screen = $this;
|
||||||
$taxnow = $this->taxonomy;
|
$taxnow = $this->taxonomy;
|
||||||
@ -581,7 +581,7 @@ final class WP_Screen {
|
|||||||
* @param WP_Screen $screen A screen object.
|
* @param WP_Screen $screen A screen object.
|
||||||
* @param string $help Help text.
|
* @param string $help Help text.
|
||||||
*/
|
*/
|
||||||
static function add_old_compat_help( $screen, $help ) {
|
public static function add_old_compat_help( $screen, $help ) {
|
||||||
self::$_old_compat_help[ $screen->id ] = $help;
|
self::$_old_compat_help[ $screen->id ] = $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ final class WP_Screen {
|
|||||||
*
|
*
|
||||||
* @param string $parent_file The parent file of the screen. Typically the $parent_file global.
|
* @param string $parent_file The parent file of the screen. Typically the $parent_file global.
|
||||||
*/
|
*/
|
||||||
function set_parentage( $parent_file ) {
|
public function set_parentage( $parent_file ) {
|
||||||
$this->parent_file = $parent_file;
|
$this->parent_file = $parent_file;
|
||||||
list( $this->parent_base ) = explode( '?', $parent_file );
|
list( $this->parent_base ) = explode( '?', $parent_file );
|
||||||
$this->parent_base = str_replace( '.php', '', $this->parent_base );
|
$this->parent_base = str_replace( '.php', '', $this->parent_base );
|
||||||
@ -1089,7 +1089,7 @@ final class WP_Screen {
|
|||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
function render_screen_layout() {
|
public function render_screen_layout() {
|
||||||
if ( ! $this->get_option('layout_columns') )
|
if ( ! $this->get_option('layout_columns') )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1118,7 +1118,7 @@ final class WP_Screen {
|
|||||||
*
|
*
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*/
|
*/
|
||||||
function render_per_page_options() {
|
public function render_per_page_options() {
|
||||||
if ( ! $this->get_option( 'per_page' ) )
|
if ( ! $this->get_option( 'per_page' ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -236,16 +236,18 @@ function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) {
|
|||||||
|
|
||||||
$tags = wp_get_post_terms($post_id, $taxonomy, array());
|
$tags = wp_get_post_terms($post_id, $taxonomy, array());
|
||||||
|
|
||||||
if ( !$tags )
|
if ( !$tags ) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
if ( is_wp_error($tags) )
|
if ( is_wp_error($tags) ) {
|
||||||
return $tags;
|
return $tags;
|
||||||
|
}
|
||||||
foreach ( $tags as $tag )
|
$tag_names = array();
|
||||||
|
foreach ( $tags as $tag ) {
|
||||||
$tag_names[] = $tag->name;
|
$tag_names[] = $tag->name;
|
||||||
$tags_to_edit = join( ',', $tag_names );
|
}
|
||||||
$tags_to_edit = esc_attr( $tags_to_edit );
|
|
||||||
|
$tags_to_edit = esc_attr( join( ',', $tag_names ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the comma-separated list of terms available to edit.
|
* Filter the comma-separated list of terms available to edit.
|
||||||
|
@ -35,7 +35,7 @@ class Walker_Category_Checklist extends Walker {
|
|||||||
* @param int $depth Depth of category. Used for tab indentation.
|
* @param int $depth Depth of category. Used for tab indentation.
|
||||||
* @param array $args An array of arguments. @see wp_terms_checklist()
|
* @param array $args An array of arguments. @see wp_terms_checklist()
|
||||||
*/
|
*/
|
||||||
function start_lvl( &$output, $depth = 0, $args = array() ) {
|
public function start_lvl( &$output, $depth = 0, $args = array() ) {
|
||||||
$indent = str_repeat("\t", $depth);
|
$indent = str_repeat("\t", $depth);
|
||||||
$output .= "$indent<ul class='children'>\n";
|
$output .= "$indent<ul class='children'>\n";
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ class Walker_Category_Checklist extends Walker {
|
|||||||
* @param int $depth Depth of category. Used for tab indentation.
|
* @param int $depth Depth of category. Used for tab indentation.
|
||||||
* @param array $args An array of arguments. @see wp_terms_checklist()
|
* @param array $args An array of arguments. @see wp_terms_checklist()
|
||||||
*/
|
*/
|
||||||
function end_lvl( &$output, $depth = 0, $args = array() ) {
|
public function end_lvl( &$output, $depth = 0, $args = array() ) {
|
||||||
$indent = str_repeat("\t", $depth);
|
$indent = str_repeat("\t", $depth);
|
||||||
$output .= "$indent</ul>\n";
|
$output .= "$indent</ul>\n";
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ class Walker_Category_Checklist extends Walker {
|
|||||||
* @param array $args An array of arguments. @see wp_terms_checklist()
|
* @param array $args An array of arguments. @see wp_terms_checklist()
|
||||||
* @param int $id ID of the current term.
|
* @param int $id ID of the current term.
|
||||||
*/
|
*/
|
||||||
function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
|
public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
|
||||||
if ( empty( $args['taxonomy'] ) ) {
|
if ( empty( $args['taxonomy'] ) ) {
|
||||||
$taxonomy = 'category';
|
$taxonomy = 'category';
|
||||||
} else {
|
} else {
|
||||||
@ -106,7 +106,7 @@ class Walker_Category_Checklist extends Walker {
|
|||||||
* @param int $depth Depth of the term in reference to parents. Default 0.
|
* @param int $depth Depth of the term in reference to parents. Default 0.
|
||||||
* @param array $args An array of arguments. @see wp_terms_checklist()
|
* @param array $args An array of arguments. @see wp_terms_checklist()
|
||||||
*/
|
*/
|
||||||
function end_el( &$output, $category, $depth = 0, $args = array() ) {
|
public function end_el( &$output, $category, $depth = 0, $args = array() ) {
|
||||||
$output .= "</li>\n";
|
$output .= "</li>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ function find_core_auto_update() {
|
|||||||
if ( ! $updates || empty( $updates->updates ) )
|
if ( ! $updates || empty( $updates->updates ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
||||||
|
|
||||||
$auto_update = false;
|
$auto_update = false;
|
||||||
$upgrader = new WP_Automatic_Updater;
|
$upgrader = new WP_Automatic_Updater;
|
||||||
|
@ -28,7 +28,7 @@ function add_user() {
|
|||||||
* @return int user id of the updated user
|
* @return int user id of the updated user
|
||||||
*/
|
*/
|
||||||
function edit_user( $user_id = 0 ) {
|
function edit_user( $user_id = 0 ) {
|
||||||
global $wp_roles, $wpdb;
|
global $wp_roles;
|
||||||
$user = new stdClass;
|
$user = new stdClass;
|
||||||
if ( $user_id ) {
|
if ( $user_id ) {
|
||||||
$update = true;
|
$update = true;
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
function wp_list_widgets() {
|
function wp_list_widgets() {
|
||||||
global $wp_registered_widgets, $sidebars_widgets, $wp_registered_widget_controls;
|
global $wp_registered_widgets, $wp_registered_widget_controls;
|
||||||
|
|
||||||
$sort = $wp_registered_widgets;
|
$sort = $wp_registered_widgets;
|
||||||
usort( $sort, '_sort_name_callback' );
|
usort( $sort, '_sort_name_callback' );
|
||||||
|
@ -14,7 +14,7 @@ $submenu_file = 'upload.php';
|
|||||||
|
|
||||||
wp_reset_vars(array('action'));
|
wp_reset_vars(array('action'));
|
||||||
|
|
||||||
switch( $action ) :
|
switch ( $action ) {
|
||||||
case 'editattachment' :
|
case 'editattachment' :
|
||||||
$attachment_id = (int) $_POST['attachment_id'];
|
$attachment_id = (int) $_POST['attachment_id'];
|
||||||
check_admin_referer('media-form');
|
check_admin_referer('media-form');
|
||||||
@ -143,4 +143,4 @@ default:
|
|||||||
wp_redirect( admin_url('upload.php') );
|
wp_redirect( admin_url('upload.php') );
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
endswitch;
|
}
|
||||||
|
@ -86,7 +86,7 @@ switch ( $action ) {
|
|||||||
}
|
}
|
||||||
echo "</ul>";
|
echo "</ul>";
|
||||||
?><p><?php _e( 'If your browser doesn’t 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>
|
?><p><?php _e( 'If your browser doesn’t 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'>
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
function nextpage() {
|
function nextpage() {
|
||||||
location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
|
location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
|
||||||
|
@ -285,7 +285,7 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
|
|||||||
<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
|
<?php $wp_list_table->search_box( __( 'Search Users' ), 'all-user' ); ?>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form id="form-user-list" action='users.php?action=allusers' method='post'>
|
<form id="form-user-list" action="users.php?action=allusers" method="post">
|
||||||
<?php $wp_list_table->display(); ?>
|
<?php $wp_list_table->display(); ?>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -204,7 +204,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
|||||||
<form name="form" action="options.php" method="post" id="all-options">
|
<form name="form" action="options.php" method="post" id="all-options">
|
||||||
<?php wp_nonce_field('options-options') ?>
|
<?php wp_nonce_field('options-options') ?>
|
||||||
<input type="hidden" name="action" value="update" />
|
<input type="hidden" name="action" value="update" />
|
||||||
<input type='hidden' name='option_page' value='options' />
|
<input type="hidden" name="option_page" value="options" />
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
<?php
|
<?php
|
||||||
$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
|
$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
|
||||||
|
@ -29,7 +29,7 @@ if ( ! $revision_id )
|
|||||||
$revision_id = absint( $to );
|
$revision_id = absint( $to );
|
||||||
$redirect = 'edit.php';
|
$redirect = 'edit.php';
|
||||||
|
|
||||||
switch ( $action ) :
|
switch ( $action ) {
|
||||||
case 'restore' :
|
case 'restore' :
|
||||||
if ( ! $revision = wp_get_post_revision( $revision_id ) )
|
if ( ! $revision = wp_get_post_revision( $revision_id ) )
|
||||||
break;
|
break;
|
||||||
@ -80,7 +80,7 @@ default :
|
|||||||
|
|
||||||
$redirect = false;
|
$redirect = false;
|
||||||
break;
|
break;
|
||||||
endswitch;
|
}
|
||||||
|
|
||||||
// Empty post_type means either malformed object found, or no valid parent was found.
|
// Empty post_type means either malformed object found, or no valid parent was found.
|
||||||
if ( ! $redirect && empty( $post->post_type ) )
|
if ( ! $redirect && empty( $post->post_type ) )
|
||||||
|
@ -121,8 +121,7 @@ default:
|
|||||||
$content = esc_textarea( $content );
|
$content = esc_textarea( $content );
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
if ( isset( $_GET['updated'] ) ) : ?>
|
||||||
<?php if ( isset( $_GET['updated'] ) ) : ?>
|
|
||||||
<div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
|
<div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
|
||||||
<?php endif;
|
<?php endif;
|
||||||
|
|
||||||
|
@ -367,4 +367,4 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_
|
|||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php require( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
|
<?php require( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||||
|
@ -363,7 +363,7 @@ function list_translation_updates() {
|
|||||||
function do_core_upgrade( $reinstall = false ) {
|
function do_core_upgrade( $reinstall = false ) {
|
||||||
global $wp_filesystem;
|
global $wp_filesystem;
|
||||||
|
|
||||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
||||||
|
|
||||||
if ( $reinstall )
|
if ( $reinstall )
|
||||||
$url = 'update-core.php?action=do-core-reinstall';
|
$url = 'update-core.php?action=do-core-reinstall';
|
||||||
@ -582,7 +582,7 @@ if ( 'upgrade-core' == $action ) {
|
|||||||
require_once(ABSPATH . 'wp-admin/admin-header.php');
|
require_once(ABSPATH . 'wp-admin/admin-header.php');
|
||||||
echo '<div class="wrap">';
|
echo '<div class="wrap">';
|
||||||
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
|
echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
|
||||||
echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
|
echo '<iframe src="', $url, '" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0"></iframe>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['action'] ) && in_array( $_GE
|
|||||||
/** WordPress Administration Bootstrap */
|
/** WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
|
||||||
|
|
||||||
if ( isset($_GET['action']) ) {
|
if ( isset($_GET['action']) ) {
|
||||||
$plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
|
$plugin = isset($_REQUEST['plugin']) ? trim($_REQUEST['plugin']) : '';
|
||||||
@ -95,7 +95,7 @@ if ( isset($_GET['action']) ) {
|
|||||||
if ( ! current_user_can('install_plugins') )
|
if ( ! current_user_can('install_plugins') )
|
||||||
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
|
wp_die( __( 'You do not have sufficient permissions to install plugins on this site.' ) );
|
||||||
|
|
||||||
include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; //for plugins_api..
|
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' ); //for plugins_api..
|
||||||
|
|
||||||
check_admin_referer('install-plugin_' . $plugin);
|
check_admin_referer('install-plugin_' . $plugin);
|
||||||
$api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
|
$api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
|
||||||
@ -200,7 +200,7 @@ if ( isset($_GET['action']) ) {
|
|||||||
if ( ! current_user_can('install_themes') )
|
if ( ! current_user_can('install_themes') )
|
||||||
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
|
wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
|
||||||
|
|
||||||
include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api..
|
include_once( ABSPATH . 'wp-admin/includes/theme-install.php' ); //for themes_api..
|
||||||
|
|
||||||
check_admin_referer( 'install-theme_' . $theme );
|
check_admin_referer( 'install-theme_' . $theme );
|
||||||
$api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
|
$api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false, 'tags' => false) ) ); //Save on a bit of bandwidth.
|
||||||
|
@ -334,6 +334,7 @@ case 'remove':
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
</ul>
|
||||||
<?php if ( $go_remove ) : ?>
|
<?php if ( $go_remove ) : ?>
|
||||||
<input type="hidden" name="action" value="doremove" />
|
<input type="hidden" name="action" value="doremove" />
|
||||||
<?php submit_button( __('Confirm Removal'), 'secondary' ); ?>
|
<?php submit_button( __('Confirm Removal'), 'secondary' ); ?>
|
||||||
|
@ -459,8 +459,8 @@ function wp_update_themes( $extra_stats = array() ) {
|
|||||||
* @since 3.7.0
|
* @since 3.7.0
|
||||||
*/
|
*/
|
||||||
function wp_maybe_auto_update() {
|
function wp_maybe_auto_update() {
|
||||||
include_once ABSPATH . '/wp-admin/includes/admin.php';
|
include_once( ABSPATH . '/wp-admin/includes/admin.php' );
|
||||||
include_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';
|
include_once( ABSPATH . '/wp-admin/includes/class-wp-upgrader.php' );
|
||||||
|
|
||||||
$upgrader = new WP_Automatic_Updater;
|
$upgrader = new WP_Automatic_Updater;
|
||||||
$upgrader->run();
|
$upgrader->run();
|
||||||
|
Loading…
Reference in New Issue
Block a user