mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Trailing whitespace cleanup
git-svn-id: http://svn.automattic.com/wordpress/trunk@11013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
79c63cfe7d
commit
a61bc0ec8a
@ -5,8 +5,8 @@
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
if ( defined('ABSPATH') )
|
||||
require_once(ABSPATH . 'wp-load.php');
|
||||
|
@ -232,7 +232,7 @@ class Custom_Image_Header {
|
||||
var ratio = xinit / yinit;
|
||||
var ximg = jQuery('#upload').width();
|
||||
var yimg = jQuery('#upload').height();
|
||||
|
||||
|
||||
//set up default values
|
||||
jQuery( '#x1' ).val(0);
|
||||
jQuery( '#y1' ).val(0);
|
||||
@ -240,7 +240,7 @@ class Custom_Image_Header {
|
||||
jQuery( '#y2' ).val(yinit);
|
||||
jQuery( '#width' ).val(xinit);
|
||||
jQuery( '#height' ).val(yinit);
|
||||
|
||||
|
||||
if ( yimg < yinit || ximg < xinit ) {
|
||||
if ( ximg / yimg > ratio ) {
|
||||
yinit = yimg;
|
||||
|
@ -6,9 +6,9 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
*
|
||||
* Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
|
||||
*/
|
||||
error_reporting(0);
|
||||
|
@ -19,7 +19,7 @@ class WP_Upgrader {
|
||||
var $strings = array();
|
||||
var $skin = null;
|
||||
var $result = array();
|
||||
|
||||
|
||||
function WP_Upgrader(&$skin = null) {
|
||||
return __construct($skin);
|
||||
}
|
||||
@ -30,7 +30,7 @@ class WP_Upgrader {
|
||||
$this->skin = $skin;
|
||||
$this->skin->set_upgrader($this);
|
||||
}
|
||||
|
||||
|
||||
function generic_strings() {
|
||||
$this->strings['bad_request'] = __('Invalid Data provided.');
|
||||
$this->strings['fs_unavailable'] = __('Could not access filesystem.');
|
||||
@ -46,17 +46,17 @@ class WP_Upgrader {
|
||||
$this->strings['folder_exists'] = __('Destination folder already exists.');
|
||||
$this->strings['mkdir_failed'] = __('Could not create directory.');
|
||||
$this->strings['bad_package'] = __('Incompatible Archive');
|
||||
|
||||
|
||||
$this->strings['maintenance_start'] = __('Enabling Maintenance mode.');
|
||||
$this->strings['maintenance_end'] = __('Disabling Maintenance mode.');
|
||||
}
|
||||
|
||||
|
||||
function fs_connect( $directories = array() ) {
|
||||
global $wp_filesystem;
|
||||
|
||||
|
||||
if ( false === ($credentials = $this->skin->request_filesystem_credentials()) )
|
||||
return false;
|
||||
|
||||
|
||||
if ( ! WP_Filesystem($credentials) ) {
|
||||
$error = true;
|
||||
if ( is_object($wp_filesystem) && $wp_filesystem->errors->get_error_code() )
|
||||
@ -67,7 +67,7 @@ class WP_Upgrader {
|
||||
|
||||
if ( ! is_object($wp_filesystem) )
|
||||
return new WP_Error('fs_unavailable', $this->strings['fs_unavailable'] );
|
||||
|
||||
|
||||
if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() )
|
||||
return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors);
|
||||
|
||||
@ -94,23 +94,23 @@ class WP_Upgrader {
|
||||
|
||||
if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote?
|
||||
return $package; //must be a local file..
|
||||
|
||||
|
||||
if ( empty($package) )
|
||||
return new WP_Error('no_package', $this->strings['no_package']);
|
||||
|
||||
$this->skin->feedback('downloading_package', $package);
|
||||
|
||||
$download_file = download_url($package);
|
||||
|
||||
|
||||
if ( is_wp_error($download_file) )
|
||||
return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message());
|
||||
|
||||
|
||||
return $download_file;
|
||||
}
|
||||
|
||||
|
||||
function unpack_package($package, $delete_package = true) {
|
||||
global $wp_filesystem;
|
||||
|
||||
|
||||
$this->skin->feedback('unpack_package');
|
||||
|
||||
$upgrade_folder = $wp_filesystem->wp_content_dir() . 'upgrade/';
|
||||
@ -140,10 +140,10 @@ class WP_Upgrader {
|
||||
$wp_filesystem->delete($working_dir, true);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
return $working_dir;
|
||||
}
|
||||
|
||||
|
||||
function install_package($args = array()) {
|
||||
global $wp_filesystem;
|
||||
$defaults = array( 'source' => '', 'destination' => '', //Please always pass these
|
||||
@ -157,7 +157,7 @@ class WP_Upgrader {
|
||||
|
||||
if ( empty($source) || empty($destination) )
|
||||
return new WP_Error('bad_request', $this->strings['bad_request']);
|
||||
|
||||
|
||||
$this->skin->feedback('installing_package');
|
||||
|
||||
$res = apply_filters('upgrader_pre_install', true, $hook_extra);
|
||||
@ -167,7 +167,7 @@ class WP_Upgrader {
|
||||
//Retain the Original source and destinations
|
||||
$remote_source = $source;
|
||||
$local_destination = $destination;
|
||||
|
||||
|
||||
$source_files = array_keys( $wp_filesystem->dirlist($remote_source) );
|
||||
$remote_destination = $wp_filesystem->find_folder($local_destination);
|
||||
|
||||
@ -177,16 +177,16 @@ class WP_Upgrader {
|
||||
elseif ( count($source_files) == 0 )
|
||||
return new WP_Error('bad_package', $this->strings['bad_package']); //There are no files?
|
||||
//else //Its only a single file, The upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
|
||||
|
||||
|
||||
//Hook ability to change the source file location..
|
||||
$source = apply_filters('upgrader_source_selection', $source, $remote_source, $this);
|
||||
if ( is_wp_error($source) )
|
||||
return $source;
|
||||
|
||||
|
||||
//Has the source location changed? If so, we need a new source_files list.
|
||||
if ( $source !== $remote_source )
|
||||
$source_files = array_keys( $wp_filesystem->dirlist($source) );
|
||||
|
||||
|
||||
//Protection against deleting files in any important base directories.
|
||||
if ( in_array( $destination, array(ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes') ) ) {
|
||||
$remote_destination = trailingslashit($remote_destination) . trailingslashit(basename($source));
|
||||
@ -212,12 +212,12 @@ class WP_Upgrader {
|
||||
else if ( ! $removed )
|
||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||
}
|
||||
|
||||
|
||||
//Create destination if needed
|
||||
if ( !$wp_filesystem->exists($remote_destination) )
|
||||
if ( !$wp_filesystem->mkdir($remote_destination, FS_CHMOD_DIR) )
|
||||
return new WP_Error('mkdir_failed', $this->strings['mkdir_failed'], $remote_destination);
|
||||
|
||||
|
||||
// Copy new version of item into place.
|
||||
$result = copy_dir($source, $remote_destination);
|
||||
if ( is_wp_error($result) ) {
|
||||
@ -225,11 +225,11 @@ class WP_Upgrader {
|
||||
$wp_filesystem->delete($remote_source, true);
|
||||
return $result;
|
||||
}
|
||||
|
||||
//Clear the Working folder?
|
||||
|
||||
//Clear the Working folder?
|
||||
if ( $clear_working )
|
||||
$wp_filesystem->delete($remote_source, true);
|
||||
|
||||
|
||||
$destination_name = basename( str_replace($local_destination, '', $destination) );
|
||||
if ( '.' == $destination_name )
|
||||
$destination_name = '';
|
||||
@ -245,7 +245,7 @@ class WP_Upgrader {
|
||||
//Bombard the calling function will all the info which we've just used.
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
|
||||
function run($options) {
|
||||
|
||||
$defaults = array( 'package' => '', //Please always pass this.
|
||||
@ -277,7 +277,7 @@ class WP_Upgrader {
|
||||
$this->skin->error($download);
|
||||
return $download;
|
||||
}
|
||||
|
||||
|
||||
//Unzip's the file into a temporary directory
|
||||
$working_dir = $this->unpack_package( $download );
|
||||
if ( is_wp_error($working_dir) ) {
|
||||
@ -286,7 +286,7 @@ class WP_Upgrader {
|
||||
}
|
||||
|
||||
//With the given options, this installs it to the destination directory.
|
||||
$result = $this->install_package( array(
|
||||
$result = $this->install_package( array(
|
||||
'source' => $working_dir,
|
||||
'destination' => $destination,
|
||||
'clear_destination' => $clear_destination,
|
||||
@ -305,7 +305,7 @@ class WP_Upgrader {
|
||||
$this->skin->footer();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function maintenance_mode($enable = false) {
|
||||
global $wp_filesystem;
|
||||
$file = $wp_filesystem->abspath() . '.maintenance';
|
||||
@ -320,13 +320,13 @@ class WP_Upgrader {
|
||||
$wp_filesystem->delete($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
var $result;
|
||||
|
||||
|
||||
function upgrade_strings() {
|
||||
$this->generic_strings();
|
||||
$this->strings['up_to_date'] = __('The plugin is at the latest version.');
|
||||
@ -351,7 +351,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
function install($package) {
|
||||
|
||||
|
||||
$this->install_strings();
|
||||
|
||||
$this->run(array(
|
||||
@ -361,16 +361,16 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
'clear_working' => true,
|
||||
'hook_extra' => array()
|
||||
));
|
||||
|
||||
|
||||
// Force refresh of plugin update information
|
||||
delete_transient('update_plugins');
|
||||
|
||||
}
|
||||
|
||||
function upgrade($plugin) {
|
||||
|
||||
|
||||
$this->upgrade_strings();
|
||||
|
||||
|
||||
$current = get_transient( 'update_plugins' );
|
||||
if ( !isset( $current->response[ $plugin ] ) ) {
|
||||
$this->skin->error('up_to_date');
|
||||
@ -380,7 +380,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
// Get the URL to the zip file
|
||||
$r = $current->response[ $plugin ];
|
||||
|
||||
|
||||
add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2);
|
||||
add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4);
|
||||
//'source_selection' => array(&$this, 'source_selection'), //theres a track ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.
|
||||
@ -405,13 +405,13 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
// Force refresh of plugin update information
|
||||
delete_transient('update_plugins');
|
||||
}
|
||||
|
||||
|
||||
//return plugin info.
|
||||
function plugin_info() {
|
||||
if ( ! is_array($this->result) )
|
||||
return false;
|
||||
if ( empty($this->result['destination_name']) )
|
||||
return false;
|
||||
return false;
|
||||
|
||||
$plugin = get_plugins('/' . $this->result['destination_name']); //Ensure to pass with leading slash
|
||||
if ( empty($plugin) )
|
||||
@ -419,7 +419,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
$pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list
|
||||
|
||||
return $this->result['destination_name'] . '/' . $pluginfiles[0];
|
||||
return $this->result['destination_name'] . '/' . $pluginfiles[0];
|
||||
}
|
||||
|
||||
//Hooked to pre_install
|
||||
@ -436,26 +436,26 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
$this->skin->feedback('deactivate_plugin');
|
||||
//Deactivate the plugin silently, Prevent deactivation hooks from running.
|
||||
deactivate_plugins($plugin, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Hooked to upgrade_clear_destination
|
||||
function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) {
|
||||
global $wp_filesystem;
|
||||
|
||||
|
||||
if ( is_wp_error($removed) )
|
||||
return $removed; //Pass errors through.
|
||||
|
||||
|
||||
$plugin = isset($plugin['plugin']) ? $plugin['plugin'] : '';
|
||||
if ( empty($plugin) )
|
||||
return new WP_Error('bad_request', $this->strings['bad_request']);
|
||||
|
||||
$plugins_dir = $wp_filesystem->wp_plugins_dir();
|
||||
$this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
|
||||
|
||||
|
||||
if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If its already vanished.
|
||||
return $removed;
|
||||
|
||||
|
||||
// If plugin is in its own directory, recursively delete the directory.
|
||||
if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder
|
||||
$deleted = $wp_filesystem->delete($this_plugin_dir, true);
|
||||
@ -464,7 +464,7 @@ class Plugin_Upgrader extends WP_Upgrader {
|
||||
|
||||
if ( ! $deleted )
|
||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||
|
||||
|
||||
return $removed;
|
||||
}
|
||||
}
|
||||
@ -497,7 +497,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
}
|
||||
|
||||
function install($package) {
|
||||
|
||||
|
||||
$this->install_strings();
|
||||
|
||||
$options = array(
|
||||
@ -506,30 +506,30 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
'clear_destination' => false, //Do not overwrite files.
|
||||
'clear_working' => true
|
||||
);
|
||||
|
||||
|
||||
$this->run($options);
|
||||
|
||||
|
||||
if ( ! $this->result || is_wp_error($this->result) )
|
||||
return $this->result;
|
||||
|
||||
|
||||
// Force refresh of theme update information
|
||||
delete_transient('update_themes');
|
||||
|
||||
|
||||
if ( empty($result['destination_name']) )
|
||||
return false;
|
||||
return false;
|
||||
else
|
||||
return $result['destination_name'];
|
||||
}
|
||||
|
||||
function upgrade($theme) {
|
||||
|
||||
|
||||
$this->upgrade_strings();
|
||||
|
||||
|
||||
// Is an update available?
|
||||
$current = get_transient( 'update_themes' );
|
||||
if ( !isset( $current->response[ $theme ] ) )
|
||||
return new WP_Error('up_to_date', $this->strings['up_to_date']);
|
||||
|
||||
|
||||
$r = $current->response[ $theme ];
|
||||
|
||||
add_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
|
||||
@ -545,7 +545,7 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
'theme' => $theme
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->run($options);
|
||||
|
||||
if ( ! $this->result || is_wp_error($this->result) )
|
||||
@ -556,9 +556,9 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function current_before($return, $theme) {
|
||||
|
||||
|
||||
if ( is_wp_error($return) )
|
||||
return $return;
|
||||
|
||||
@ -592,22 +592,22 @@ class Theme_Upgrader extends WP_Upgrader {
|
||||
$this->maintenance_mode(false);
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
function delete_old_theme($removed, $local_destination, $remote_destination, $theme) {
|
||||
global $wp_filesystem;
|
||||
|
||||
|
||||
$theme = isset($theme['theme']) ? $theme['theme'] : '';
|
||||
|
||||
|
||||
if ( is_wp_error($removed) || empty($theme) )
|
||||
return $removed; //Pass errors through.
|
||||
|
||||
|
||||
$themes_dir = $wp_filesystem->wp_themes_dir();
|
||||
if ( $wp_filesystem->exists( trailingslashit($themes_dir) . $theme ) )
|
||||
if ( ! $wp_filesystem->delete( trailingslashit($themes_dir) . $theme, true ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function theme_info() {
|
||||
if ( empty($this->result['destination_name']) )
|
||||
return false;
|
||||
@ -631,11 +631,11 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
function upgrade($current) {
|
||||
global $wp_filesystem;
|
||||
$this->upgrade_strings();
|
||||
|
||||
|
||||
|
||||
|
||||
if ( !empty($feedback) )
|
||||
add_filter('update_feedback', $feedback);
|
||||
|
||||
|
||||
// Is an update available?
|
||||
if ( !isset( $current->response ) || $current->response == 'latest' )
|
||||
return new WP_Error('up_to_date', $this->strings['up_to_date']);
|
||||
@ -643,13 +643,13 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
$res = $this->fs_connect( array(ABSPATH, WP_CONTENT_DIR) );
|
||||
if ( is_wp_error($res) )
|
||||
return $res;
|
||||
|
||||
|
||||
$wp_dir = trailingslashit($wp_filesystem->abspath());
|
||||
|
||||
|
||||
$download = $this->download_package( $current->package );
|
||||
if ( is_wp_error($download) )
|
||||
return $download;
|
||||
|
||||
|
||||
$working_dir = $this->unpack_package( $download );
|
||||
if ( is_wp_error($working_dir) )
|
||||
return $working_dir;
|
||||
@ -660,9 +660,9 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
return new WP_Error('copy_failed', $this->strings['copy_failed']);
|
||||
}
|
||||
$wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE);
|
||||
|
||||
|
||||
require(ABSPATH . 'wp-admin/includes/update-core.php');
|
||||
|
||||
|
||||
return update_core($working_dir, $wp_dir);
|
||||
}
|
||||
|
||||
@ -677,10 +677,10 @@ class Core_Upgrader extends WP_Upgrader {
|
||||
*/
|
||||
|
||||
class WP_Upgrader_Skin {
|
||||
|
||||
|
||||
var $upgrader;
|
||||
var $done_header = false;
|
||||
|
||||
|
||||
function WP_Upgrader_Skin($args = array()) {
|
||||
return __construct($args);
|
||||
}
|
||||
@ -688,7 +688,7 @@ class WP_Upgrader_Skin {
|
||||
$defaults = array( 'url' => '', 'nonce' => '', 'title' => '' );
|
||||
$this->options = wp_parse_args($args, $defaults);
|
||||
}
|
||||
|
||||
|
||||
function set_upgrader(&$upgrader) {
|
||||
if ( is_object($upgrader) )
|
||||
$this->upgrader =& $upgrader;
|
||||
@ -696,26 +696,26 @@ class WP_Upgrader_Skin {
|
||||
function set_result($result) {
|
||||
$this->result = $result;
|
||||
}
|
||||
|
||||
|
||||
function request_filesystem_credentials($error = false) {
|
||||
$url = $this->options['url'];
|
||||
if ( !empty($this->options['nonce']) )
|
||||
$url = wp_nonce_url($url, $this->options['nonce']);
|
||||
return request_filesystem_credentials($url, '', $error); //Possible to bring inline, Leaving as0is for now.
|
||||
}
|
||||
|
||||
|
||||
function header() {
|
||||
if ( $this->done_header )
|
||||
return;
|
||||
$this->done_header = true;
|
||||
echo '<div class="wrap">';
|
||||
echo screen_icon();
|
||||
echo '<h2>' . $this->options['title'] . '</h2>';
|
||||
echo '<h2>' . $this->options['title'] . '</h2>';
|
||||
}
|
||||
function footer() {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
|
||||
function error($errors) {
|
||||
if ( ! $this->done_header )
|
||||
$this->header();
|
||||
@ -738,10 +738,10 @@ class WP_Upgrader_Skin {
|
||||
if ( empty($string) )
|
||||
return;
|
||||
show_message($string);
|
||||
}
|
||||
}
|
||||
function before() {}
|
||||
function after() {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
@ -759,10 +759,10 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
$this->plugin = $args['plugin'];
|
||||
|
||||
$this->plugin_active = is_plugin_active($this->plugin);
|
||||
|
||||
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
|
||||
function after() {
|
||||
$this->plugin = $this->upgrader->plugin_info();
|
||||
if( !empty($this->plugin) && !is_wp_error($this->result) && $this->plugin_active ){
|
||||
@ -796,10 +796,10 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
||||
$this->type = $args['type'];
|
||||
$this->api = isset($args['api']) ? $args['api'] : array();
|
||||
|
||||
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
@ -807,7 +807,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
||||
if ( !empty($this->api) )
|
||||
$this->upgrader->strings['process_success'] = sprintf( __('Successfully installed the plugin <strong>%s %s</strong>.'), $this->api->name, $this->api->version);
|
||||
}
|
||||
|
||||
|
||||
function after() {
|
||||
|
||||
$plugin_file = $this->upgrader->plugin_info();
|
||||
@ -842,10 +842,10 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
function __construct($args = array()) {
|
||||
$defaults = array( 'type' => 'web', 'url' => '', 'theme' => '', 'nonce' => '', 'title' => '' );
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
|
||||
$this->type = $args['type'];
|
||||
$this->api = isset($args['api']) ? $args['api'] : array();
|
||||
|
||||
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
@ -853,7 +853,7 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
if ( !empty($this->api) )
|
||||
$this->upgrader->strings['process_success'] = sprintf( __('Successfully installed the theme <strong>%s %s</strong>.'), $this->api->name, $this->api->version);
|
||||
}
|
||||
|
||||
|
||||
function after() {
|
||||
if ( empty($this->upgrader->result['destination_name']) )
|
||||
return;
|
||||
@ -864,10 +864,10 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
|
||||
$name = $theme_info['Name'];
|
||||
$stylesheet = $this->upgrader->result['destination_name'];
|
||||
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
|
||||
|
||||
|
||||
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(clean_url(get_option('home'))) ) );
|
||||
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
|
||||
|
||||
|
||||
$install_actions = array(
|
||||
'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>',
|
||||
'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . attribute_escape( sprintf( __('Activate "%s"'), $name ) ) . '">' . __('Activate') . '</a>'
|
||||
@ -899,10 +899,10 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
$args = wp_parse_args($args, $defaults);
|
||||
|
||||
$this->theme = $args['theme'];
|
||||
|
||||
|
||||
parent::__construct($args);
|
||||
}
|
||||
|
||||
|
||||
function after() {
|
||||
|
||||
if ( empty($this->upgrader->result['destination_name']) )
|
||||
@ -914,7 +914,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
$name = $theme_info['Name'];
|
||||
$stylesheet = $this->upgrader->result['destination_name'];
|
||||
$template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
|
||||
|
||||
|
||||
$preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(clean_url(get_option('home'))) ) );
|
||||
$activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
|
||||
|
||||
@ -925,7 +925,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||
);
|
||||
if ( ( ! $this->result || is_wp_error($this->result) ) || $stylesheet == get_stylesheet() )
|
||||
unset($update_actions['preview'], $update_actions['activate']);
|
||||
|
||||
|
||||
$update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme);
|
||||
if ( ! empty($update_actions) )
|
||||
$this->feedback('<strong>' . __('Actions:') . '</strong> ' . implode(' | ', (array)$update_actions));
|
||||
@ -942,10 +942,10 @@ class File_Upload_Upgrader {
|
||||
function __construct($form, $urlholder) {
|
||||
if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) )
|
||||
wp_die($uploads['error']);
|
||||
|
||||
|
||||
if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) )
|
||||
wp_die(__('Please select a file'));
|
||||
|
||||
|
||||
if ( !empty($_FILES) )
|
||||
$this->filename = $_FILES[$form]['name'];
|
||||
else if ( isset($_GET[$urlholder]) )
|
||||
@ -955,7 +955,7 @@ class File_Upload_Upgrader {
|
||||
if ( !empty($_FILES) ) {
|
||||
$this->filename = wp_unique_filename( $uploads['basedir'], $this->filename );
|
||||
$this->package = $uploads['basedir'] . '/' . $this->filename;
|
||||
|
||||
|
||||
// Move the file to the uploads dir
|
||||
if ( false === @ move_uploaded_file( $_FILES[$form]['tmp_name'], $this->package) )
|
||||
wp_die( sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path']));
|
||||
|
@ -1565,8 +1565,8 @@ jQuery(function($){
|
||||
<a href="#" id="hideall" class="toggle" style="display:none;"><?php _e('Hide'); ?></a>
|
||||
</span>
|
||||
<?php _e('Sort Order:'); ?>
|
||||
<a href="#" id="asc"><?php _e('Ascending'); ?></a> |
|
||||
<a href="#" id="desc"><?php _e('Descending'); ?></a> |
|
||||
<a href="#" id="asc"><?php _e('Ascending'); ?></a> |
|
||||
<a href="#" id="desc"><?php _e('Descending'); ?></a> |
|
||||
<a href="#" id="clear"><?php _e('Clear'); ?></a>
|
||||
</div>
|
||||
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
|
||||
|
@ -201,7 +201,7 @@ add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
|
||||
/**
|
||||
* Upload from zip
|
||||
* @since 2.8.0
|
||||
*
|
||||
*
|
||||
* @param string $page
|
||||
*/
|
||||
function install_plugins_upload( $page = 1 ) {
|
||||
|
@ -1569,13 +1569,13 @@ function display_page_row( $page, $level = 0 ) {
|
||||
$find_main_page = (int)$page->post_parent;
|
||||
while ( $find_main_page > 0 ) {
|
||||
$parent = get_page($find_main_page);
|
||||
|
||||
|
||||
if ( is_null($parent) )
|
||||
break;
|
||||
|
||||
|
||||
$level++;
|
||||
$find_main_page = (int)$parent->post_parent;
|
||||
|
||||
|
||||
if ( !isset($parent_name) )
|
||||
$parent_name = $parent->post_title;
|
||||
}
|
||||
|
@ -403,10 +403,10 @@ function display_themes($themes, $page = 1, $totalpages = 1) {
|
||||
<?php
|
||||
$rows = ceil(count($themes) / 3);
|
||||
$table = array();
|
||||
$theme_keys = array_keys($themes);
|
||||
for ( $row = 1; $row <= $rows; $row++ )
|
||||
for ( $col = 1; $col <= 3; $col++ )
|
||||
$table[$row][$col] = array_shift($theme_keys);
|
||||
$theme_keys = array_keys($themes);
|
||||
for ( $row = 1; $row <= $rows; $row++ )
|
||||
for ( $col = 1; $col <= 3; $col++ )
|
||||
$table[$row][$col] = array_shift($theme_keys);
|
||||
|
||||
foreach ( $table as $row => $cols ) {
|
||||
?>
|
||||
@ -421,8 +421,8 @@ function display_themes($themes, $page = 1, $totalpages = 1) {
|
||||
if ( $col == 3 ) $class[] = 'right';
|
||||
?>
|
||||
<td class="<?php echo join(' ', $class); ?>"><?php
|
||||
if ( isset($themes[$theme_index]) )
|
||||
display_theme($themes[$theme_index]);
|
||||
if ( isset($themes[$theme_index]) )
|
||||
display_theme($themes[$theme_index]);
|
||||
?></td>
|
||||
<?php } // end foreach $cols ?>
|
||||
</tr>
|
||||
|
@ -177,7 +177,7 @@ function wp_update_plugin($plugin, $feedback = '') {
|
||||
}
|
||||
|
||||
function wp_update_theme($theme, $feedback = '') {
|
||||
|
||||
|
||||
if ( !empty($feedback) )
|
||||
add_filter('update_feedback', $feedback);
|
||||
|
||||
@ -188,7 +188,7 @@ function wp_update_theme($theme, $feedback = '') {
|
||||
|
||||
|
||||
function wp_update_core($current, $feedback = '') {
|
||||
|
||||
|
||||
if ( !empty($feedback) )
|
||||
add_filter('update_feedback', $feedback);
|
||||
|
||||
|
@ -412,7 +412,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
global $wpdb;
|
||||
|
||||
$id = (int) $id;
|
||||
$user = new WP_User($id);
|
||||
$user = new WP_User($id);
|
||||
|
||||
// allow for transaction statement
|
||||
do_action('delete_user', $id);
|
||||
@ -448,7 +448,7 @@ function wp_delete_user($id, $reassign = 'novalue') {
|
||||
wp_cache_delete($user->user_login, 'userlogins');
|
||||
wp_cache_delete($user->user_email, 'useremail');
|
||||
wp_cache_delete($user->user_nicename, 'userslugs');
|
||||
|
||||
|
||||
// allow for commit transaction
|
||||
do_action('deleted_user', $id);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
*
|
||||
* Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
|
||||
*/
|
||||
error_reporting(0);
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
*
|
||||
* Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
|
||||
*/
|
||||
error_reporting(0);
|
||||
|
@ -463,7 +463,7 @@ print_plugin_actions($status);
|
||||
<?php
|
||||
if ( $total_this_page > $plugins_per_page )
|
||||
$plugins = array_slice($plugins, $start, $plugins_per_page);
|
||||
|
||||
|
||||
print_plugins_table($plugins, $status);
|
||||
?>
|
||||
<div class="tablenav">
|
||||
|
@ -58,7 +58,7 @@ function press_it() {
|
||||
if( strpos($_REQUEST['content'], $image) !== false ) {
|
||||
$desc = isset($_REQUEST['photo_description'][$key]) ? $_REQUEST['photo_description'][$key] : '';
|
||||
$upload = media_sideload_image($image, $post_ID, $desc);
|
||||
|
||||
|
||||
// Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
|
||||
if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
|
||||
}
|
||||
@ -450,7 +450,7 @@ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
|
||||
|
||||
<!-- This div holds the photo metadata -->
|
||||
<div class="photolist"></div>
|
||||
|
||||
|
||||
<div id="submitdiv" class="stuffbox">
|
||||
<h3><?php _e('Publish') ?></h3>
|
||||
<div class="inside">
|
||||
@ -465,7 +465,7 @@ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="categorydiv" class="stuffbox">
|
||||
<h3><?php _e('Categories') ?></h3>
|
||||
<div class="inside">
|
||||
@ -524,7 +524,7 @@ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
|
||||
|
||||
<div class="postdivrich">
|
||||
<ul id="actions">
|
||||
|
||||
|
||||
<li id="photo_button">
|
||||
Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
|
||||
<img alt="<?php _e('Insert an Image'); ?>" src="images/media-button-image.gif"/></a>
|
||||
|
@ -34,7 +34,7 @@ if ( isset($_GET['action']) ) {
|
||||
$upgrader->upgrade($plugin);
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
|
||||
} elseif ('activate-plugin' == $action ) {
|
||||
if ( ! current_user_can('update_plugins') )
|
||||
wp_die(__('You do not have sufficient permissions to update plugins for this blog.'));
|
||||
@ -63,18 +63,18 @@ if ( isset($_GET['action']) ) {
|
||||
wp_die(__('You do not have sufficient permissions to install plugins for this blog.'));
|
||||
|
||||
include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; //for plugins_api..
|
||||
|
||||
|
||||
check_admin_referer('install-plugin_' . $plugin);
|
||||
$api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
|
||||
|
||||
|
||||
if ( is_wp_error($api) )
|
||||
wp_die($api);
|
||||
|
||||
|
||||
$title = __('Plugin Install');
|
||||
$parent_file = 'plugins.php';
|
||||
$submenu_file = 'plugin-install.php';
|
||||
require_once('admin-header.php');
|
||||
|
||||
|
||||
$title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version );
|
||||
$nonce = 'install-plugin_' . $plugin;
|
||||
$url = 'update.php?action=install-plugin&plugin=' . $plugin;
|
||||
@ -82,7 +82,7 @@ if ( isset($_GET['action']) ) {
|
||||
|
||||
$upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
||||
$upgrader->install($api->download_link);
|
||||
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
} elseif ( 'upload-plugin' == $action ) {
|
||||
@ -98,7 +98,7 @@ if ( isset($_GET['action']) ) {
|
||||
$parent_file = 'plugins.php';
|
||||
$submenu_file = 'plugin-install.php';
|
||||
require_once('admin-header.php');
|
||||
|
||||
|
||||
$title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) );
|
||||
$nonce = 'plugin-upload';
|
||||
$url = add_query_arg(array('package' => $file_upload->filename ), 'update.php?action=upload-plugin');
|
||||
@ -130,14 +130,14 @@ if ( isset($_GET['action']) ) {
|
||||
$upgrader->upgrade($theme);
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
|
||||
} elseif ( 'install-theme' == $action ) {
|
||||
|
||||
if ( ! current_user_can('install_themes') )
|
||||
wp_die(__('You do not have sufficient permissions to install themes for this blog.'));
|
||||
|
||||
include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api..
|
||||
|
||||
|
||||
check_admin_referer('install-theme_' . $theme);
|
||||
$api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth.
|
||||
|
||||
@ -150,17 +150,17 @@ if ( isset($_GET['action']) ) {
|
||||
$parent_file = 'themes.php';
|
||||
$submenu_file = 'theme-install.php';
|
||||
require_once('admin-header.php');
|
||||
|
||||
|
||||
$title = sprintf( __('Installing theme: %s'), $api->name . ' ' . $api->version );
|
||||
$nonce = 'install-theme_' . $theme;
|
||||
$url = 'update.php?action=install-theme&theme=' . $theme;
|
||||
$type = 'web'; //Install theme type, From Web or an Upload.
|
||||
|
||||
|
||||
$upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) );
|
||||
$upgrader->install($api->download_link);
|
||||
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
|
||||
} elseif ( 'upload-theme' == $action ) {
|
||||
|
||||
if ( ! current_user_can('install_themes') )
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
</li>
|
||||
<?php }?>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul role="navigation">
|
||||
<?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
|
||||
|
||||
|
@ -1184,8 +1184,8 @@ class Walker_Page extends Walker {
|
||||
} elseif ( $page->ID == get_option('page_for_posts') ) {
|
||||
$css_class[] = 'current_page_parent';
|
||||
}
|
||||
|
||||
$css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
|
||||
|
||||
$css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));
|
||||
|
||||
$output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">' . $link_before . apply_filters('the_title', $page->post_title) . $link_after . '</a>';
|
||||
|
||||
|
@ -908,12 +908,12 @@ function comments_popup_script($width=400, $height=400, $file='') {
|
||||
*/
|
||||
function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
|
||||
global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
|
||||
|
||||
|
||||
if ( false === $zero ) $zero = __( 'No Comments' );
|
||||
if ( false === $one ) $one = __( '1 Comment' );
|
||||
if ( false === $more ) $more = __( '% Comments' );
|
||||
if ( false === $none ) $none = __( 'Comments Off' );
|
||||
|
||||
|
||||
$number = get_comments_number( $id );
|
||||
|
||||
if ( 0 == $number && !comments_open() && !pings_open() ) {
|
||||
@ -1115,7 +1115,7 @@ function comment_id_fields() {
|
||||
*/
|
||||
function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) {
|
||||
global $comment;
|
||||
|
||||
|
||||
if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' );
|
||||
if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' );
|
||||
|
||||
|
@ -40,7 +40,7 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
|
||||
<link rel="self" type="application/atom+xml" href="<?php bloginfo_rss('comments_atom_url'); ?>" />
|
||||
<id><?php bloginfo_rss('comments_atom_url'); ?></id>
|
||||
<?php } ?>
|
||||
<?php do_action('comments_atom_head'); ?>
|
||||
<?php do_action('comments_atom_head'); ?>
|
||||
<?php
|
||||
if ( have_comments() ) : while ( have_comments() ) : the_comment();
|
||||
$comment_post = get_post($comment->comment_post_ID);
|
||||
|
@ -46,7 +46,7 @@ function wptexturize($text) {
|
||||
|
||||
$static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney);
|
||||
$static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace);
|
||||
|
||||
|
||||
$dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');
|
||||
$dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2');
|
||||
|
||||
|
@ -96,11 +96,11 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
|
||||
// specially computed timestamp
|
||||
$gmt = true;
|
||||
}
|
||||
|
||||
|
||||
// store original value for language with untypical grammars
|
||||
// see http://core.trac.wordpress.org/ticket/9396
|
||||
$req_format = $dateformatstring;
|
||||
|
||||
|
||||
$datefunc = $gmt? 'gmdate' : 'date';
|
||||
|
||||
if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
|
||||
@ -1683,7 +1683,7 @@ function is_blog_installed() {
|
||||
// If siteurl is not set to autoload, check it specifically
|
||||
if ( !isset( $alloptions['siteurl'] ) )
|
||||
$installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" );
|
||||
else
|
||||
else
|
||||
$installed = $alloptions['siteurl'];
|
||||
$wpdb->suppress_errors( $suppress );
|
||||
|
||||
|
@ -934,7 +934,7 @@ function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $ex
|
||||
$post->post_title = $previous ? __('Previous Post') : __('Next Post');
|
||||
|
||||
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||
|
||||
|
||||
$title = str_replace('%title', $post->post_title, $title);
|
||||
$title = str_replace('%date', $date, $title);
|
||||
$title = apply_filters('the_title', $title, $post);
|
||||
@ -1050,8 +1050,8 @@ function get_boundary_post($in_same_cat = false, $excluded_categories = '', $sta
|
||||
*/
|
||||
function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) {
|
||||
$posts = get_boundary_post($in_same_cat,$excluded_categories,$start);
|
||||
// Even though we limited get_posts to return only 1 item it still returns an array of objects.
|
||||
$post = $posts[0];
|
||||
// Even though we limited get_posts to return only 1 item it still returns an array of objects.
|
||||
$post = $posts[0];
|
||||
|
||||
if ( empty($post) )
|
||||
return;
|
||||
@ -1104,7 +1104,7 @@ function get_index_rel_link() {
|
||||
* @since 2.8.0
|
||||
*/
|
||||
function index_rel_link() {
|
||||
echo get_index_rel_link();
|
||||
echo get_index_rel_link();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -414,7 +414,7 @@ function get_body_class( $class = '' ) {
|
||||
}
|
||||
} elseif ( is_page() ) {
|
||||
$classes[] = 'page';
|
||||
|
||||
|
||||
$wp_query->post = $wp_query->posts[0];
|
||||
setup_postdata($wp_query->post);
|
||||
|
||||
|
@ -2006,7 +2006,7 @@ class WP_Query {
|
||||
$q['author'] = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE user_nicename='".$q['author_name']."'");
|
||||
$q['author'] = get_user_by('slug', $q['author_name']);
|
||||
if ( $q['author'] )
|
||||
$q['author'] = $q['author']->ID;
|
||||
$q['author'] = $q['author']->ID;
|
||||
$whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')';
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ function wp_insert_user($userdata) {
|
||||
}
|
||||
$user_nicename = $alt_user_nicename;
|
||||
}
|
||||
|
||||
|
||||
$data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' );
|
||||
$data = stripslashes_deep( $data );
|
||||
|
||||
|
@ -168,7 +168,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add_data( 'thickbox', 'group', 1 );
|
||||
|
||||
$scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.5-1');
|
||||
|
||||
|
||||
if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) {
|
||||
$scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.2.0-20081031');
|
||||
$scripts->add( 'swfupload-swfobject', '/wp-includes/js/swfupload/plugins/swfupload.swfobject.js', array('swfupload'), '2.2.0-20081031');
|
||||
|
@ -23,7 +23,7 @@ function create_initial_taxonomies() {
|
||||
$wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'));
|
||||
$wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'));
|
||||
$wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false);
|
||||
|
||||
|
||||
}
|
||||
add_action( 'init', 'create_initial_taxonomies' );
|
||||
|
||||
@ -1078,7 +1078,7 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
|
||||
*
|
||||
* The $args 'default' will only override the terms found, if there is only one
|
||||
* term found. Any other and the found terms are used.
|
||||
*
|
||||
*
|
||||
* The $args 'force_default' will force the term supplied as default to be
|
||||
* assigned even if the object was not going to be termless
|
||||
* @package WordPress
|
||||
@ -1413,7 +1413,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
|
||||
* @uses $wpdb
|
||||
*
|
||||
* @param int $object_id The object to relate to.
|
||||
* @param array|int|string $term The slug or id of the term, will replace all existing
|
||||
* @param array|int|string $term The slug or id of the term, will replace all existing
|
||||
* related terms in this taxonomy.
|
||||
* @param array|string $taxonomy The context in which to relate the term to the object.
|
||||
* @param bool $append If false will delete difference of terms.
|
||||
|
@ -186,12 +186,12 @@ function get_theme_data( $theme_file ) {
|
||||
|
||||
if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) )
|
||||
$theme_uri = clean_url( trim( $theme_uri[1] ) );
|
||||
else
|
||||
else
|
||||
$theme_uri = '';
|
||||
|
||||
|
||||
if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) )
|
||||
$description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) );
|
||||
else
|
||||
else
|
||||
$description = '';
|
||||
|
||||
if ( preg_match( '|Author URI:(.*)$|mi', $theme_data, $author_uri ) )
|
||||
@ -374,7 +374,7 @@ function get_themes() {
|
||||
}
|
||||
@ $stylesheet_dir->close();
|
||||
}
|
||||
|
||||
|
||||
$template_dir = @ dir("$theme_root/$template");
|
||||
if ( $template_dir ) {
|
||||
while ( ($file = $template_dir->read()) !== false ) {
|
||||
@ -393,7 +393,7 @@ function get_themes() {
|
||||
@ $template_subdir->close();
|
||||
}
|
||||
}
|
||||
@ $template_dir->close();
|
||||
@ $template_dir->close();
|
||||
}
|
||||
|
||||
$template_dir = dirname($template_files[0]);
|
||||
@ -1150,7 +1150,7 @@ function theme_basename($file) {
|
||||
$file = preg_replace('|/+|','/', $file); // remove any duplicate slash
|
||||
$theme_dir = str_replace('\\','/', get_theme_root()); // sanitize for Win32 installs
|
||||
$theme_dir = preg_replace('|/+|','/', $theme_dir); // remove any duplicate slash
|
||||
$file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir
|
||||
$file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir
|
||||
return $file;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class WP_Widget {
|
||||
// Member functions that you must over-ride.
|
||||
|
||||
/** Echo the widget content.
|
||||
*
|
||||
*
|
||||
* Subclasses should over-ride this function to generate their widget code.
|
||||
*
|
||||
* @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
|
||||
@ -46,7 +46,7 @@ class WP_Widget {
|
||||
}
|
||||
|
||||
/** Update a particular instance.
|
||||
*
|
||||
*
|
||||
* This function should check that $new_instance is set correctly.
|
||||
* The newly calculated value of $instance should be returned.
|
||||
* If "false" is returned, the instance won't be saved/updated.
|
||||
@ -60,7 +60,7 @@ class WP_Widget {
|
||||
}
|
||||
|
||||
/** Echo the settings update form
|
||||
*
|
||||
*
|
||||
* @param array $instance Current settings
|
||||
*/
|
||||
function form($instance) {
|
||||
@ -96,9 +96,9 @@ class WP_Widget {
|
||||
}
|
||||
|
||||
/** Constructs name attributes for use in form() fields
|
||||
*
|
||||
*
|
||||
* This function should be used in form() methods to create name attributes for fields to be saved by update()
|
||||
*
|
||||
*
|
||||
* @param string $field_name Field name
|
||||
* @return string Name attribute for $field_name
|
||||
*/
|
||||
@ -107,9 +107,9 @@ class WP_Widget {
|
||||
}
|
||||
|
||||
/** Constructs id attributes for use in form() fields
|
||||
*
|
||||
*
|
||||
* This function should be used in form() methods to create id attributes for fields to be saved by update()
|
||||
*
|
||||
*
|
||||
* @param string $field_name Field name
|
||||
* @return string ID attribute for $field_name
|
||||
*/
|
||||
|
@ -751,7 +751,7 @@ class wpdb {
|
||||
return $this->query( $this->prepare( $sql, $data) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Update a row in the table
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user