Changeset 11013
- Timestamp:
- 04/20/2009 06:18:39 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r10827 r11013 6 6 * @subpackage Administration 7 7 */ 8 9 define('WP_ADMIN', true); 8 9 define('WP_ADMIN', true); 10 10 11 11 if ( defined('ABSPATH') ) -
trunk/wp-admin/custom-header.php
r10925 r11013 233 233 var ximg = jQuery('#upload').width(); 234 234 var yimg = jQuery('#upload').height(); 235 235 236 236 //set up default values 237 237 jQuery( '#x1' ).val(0); … … 241 241 jQuery( '#width' ).val(xinit); 242 242 jQuery( '#height' ).val(yinit); 243 243 244 244 if ( yimg < yinit || ximg < xinit ) { 245 245 if ( ximg / yimg > ratio ) { -
trunk/wp-admin/gears-manifest.php
r10939 r11013 7 7 */ 8 8 9 /** 9 /** 10 10 * Disable error reporting 11 * 11 * 12 12 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging 13 13 */ -
trunk/wp-admin/includes/class-wp-upgrader.php
r11012 r11013 20 20 var $skin = null; 21 21 var $result = array(); 22 22 23 23 function WP_Upgrader(&$skin = null) { 24 24 return __construct($skin); … … 31 31 $this->skin->set_upgrader($this); 32 32 } 33 33 34 34 function generic_strings() { 35 35 $this->strings['bad_request'] = __('Invalid Data provided.'); … … 47 47 $this->strings['mkdir_failed'] = __('Could not create directory.'); 48 48 $this->strings['bad_package'] = __('Incompatible Archive'); 49 49 50 50 $this->strings['maintenance_start'] = __('Enabling Maintenance mode.'); 51 51 $this->strings['maintenance_end'] = __('Disabling Maintenance mode.'); 52 52 } 53 53 54 54 function fs_connect( $directories = array() ) { 55 55 global $wp_filesystem; 56 56 57 57 if ( false === ($credentials = $this->skin->request_filesystem_credentials()) ) 58 58 return false; 59 59 60 60 if ( ! WP_Filesystem($credentials) ) { 61 61 $error = true; … … 68 68 if ( ! is_object($wp_filesystem) ) 69 69 return new WP_Error('fs_unavailable', $this->strings['fs_unavailable'] ); 70 70 71 71 if ( is_wp_error($wp_filesystem->errors) && $wp_filesystem->errors->get_error_code() ) 72 72 return new WP_Error('fs_error', $this->strings['fs_error'], $wp_filesystem->errors); … … 95 95 if ( ! preg_match('!^(http|https|ftp)://!i', $package) && file_exists($package) ) //Local file or remote? 96 96 return $package; //must be a local file.. 97 97 98 98 if ( empty($package) ) 99 99 return new WP_Error('no_package', $this->strings['no_package']); … … 102 102 103 103 $download_file = download_url($package); 104 104 105 105 if ( is_wp_error($download_file) ) 106 106 return new WP_Error('download_failed', $this->strings['download_failed'], $download_file->get_error_message()); 107 107 108 108 return $download_file; 109 109 } 110 110 111 111 function unpack_package($package, $delete_package = true) { 112 112 global $wp_filesystem; 113 113 114 114 $this->skin->feedback('unpack_package'); 115 115 … … 141 141 return $result; 142 142 } 143 143 144 144 return $working_dir; 145 145 } 146 146 147 147 function install_package($args = array()) { 148 148 global $wp_filesystem; … … 158 158 if ( empty($source) || empty($destination) ) 159 159 return new WP_Error('bad_request', $this->strings['bad_request']); 160 160 161 161 $this->skin->feedback('installing_package'); 162 162 … … 168 168 $remote_source = $source; 169 169 $local_destination = $destination; 170 170 171 171 $source_files = array_keys( $wp_filesystem->dirlist($remote_source) ); 172 172 $remote_destination = $wp_filesystem->find_folder($local_destination); … … 178 178 return new WP_Error('bad_package', $this->strings['bad_package']); //There are no files? 179 179 //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. 180 180 181 181 //Hook ability to change the source file location.. 182 182 $source = apply_filters('upgrader_source_selection', $source, $remote_source, $this); 183 183 if ( is_wp_error($source) ) 184 184 return $source; 185 185 186 186 //Has the source location changed? If so, we need a new source_files list. 187 187 if ( $source !== $remote_source ) 188 188 $source_files = array_keys( $wp_filesystem->dirlist($source) ); 189 189 190 190 //Protection against deleting files in any important base directories. 191 191 if ( in_array( $destination, array(ABSPATH, WP_CONTENT_DIR, WP_PLUGIN_DIR, WP_CONTENT_DIR . '/themes') ) ) { … … 213 213 return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); 214 214 } 215 215 216 216 //Create destination if needed 217 217 if ( !$wp_filesystem->exists($remote_destination) ) 218 218 if ( !$wp_filesystem->mkdir($remote_destination, FS_CHMOD_DIR) ) 219 219 return new WP_Error('mkdir_failed', $this->strings['mkdir_failed'], $remote_destination); 220 220 221 221 // Copy new version of item into place. 222 222 $result = copy_dir($source, $remote_destination); … … 226 226 return $result; 227 227 } 228 229 //Clear the Working folder? 228 229 //Clear the Working folder? 230 230 if ( $clear_working ) 231 231 $wp_filesystem->delete($remote_source, true); 232 232 233 233 $destination_name = basename( str_replace($local_destination, '', $destination) ); 234 234 if ( '.' == $destination_name ) … … 246 246 return $this->result; 247 247 } 248 248 249 249 function run($options) { 250 250 … … 278 278 return $download; 279 279 } 280 280 281 281 //Unzip's the file into a temporary directory 282 282 $working_dir = $this->unpack_package( $download ); … … 287 287 288 288 //With the given options, this installs it to the destination directory. 289 $result = $this->install_package( array( 289 $result = $this->install_package( array( 290 290 'source' => $working_dir, 291 291 'destination' => $destination, … … 306 306 return $result; 307 307 } 308 308 309 309 function maintenance_mode($enable = false) { 310 310 global $wp_filesystem; … … 321 321 } 322 322 } 323 323 324 324 } 325 325 … … 327 327 328 328 var $result; 329 329 330 330 function upgrade_strings() { 331 331 $this->generic_strings(); … … 352 352 353 353 function install($package) { 354 354 355 355 $this->install_strings(); 356 356 … … 362 362 'hook_extra' => array() 363 363 )); 364 364 365 365 // Force refresh of plugin update information 366 366 delete_transient('update_plugins'); … … 369 369 370 370 function upgrade($plugin) { 371 371 372 372 $this->upgrade_strings(); 373 373 374 374 $current = get_transient( 'update_plugins' ); 375 375 if ( !isset( $current->response[ $plugin ] ) ) { … … 381 381 // Get the URL to the zip file 382 382 $r = $current->response[ $plugin ]; 383 383 384 384 add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2); 385 385 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); … … 406 406 delete_transient('update_plugins'); 407 407 } 408 408 409 409 //return plugin info. 410 410 function plugin_info() { … … 412 412 return false; 413 413 if ( empty($this->result['destination_name']) ) 414 return false; 414 return false; 415 415 416 416 $plugin = get_plugins('/' . $this->result['destination_name']); //Ensure to pass with leading slash … … 420 420 $pluginfiles = array_keys($plugin); //Assume the requested plugin is the first in the list 421 421 422 return $this->result['destination_name'] . '/' . $pluginfiles[0]; 422 return $this->result['destination_name'] . '/' . $pluginfiles[0]; 423 423 } 424 424 … … 437 437 //Deactivate the plugin silently, Prevent deactivation hooks from running. 438 438 deactivate_plugins($plugin, true); 439 } 439 } 440 440 } 441 441 … … 443 443 function delete_old_plugin($removed, $local_destination, $remote_destination, $plugin) { 444 444 global $wp_filesystem; 445 445 446 446 if ( is_wp_error($removed) ) 447 447 return $removed; //Pass errors through. 448 448 449 449 $plugin = isset($plugin['plugin']) ? $plugin['plugin'] : ''; 450 450 if ( empty($plugin) ) … … 453 453 $plugins_dir = $wp_filesystem->wp_plugins_dir(); 454 454 $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) ); 455 455 456 456 if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If its already vanished. 457 457 return $removed; 458 458 459 459 // If plugin is in its own directory, recursively delete the directory. 460 460 if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory seperator AND that its not the root plugin folder … … 465 465 if ( ! $deleted ) 466 466 return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); 467 467 468 468 return $removed; 469 469 } … … 498 498 499 499 function install($package) { 500 500 501 501 $this->install_strings(); 502 502 … … 507 507 'clear_working' => true 508 508 ); 509 509 510 510 $this->run($options); 511 511 512 512 if ( ! $this->result || is_wp_error($this->result) ) 513 513 return $this->result; 514 514 515 515 // Force refresh of theme update information 516 516 delete_transient('update_themes'); 517 517 518 518 if ( empty($result['destination_name']) ) 519 return false; 519 return false; 520 520 else 521 521 return $result['destination_name']; … … 523 523 524 524 function upgrade($theme) { 525 525 526 526 $this->upgrade_strings(); 527 527 528 528 // Is an update available? 529 529 $current = get_transient( 'update_themes' ); 530 530 if ( !isset( $current->response[ $theme ] ) ) 531 531 return new WP_Error('up_to_date', $this->strings['up_to_date']); 532 532 533 533 $r = $current->response[ $theme ]; 534 534 … … 546 546 ) 547 547 ); 548 548 549 549 $this->run($options); 550 550 … … 557 557 return true; 558 558 } 559 559 560 560 function current_before($return, $theme) { 561 561 562 562 if ( is_wp_error($return) ) 563 563 return $return; … … 593 593 return $return; 594 594 } 595 595 596 596 function delete_old_theme($removed, $local_destination, $remote_destination, $theme) { 597 597 global $wp_filesystem; 598 598 599 599 $theme = isset($theme['theme']) ? $theme['theme'] : ''; 600 600 601 601 if ( is_wp_error($removed) || empty($theme) ) 602 602 return $removed; //Pass errors through. 603 603 604 604 $themes_dir = $wp_filesystem->wp_themes_dir(); 605 605 if ( $wp_filesystem->exists( trailingslashit($themes_dir) . $theme ) ) … … 608 608 return true; 609 609 } 610 610 611 611 function theme_info() { 612 612 if ( empty($this->result['destination_name']) ) … … 632 632 global $wp_filesystem; 633 633 $this->upgrade_strings(); 634 635 634 635 636 636 if ( !empty($feedback) ) 637 637 add_filter('update_feedback', $feedback); 638 638 639 639 // Is an update available? 640 640 if ( !isset( $current->response ) || $current->response == 'latest' ) … … 644 644 if ( is_wp_error($res) ) 645 645 return $res; 646 646 647 647 $wp_dir = trailingslashit($wp_filesystem->abspath()); 648 648 649 649 $download = $this->download_package( $current->package ); 650 650 if ( is_wp_error($download) ) 651 651 return $download; 652 652 653 653 $working_dir = $this->unpack_package( $download ); 654 654 if ( is_wp_error($working_dir) ) … … 661 661 } 662 662 $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); 663 663 664 664 require(ABSPATH . 'wp-admin/includes/update-core.php'); 665 665 666 666 return update_core($working_dir, $wp_dir); 667 667 } … … 678 678 679 679 class WP_Upgrader_Skin { 680 680 681 681 var $upgrader; 682 682 var $done_header = false; 683 683 684 684 function WP_Upgrader_Skin($args = array()) { 685 685 return __construct($args); … … 689 689 $this->options = wp_parse_args($args, $defaults); 690 690 } 691 691 692 692 function set_upgrader(&$upgrader) { 693 693 if ( is_object($upgrader) ) … … 697 697 $this->result = $result; 698 698 } 699 699 700 700 function request_filesystem_credentials($error = false) { 701 701 $url = $this->options['url']; … … 704 704 return request_filesystem_credentials($url, '', $error); //Possible to bring inline, Leaving as0is for now. 705 705 } 706 706 707 707 function header() { 708 708 if ( $this->done_header ) … … 711 711 echo '<div class="wrap">'; 712 712 echo screen_icon(); 713 echo '<h2>' . $this->options['title'] . '</h2>'; 713 echo '<h2>' . $this->options['title'] . '</h2>'; 714 714 } 715 715 function footer() { 716 716 echo '</div>'; 717 717 } 718 718 719 719 function error($errors) { 720 720 if ( ! $this->done_header ) … … 739 739 return; 740 740 show_message($string); 741 } 741 } 742 742 function before() {} 743 743 function after() {} 744 744 745 745 } 746 746 … … 760 760 761 761 $this->plugin_active = is_plugin_active($this->plugin); 762 762 763 763 parent::__construct($args); 764 764 } 765 765 766 766 function after() { 767 767 $this->plugin = $this->upgrader->plugin_info(); … … 797 797 $defaults = array( 'type' => 'web', 'url' => '', 'plugin' => '', 'nonce' => '', 'title' => '' ); 798 798 $args = wp_parse_args($args, $defaults); 799 799 800 800 $this->type = $args['type']; 801 801 $this->api = isset($args['api']) ? $args['api'] : array(); 802 802 803 803 parent::__construct($args); 804 804 } … … 808 808 $this->upgrader->strings['process_success'] = sprintf( __('Successfully installed the plugin <strong>%s %s</strong>.'), $this->api->name, $this->api->version); 809 809 } 810 810 811 811 function after() { 812 812 … … 843 843 $defaults = array( 'type' => 'web', 'url' => '', 'theme' => '', 'nonce' => '', 'title' => '' ); 844 844 $args = wp_parse_args($args, $defaults); 845 845 846 846 $this->type = $args['type']; 847 847 $this->api = isset($args['api']) ? $args['api'] : array(); 848 848 849 849 parent::__construct($args); 850 850 } … … 854 854 $this->upgrader->strings['process_success'] = sprintf( __('Successfully installed the theme <strong>%s %s</strong>.'), $this->api->name, $this->api->version); 855 855 } 856 856 857 857 function after() { 858 858 if ( empty($this->upgrader->result['destination_name']) ) … … 865 865 $stylesheet = $this->upgrader->result['destination_name']; 866 866 $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet; 867 867 868 868 $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(clean_url(get_option('home'))) ) ); 869 869 $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); 870 870 871 871 $install_actions = array( 872 872 'preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>', … … 900 900 901 901 $this->theme = $args['theme']; 902 902 903 903 parent::__construct($args); 904 904 } 905 905 906 906 function after() { 907 907 … … 915 915 $stylesheet = $this->upgrader->result['destination_name']; 916 916 $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet; 917 917 918 918 $preview_link = htmlspecialchars( add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true' ), trailingslashit(clean_url(get_option('home'))) ) ); 919 919 $activate_link = wp_nonce_url("themes.php?action=activate&template=" . urlencode($template) . "&stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template); … … 926 926 if ( ( ! $this->result || is_wp_error($this->result) ) || $stylesheet == get_stylesheet() ) 927 927 unset($update_actions['preview'], $update_actions['activate']); 928 928 929 929 $update_actions = apply_filters('update_theme_complete_actions', $update_actions, $this->theme); 930 930 if ( ! empty($update_actions) ) … … 943 943 if ( ! ( ( $uploads = wp_upload_dir() ) && false === $uploads['error'] ) ) 944 944 wp_die($uploads['error']); 945 945 946 946 if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) ) 947 947 wp_die(__('Please select a file')); 948 948 949 949 if ( !empty($_FILES) ) 950 950 $this->filename = $_FILES[$form]['name']; … … 956 956 $this->filename = wp_unique_filename( $uploads['basedir'], $this->filename ); 957 957 $this->package = $uploads['basedir'] . '/' . $this->filename; 958 958 959 959 // Move the file to the uploads dir 960 960 if ( false === @ move_uploaded_file( $_FILES[$form]['tmp_name'], $this->package) ) -
trunk/wp-admin/includes/media.php
r10943 r11013 1566 1566 </span> 1567 1567 <?php _e('Sort Order:'); ?> 1568 <a href="#" id="asc"><?php _e('Ascending'); ?></a> | 1569 <a href="#" id="desc"><?php _e('Descending'); ?></a> | 1568 <a href="#" id="asc"><?php _e('Ascending'); ?></a> | 1569 <a href="#" id="desc"><?php _e('Descending'); ?></a> | 1570 1570 <a href="#" id="clear"><?php _e('Clear'); ?></a> 1571 1571 </div> -
trunk/wp-admin/includes/plugin-install.php
r11005 r11013 202 202 * Upload from zip 203 203 * @since 2.8.0 204 * 204 * 205 205 * @param string $page 206 206 */ -
trunk/wp-admin/includes/template.php
r11007 r11013 1570 1570 while ( $find_main_page > 0 ) { 1571 1571 $parent = get_page($find_main_page); 1572 1572 1573 1573 if ( is_null($parent) ) 1574 1574 break; 1575 1575 1576 1576 $level++; 1577 1577 $find_main_page = (int)$parent->post_parent; 1578 1578 1579 1579 if ( !isset($parent_name) ) 1580 1580 $parent_name = $parent->post_title; -
trunk/wp-admin/includes/theme-install.php
r11005 r11013 404 404 $rows = ceil(count($themes) / 3); 405 405 $table = array(); 406 $theme_keys = array_keys($themes); 407 for ( $row = 1; $row <= $rows; $row++ ) 408 for ( $col = 1; $col <= 3; $col++ ) 409 $table[$row][$col] = array_shift($theme_keys); 406 $theme_keys = array_keys($themes); 407 for ( $row = 1; $row <= $rows; $row++ ) 408 for ( $col = 1; $col <= 3; $col++ ) 409 $table[$row][$col] = array_shift($theme_keys); 410 410 411 411 foreach ( $table as $row => $cols ) { … … 422 422 ?> 423 423 <td class="<?php echo join(' ', $class); ?>"><?php 424 if ( isset($themes[$theme_index]) ) 425 display_theme($themes[$theme_index]); 424 if ( isset($themes[$theme_index]) ) 425 display_theme($themes[$theme_index]); 426 426 ?></td> 427 427 <?php } // end foreach $cols ?> -
trunk/wp-admin/includes/update.php
r11005 r11013 178 178 179 179 function wp_update_theme($theme, $feedback = '') { 180 180 181 181 if ( !empty($feedback) ) 182 182 add_filter('update_feedback', $feedback); … … 189 189 190 190 function wp_update_core($current, $feedback = '') { 191 191 192 192 if ( !empty($feedback) ) 193 193 add_filter('update_feedback', $feedback); -
trunk/wp-admin/includes/user.php
r10992 r11013 413 413 414 414 $id = (int) $id; 415 $user = new WP_User($id); 415 $user = new WP_User($id); 416 416 417 417 // allow for transaction statement … … 449 449 wp_cache_delete($user->user_email, 'useremail'); 450 450 wp_cache_delete($user->user_nicename, 'userslugs'); 451 451 452 452 // allow for commit transaction 453 453 do_action('deleted_user', $id); -
trunk/wp-admin/load-scripts.php
r10939 r11013 1 1 <?php 2 2 3 /** 3 /** 4 4 * Disable error reporting 5 * 5 * 6 6 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging 7 7 */ -
trunk/wp-admin/load-styles.php
r10939 r11013 1 1 <?php 2 2 3 /** 3 /** 4 4 * Disable error reporting 5 * 5 * 6 6 * Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging 7 7 */ -
trunk/wp-admin/plugins.php
r11004 r11013 464 464 if ( $total_this_page > $plugins_per_page ) 465 465 $plugins = array_slice($plugins, $start, $plugins_per_page); 466 466 467 467 print_plugins_table($plugins, $status); 468 468 ?> -
trunk/wp-admin/press-this.php
r11010 r11013 59 59 $desc = isset($_REQUEST['photo_description'][$key]) ? $_REQUEST['photo_description'][$key] : ''; 60 60 $upload = media_sideload_image($image, $post_ID, $desc); 61 61 62 62 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes 63 63 if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote($image, '/').'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); … … 451 451 <!-- This div holds the photo metadata --> 452 452 <div class="photolist"></div> 453 453 454 454 <div id="submitdiv" class="stuffbox"> 455 455 <h3><?php _e('Publish') ?></h3> … … 466 466 </div> 467 467 </div> 468 468 469 469 <div id="categorydiv" class="stuffbox"> 470 470 <h3><?php _e('Categories') ?></h3> … … 525 525 <div class="postdivrich"> 526 526 <ul id="actions"> 527 527 528 528 <li id="photo_button"> 529 529 Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#"> -
trunk/wp-admin/update.php
r11012 r11013 35 35 36 36 include('admin-footer.php'); 37 37 38 38 } elseif ('activate-plugin' == $action ) { 39 39 if ( ! current_user_can('update_plugins') ) … … 64 64 65 65 include_once ABSPATH . 'wp-admin/includes/plugin-install.php'; //for plugins_api.. 66 66 67 67 check_admin_referer('install-plugin_' . $plugin); 68 68 $api = plugins_api('plugin_information', array('slug' => $plugin, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. 69 69 70 70 if ( is_wp_error($api) ) 71 71 wp_die($api); 72 72 73 73 $title = __('Plugin Install'); 74 74 $parent_file = 'plugins.php'; 75 75 $submenu_file = 'plugin-install.php'; 76 76 require_once('admin-header.php'); 77 77 78 78 $title = sprintf( __('Installing Plugin: %s'), $api->name . ' ' . $api->version ); 79 79 $nonce = 'install-plugin_' . $plugin; … … 83 83 $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); 84 84 $upgrader->install($api->download_link); 85 85 86 86 include('admin-footer.php'); 87 87 … … 99 99 $submenu_file = 'plugin-install.php'; 100 100 require_once('admin-header.php'); 101 101 102 102 $title = sprintf( __('Installing Plugin from uploaded file: %s'), basename( $file_upload->filename ) ); 103 103 $nonce = 'plugin-upload'; … … 131 131 132 132 include('admin-footer.php'); 133 133 134 134 } elseif ( 'install-theme' == $action ) { 135 135 … … 138 138 139 139 include_once ABSPATH . 'wp-admin/includes/theme-install.php'; //for themes_api.. 140 140 141 141 check_admin_referer('install-theme_' . $theme); 142 142 $api = themes_api('theme_information', array('slug' => $theme, 'fields' => array('sections' => false) ) ); //Save on a bit of bandwidth. … … 151 151 $submenu_file = 'theme-install.php'; 152 152 require_once('admin-header.php'); 153 153 154 154 $title = sprintf( __('Installing theme: %s'), $api->name . ' ' . $api->version ); 155 155 $nonce = 'install-theme_' . $theme; 156 156 $url = 'update.php?action=install-theme&theme=' . $theme; 157 157 $type = 'web'; //Install theme type, From Web or an Upload. 158 158 159 159 $upgrader = new Theme_Upgrader( new Theme_Installer_Skin( compact('title', 'url', 'nonce', 'plugin', 'api') ) ); 160 160 $upgrader->install($api->download_link); 161 161 162 162 include('admin-footer.php'); 163 163 164 164 } elseif ( 'upload-theme' == $action ) { 165 165 -
trunk/wp-content/themes/default/sidebar.php
r10945 r11013 50 50 </li> 51 51 <?php }?> 52 </ul> 52 </ul> 53 53 <ul role="navigation"> 54 54 <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?> -
trunk/wp-includes/classes.php
r10814 r11013 1185 1185 $css_class[] = 'current_page_parent'; 1186 1186 } 1187 1188 $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page)); 1187 1188 $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page)); 1189 1189 1190 1190 $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>'; -
trunk/wp-includes/comment-template.php
r11011 r11013 909 909 function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { 910 910 global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; 911 911 912 912 if ( false === $zero ) $zero = __( 'No Comments' ); 913 913 if ( false === $one ) $one = __( '1 Comment' ); 914 914 if ( false === $more ) $more = __( '% Comments' ); 915 915 if ( false === $none ) $none = __( 'Comments Off' ); 916 916 917 917 $number = get_comments_number( $id ); 918 918 … … 1116 1116 function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) { 1117 1117 global $comment; 1118 1118 1119 1119 if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); 1120 1120 if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' ); -
trunk/wp-includes/feed-atom-comments.php
r10984 r11013 41 41 <id><?php bloginfo_rss('comments_atom_url'); ?></id> 42 42 <?php } ?> 43 <?php do_action('comments_atom_head'); ?> 43 <?php do_action('comments_atom_head'); ?> 44 44 <?php 45 45 if ( have_comments() ) : while ( have_comments() ) : the_comment(); -
trunk/wp-includes/formatting.php
r10989 r11013 47 47 $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'s', '\'\'', ' (tm)'), $cockney); 48 48 $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', '“', '’s', '”', ' ™'), $cockneyreplace); 49 49 50 50 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/'); 51 51 $dynamic_replacements = array('’$1','$1‘', '$1″', '$1′', '$1’$2', '$1“$2', '”$1', '’$1', '$1×$2'); -
trunk/wp-includes/functions.php
r10974 r11013 97 97 $gmt = true; 98 98 } 99 99 100 100 // store original value for language with untypical grammars 101 101 // see http://core.trac.wordpress.org/ticket/9396 102 102 $req_format = $dateformatstring; 103 103 104 104 $datefunc = $gmt? 'gmdate' : 'date'; 105 105 … … 1684 1684 if ( !isset( $alloptions['siteurl'] ) ) 1685 1685 $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); 1686 else 1686 else 1687 1687 $installed = $alloptions['siteurl']; 1688 1688 $wpdb->suppress_errors( $suppress ); -
trunk/wp-includes/link-template.php
r10983 r11013 935 935 936 936 $date = mysql2date(get_option('date_format'), $post->post_date); 937 937 938 938 $title = str_replace('%title', $post->post_title, $title); 939 939 $title = str_replace('%date', $date, $title); … … 1051 1051 function get_boundary_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $start = true) { 1052 1052 $posts = get_boundary_post($in_same_cat,$excluded_categories,$start); 1053 // Even though we limited get_posts to return only 1 item it still returns an array of objects. 1054 $post = $posts[0]; 1053 // Even though we limited get_posts to return only 1 item it still returns an array of objects. 1054 $post = $posts[0]; 1055 1055 1056 1056 if ( empty($post) ) … … 1105 1105 */ 1106 1106 function index_rel_link() { 1107 echo get_index_rel_link(); 1107 echo get_index_rel_link(); 1108 1108 } 1109 1109 -
trunk/wp-includes/post-template.php
r10954 r11013 415 415 } elseif ( is_page() ) { 416 416 $classes[] = 'page'; 417 417 418 418 $wp_query->post = $wp_query->posts[0]; 419 419 setup_postdata($wp_query->post); -
trunk/wp-includes/query.php
r10992 r11013 2007 2007 $q['author'] = get_user_by('slug', $q['author_name']); 2008 2008 if ( $q['author'] ) 2009 $q['author'] = $q['author']->ID; 2009 $q['author'] = $q['author']->ID; 2010 2010 $whichauthor .= " AND ($wpdb->posts.post_author = ".absint($q['author']).')'; 2011 2011 } -
trunk/wp-includes/registration.php
r10997 r11013 188 188 $user_nicename = $alt_user_nicename; 189 189 } 190 190 191 191 $data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' ); 192 192 $data = stripslashes_deep( $data ); -
trunk/wp-includes/script-loader.php
r11009 r11013 169 169 170 170 $scripts->add( 'jcrop', "/wp-includes/js/jcrop/jquery.Jcrop$suffix.js", array('jquery'), '0.9.5-1'); 171 171 172 172 if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) { 173 173 $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.2.0-20081031'); -
trunk/wp-includes/taxonomy.php
r10965 r11013 24 24 $wp_taxonomies['post_tag'] = (object) array('name' => 'post_tag', 'object_type' => 'post', 'hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags')); 25 25 $wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); 26 26 27 27 } 28 28 add_action( 'init', 'create_initial_taxonomies' ); … … 1079 1079 * The $args 'default' will only override the terms found, if there is only one 1080 1080 * term found. Any other and the found terms are used. 1081 * 1081 * 1082 1082 * The $args 'force_default' will force the term supplied as default to be 1083 1083 * assigned even if the object was not going to be termless … … 1414 1414 * 1415 1415 * @param int $object_id The object to relate to. 1416 * @param array|int|string $term The slug or id of the term, will replace all existing 1416 * @param array|int|string $term The slug or id of the term, will replace all existing 1417 1417 * related terms in this taxonomy. 1418 1418 * @param array|string $taxonomy The context in which to relate the term to the object. -
trunk/wp-includes/theme.php
r10835 r11013 187 187 if ( preg_match( '|Theme URI:(.*)$|mi', $theme_data, $theme_uri ) ) 188 188 $theme_uri = clean_url( trim( $theme_uri[1] ) ); 189 else 189 else 190 190 $theme_uri = ''; 191 191 192 192 if ( preg_match( '|Description:(.*)$|mi', $theme_data, $description ) ) 193 193 $description = wptexturize( wp_kses( trim( $description[1] ), $themes_allowed_tags ) ); 194 else 194 else 195 195 $description = ''; 196 196 … … 375 375 @ $stylesheet_dir->close(); 376 376 } 377 377 378 378 $template_dir = @ dir("$theme_root/$template"); 379 379 if ( $template_dir ) { … … 394 394 } 395 395 } 396 @ $template_dir->close(); 396 @ $template_dir->close(); 397 397 } 398 398 … … 1151 1151 $theme_dir = str_replace('\\','/', get_theme_root()); // sanitize for Win32 installs 1152 1152 $theme_dir = preg_replace('|/+|','/', $theme_dir); // remove any duplicate slash 1153 $file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir 1153 $file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir 1154 1154 return $file; 1155 1155 } -
trunk/wp-includes/widgets.php
r11009 r11013 36 36 37 37 /** Echo the widget content. 38 * 38 * 39 39 * Subclasses should over-ride this function to generate their widget code. 40 40 * … … 47 47 48 48 /** Update a particular instance. 49 * 49 * 50 50 * This function should check that $new_instance is set correctly. 51 51 * The newly calculated value of $instance should be returned. … … 61 61 62 62 /** Echo the settings update form 63 * 63 * 64 64 * @param array $instance Current settings 65 65 */ … … 97 97 98 98 /** Constructs name attributes for use in form() fields 99 * 99 * 100 100 * This function should be used in form() methods to create name attributes for fields to be saved by update() 101 * 101 * 102 102 * @param string $field_name Field name 103 103 * @return string Name attribute for $field_name … … 108 108 109 109 /** Constructs id attributes for use in form() fields 110 * 110 * 111 111 * This function should be used in form() methods to create id attributes for fields to be saved by update() 112 * 112 * 113 113 * @param string $field_name Field name 114 114 * @return string ID attribute for $field_name -
trunk/wp-includes/wp-db.php
r10934 r11013 752 752 } 753 753 754 754 755 755 /** 756 756 * Update a row in the table
Note: See TracChangeset
for help on using the changeset viewer.