Ticket #18560: 18560.diff
| File 18560.diff, 26.3 KB (added by duck_, 21 months ago) |
|---|
-
wp-includes/taxonomy.php
1785 1785 * @uses wp_delete_term() 1786 1786 * 1787 1787 * @param int $cat_ID 1788 * @return mixed Returns true if completes delete action; false if term doesn t exist;1788 * @return mixed Returns true if completes delete action; false if term doesn't exist; 1789 1789 * Zero on attempted deletion of default Category; WP_Error object is also a possibility. 1790 1790 */ 1791 1791 function wp_delete_category( $cat_ID ) { -
wp-includes/pomo/translations.php
81 81 /** 82 82 * Given the number of items, returns the 0-based index of the plural form to use 83 83 * 84 * Here, in the base Translations class, the common g logic for English is implmented:84 * Here, in the base Translations class, the common logic for English is implemented: 85 85 * 0 if there is one element, 1 otherwise 86 86 * 87 87 * This function should be overrided by the sub-classes. For example MO/PO can derive the logic -
wp-includes/js/tinymce/plugins/wpdialogs/js/popup.dev.js
67 67 * Returns a window argument/parameter by name. 68 68 * 69 69 * @method getWindowArg 70 * @param {String} n Name of the window argument to retri ve.70 * @param {String} n Name of the window argument to retrieve. 71 71 * @param {String} dv Optional default value to return. 72 72 * @return {String} Argument value or default value if it wasn't found. 73 73 */ … … 81 81 * Returns a editor parameter/config option value. 82 82 * 83 83 * @method getParam 84 * @param {String} n Name of the editor config option to retri ve.84 * @param {String} n Name of the editor config option to retrieve. 85 85 * @param {String} dv Optional default value to return. 86 86 * @return {String} Parameter value or default value if it wasn't found. 87 87 */ -
wp-includes/media.php
260 260 } 261 261 262 262 /** 263 * Calculates the new dimen tions for a downsampled image.263 * Calculates the new dimensions for a downsampled image. 264 264 * 265 265 * If either width or height are empty, no constraint is applied on 266 266 * that dimension. -
wp-includes/http.php
130 130 * 131 131 * @param array $response 132 132 * @param string $header Header name to retrieve value from. 133 * @return string The header value. Empty string on if incorrect parameter given, or if the header doesn t exist.133 * @return string The header value. Empty string on if incorrect parameter given, or if the header doesn't exist. 134 134 */ 135 135 function wp_remote_retrieve_header(&$response, $header) { 136 136 if ( is_wp_error($response) || ! isset($response['headers']) || ! is_array($response['headers'])) -
wp-admin/includes/plugin-install.php
35 35 $args->per_page = 24; 36 36 37 37 // Allows a plugin to override the WordPress.org API entirely. 38 // Use the filter 'plugins_api_result' to me arly add results.38 // Use the filter 'plugins_api_result' to merely add results. 39 39 // Please ensure that a object is returned from the following filters. 40 40 $args = apply_filters('plugins_api_args', $args, $action); 41 41 $res = apply_filters('plugins_api', false, $action, $args); … … 97 97 if ( is_wp_error($api_tags) ) { 98 98 echo $api_tags->get_error_message(); 99 99 } else { 100 //Set up the tags in a way which can be interpr ated by wp_generate_tag_cloud()100 //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud() 101 101 $tags = array(); 102 102 foreach ( (array)$api_tags as $tag ) 103 103 $tags[ $tag['name'] ] = (object) array( … … 175 175 * @since 3.0.0 176 176 */ 177 177 function install_plugin_install_status($api, $loop = false) { 178 // this function is called recursiv ly, $loop prevents futhur loops.178 // this function is called recursively, $loop prevents further loops. 179 179 if ( is_array($api) ) 180 180 $api = (object) $api; 181 181 -
wp-admin/includes/file.php
363 363 } 364 364 365 365 /** 366 * Handle sideloads, which is the process of retri ving a media item from another server instead of366 * Handle sideloads, which is the process of retrieving a media item from another server instead of 367 367 * a traditional media upload. This process involves sanitizing the filename, checking extensions 368 368 * for mime type, and moving the file to the appropriate directory within the uploads directory. 369 369 * … … 519 519 } 520 520 521 521 /** 522 * Unzip 's a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction.522 * Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction. 523 523 * Assumes that WP_Filesystem() has already been called and set up. Does not extract a root-level __MACOSX directory, if present. 524 524 * 525 525 * Attempts to increase the PHP Memory limit to 256M before uncompressing, … … 833 833 return false; 834 834 835 835 if ( !$wp_filesystem->connect() ) 836 return false; //There was an er orr connecting to the server.836 return false; //There was an error connecting to the server. 837 837 838 838 // Set the permission constants if not already set. 839 839 if ( ! defined('FS_CHMOD_DIR') ) … … 846 846 847 847 /** 848 848 * Determines which Filesystem Method to use. 849 * The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fso xkopen())849 * The priority of the Transports are: Direct, SSH2, FTP PHP Extension, FTP Sockets (Via Sockets class, or fsockopen()) 850 850 * 851 851 * Note that the return value of this function can be overridden in 2 ways 852 852 * - By defining FS_METHOD in your <code>wp-config.php</code> file -
wp-admin/includes/update.php
26 26 * Get available core updates 27 27 * 28 28 * @param array $options Set $options['dismissed'] to true to show dismissed upgrades too, 29 * set $options['available'] to false to skip not-di missed updates.29 * set $options['available'] to false to skip not-dismissed updates. 30 30 * @return array Array of the update objects 31 31 */ 32 32 function get_core_updates( $options = array() ) { -
wp-admin/includes/class-wp-filesystem-base.php
153 153 if ( defined($constant) && $folder === $dir ) 154 154 return trailingslashit(constant($constant)); 155 155 } elseif ( 'direct' == $this->method ) { 156 $folder = str_replace('\\', '/', $folder); //Windows path saniti ation156 $folder = str_replace('\\', '/', $folder); //Windows path sanitisation 157 157 return trailingslashit($folder); 158 158 } 159 159 160 $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows drive letter if its there.161 $folder = str_replace('\\', '/', $folder); //Windows path saniti ation160 $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows drive letter if it's there. 161 $folder = str_replace('\\', '/', $folder); //Windows path sanitisation 162 162 163 163 if ( isset($this->cache[ $folder ] ) ) 164 164 return $this->cache[ $folder ]; … … 223 223 } 224 224 if ( $loop ) 225 225 return false; //Prevent this function from looping again. 226 //As an extra last resort, Change back to / if the folder wasn t found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.226 //As an extra last resort, Change back to / if the folder wasn't found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups. 227 227 return $this->search_for_folder($folder, '/', true); 228 228 229 229 } -
wp-admin/includes/post.php
612 612 add_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID ); 613 613 614 614 // Reunite any orphaned attachments with their parent 615 // Does this need to be u dpated? ~ Mark615 // Does this need to be updated? ~ Mark 616 616 if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 617 617 $draft_ids = array(); 618 618 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) -
wp-admin/includes/upgrade.php
576 576 577 577 if (!$got_gmt_fields) { 578 578 579 // Add or sub stract time to all dates, to get GMT dates579 // Add or subtract time to all dates, to get GMT dates 580 580 $add_hours = intval($diff_gmt_weblogger); 581 581 $add_minutes = intval(60 * ($diff_gmt_weblogger - $add_hours)); 582 582 $wpdb->query("UPDATE $wpdb->posts SET post_date_gmt = DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)"); … … 1607 1607 return false; 1608 1608 1609 1609 // Copy files from the old locations to the site theme. 1610 // TODO: This does not copy arbit arary include dependencies. Only the1610 // TODO: This does not copy arbitrary include dependencies. Only the 1611 1611 // standard WP files are copied. 1612 1612 $files = array('index.php' => 'index.php', 'wp-layout.css' => 'style.css', 'wp-comments.php' => 'comments.php', 'wp-comments-popup.php' => 'comments-popup.php'); 1613 1613 -
wp-admin/includes/class-wp-list-table.php
326 326 * @access protected 327 327 * 328 328 * @param array $actions The list of actions 329 * @param bool $always_visible W ether the actions should be always visible329 * @param bool $always_visible Whether the actions should be always visible 330 330 * @return string 331 331 */ 332 332 function row_actions( $actions, $always_visible = false ) { -
wp-admin/includes/dashboard.php
1023 1023 * Checks to see if all of the feed url in $check_urls are cached. 1024 1024 * 1025 1025 * If $check_urls is empty, look for the rss feed url found in the dashboard 1026 * widget optio s of $widget_id. If cached, call $callback, a function that1026 * widget options of $widget_id. If cached, call $callback, a function that 1027 1027 * echoes out output for this widget. If not cache, echo a "Loading..." stub 1028 1028 * which is later replaced by AJAX call (see top of /wp-admin/index.php) 1029 1029 * -
wp-admin/includes/deprecated.php
37 37 } 38 38 39 39 /** 40 * Calculates the new dimen tions for a downsampled image.40 * Calculates the new dimensions for a downsampled image. 41 41 * 42 42 * @since 2.0.0 43 43 * @deprecated 3.0.0 -
wp-admin/includes/class-wp-upgrader.php
212 212 } 213 213 214 214 if ( $clear_destination ) { 215 //We're going to clear the destination if there s something there215 //We're going to clear the destination if there's something there 216 216 $this->skin->feedback('remove_old'); 217 217 $removed = true; 218 218 if ( $wp_filesystem->exists($remote_destination) ) … … 224 224 else if ( ! $removed ) 225 225 return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); 226 226 } elseif ( $wp_filesystem->exists($remote_destination) ) { 227 //If we're not clearing the destination folder and something exists there al lready, Bail.227 //If we're not clearing the destination folder and something exists there already, Bail. 228 228 //But first check to see if there are actually any files in the folder. 229 229 $_files = $wp_filesystem->dirlist($remote_destination); 230 230 if ( ! empty($_files) ) { … … 304 304 305 305 $delete_package = ($download != $package); // Do not delete a "local" file 306 306 307 //Unzip 's the file into a temporary directory307 //Unzips the file into a temporary directory 308 308 $working_dir = $this->unpack_package( $download, $delete_package ); 309 309 if ( is_wp_error($working_dir) ) { 310 310 $this->skin->error($working_dir); … … 325 325 $this->skin->error($result); 326 326 $this->skin->feedback('process_failed'); 327 327 } else { 328 //Install Suc eeded328 //Install Succeeded 329 329 $this->skin->feedback('process_success'); 330 330 } 331 331 $this->skin->after(); … … 434 434 435 435 add_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade'), 10, 2); 436 436 add_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin'), 10, 4); 437 //'source_selection' => array(&$this, 'source_selection'), //there s a trackticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins.437 //'source_selection' => array(&$this, 'source_selection'), //there's a trac ticket to move up the directory for zip's which are made a bit differently, useful for non-.org plugins. 438 438 439 439 $this->run(array( 440 440 'package' => $r->package, … … 446 446 ) 447 447 )); 448 448 449 // Cleanup our hooks, in case something else does a upgrade on this connection.449 // Cleanup our hooks, in case something else does a upgrade on this connection. 450 450 remove_filter('upgrader_pre_install', array(&$this, 'deactivate_plugin_before_upgrade')); 451 451 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); 452 452 … … 531 531 532 532 $this->skin->footer(); 533 533 534 // Cleanup our hooks, in case something else does a upgrade on this connection.534 // Cleanup our hooks, in case something else does a upgrade on this connection. 535 535 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_plugin')); 536 536 537 537 // Force refresh of plugin update information … … 812 812 813 813 $this->skin->footer(); 814 814 815 // Cleanup our hooks, in case something else does a upgrade on this connection.815 // Cleanup our hooks, in case something else does a upgrade on this connection. 816 816 remove_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2); 817 817 remove_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2); 818 818 remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4); … … 873 873 return $return; 874 874 875 875 //Ensure stylesheet name hasnt changed after the upgrade: 876 // @TODO: Note, This doesn t handle the Template changing, or the Template name changing.876 // @TODO: Note, This doesn't handle the Template changing, or the Template name changing. 877 877 if ( $theme == get_stylesheet() && $theme != $this->result['destination_name'] ) { 878 878 $theme_info = $this->theme_info(); 879 879 $stylesheet = $this->result['destination_name']; … … 916 916 } 917 917 918 918 /** 919 * Core Upgrader class for WordPress. It allows for WordPress to upgrade itself in combi antion with the wp-admin/includes/update-core.php file919 * Core Upgrader class for WordPress. It allows for WordPress to upgrade itself in combination with the wp-admin/includes/update-core.php file 920 920 * 921 921 * @TODO More Detailed docs, for methods as well. 922 922 * … … 1562 1562 1563 1563 return true; 1564 1564 } 1565 } 1566 No newline at end of file 1565 } -
wp-admin/includes/meta-boxes.php
155 155 </div><?php // /misc-pub-section ?> 156 156 157 157 <?php 158 // translators: Publish box date form t, see http://php.net/date158 // translators: Publish box date format, see http://php.net/date 159 159 $datef = __( 'M j, Y @ G:i' ); 160 160 if ( 0 != $post->ID ) { 161 161 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date -
wp-admin/includes/widgets.php
160 160 $query_arg['key'] = $key; 161 161 } 162 162 163 // We aren't showing a widget control, we're output ing a template for a mult-widget control163 // We aren't showing a widget control, we're outputting a template for a multi-widget control 164 164 if ( isset($sidebar_args['_display']) && 'template' == $sidebar_args['_display'] && $widget_number ) { 165 165 // number == -1 implies a template where id numbers are replaced by a generic '__i__' 166 166 $control['params'][0]['number'] = -1; -
wp-admin/includes/template.php
897 897 // If no priority given and id already present, use existing priority 898 898 if ( empty($priority) ) { 899 899 $priority = $a_priority; 900 // else if we're adding to the sorted prior tiy, we don't know the title or callback. Glab them from the previously added context/priority.900 // else if we're adding to the sorted priority, we don't know the title or callback. Glab them from the previously added context/priority. 901 901 } elseif ( 'sorted' == $priority ) { 902 902 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; 903 903 $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback']; … … 1109 1109 * do_settings_fields() in do_settings-sections() 1110 1110 * 1111 1111 * The $callback argument should be the name of a function that echoes out the 1112 * html input tags for this setting field. Use get_option() to retri ve existing1112 * html input tags for this setting field. Use get_option() to retrieve existing 1113 1113 * values to show. 1114 1114 * 1115 1115 * @since 2.7.0 … … 1120 1120 * @param string $title Formatted title of the field. Shown as the label for the field during output. 1121 1121 * @param string $callback Function that fills the field with the desired form inputs. The function should echo its output. 1122 1122 * @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...). 1123 * @param string $section The slug-name of the section of the settings spage in which to show the box (default, ...).1123 * @param string $section The slug-name of the section of the settings page in which to show the box (default, ...). 1124 1124 * @param array $args Additional arguments 1125 1125 */ 1126 1126 function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) { … … 1274 1274 sanitize_option( $setting, get_option($setting)); 1275 1275 1276 1276 // If settings were passed back from options.php then use them 1277 // Ignore transients if $sanitize is true, we don t'want the old values anyway1277 // Ignore transients if $sanitize is true, we don't want the old values anyway 1278 1278 if ( isset($_GET['settings-updated']) && $_GET['settings-updated'] && get_transient('settings_errors') ) { 1279 1279 $settings_errors = get_transient('settings_errors'); 1280 1280 delete_transient('settings_errors'); … … 2159 2159 * false otherwise. Defaults to true 2160 2160 * @param array|string $other_attributes Other attributes that should be output with the button, 2161 2161 * mapping attributes to their values, such as array( 'tabindex' => '1' ). 2162 * These attributes will be ou put as attribute="value", such as tabindex="1".2162 * These attributes will be output as attribute="value", such as tabindex="1". 2163 2163 * Defaults to no other attributes. Other attributes can also be provided as a 2164 2164 * string such as 'tabindex="1"', though the array format is typically cleaner. 2165 2165 */ … … 2180 2180 * false otherwise. Defaults to true 2181 2181 * @param array|string $other_attributes Other attributes that should be output with the button, 2182 2182 * mapping attributes to their values, such as array( 'tabindex' => '1' ). 2183 * These attributes will be ou put as attribute="value", such as tabindex="1".2183 * These attributes will be output as attribute="value", such as tabindex="1". 2184 2184 * Defaults to no other attributes. Other attributes can also be provided as a 2185 2185 * string such as 'tabindex="1"', though the array format is typically cleaner. 2186 2186 */ -
wp-admin/includes/user.php
196 196 * 197 197 * Simple function who's main purpose is to allow filtering of the 198 198 * list of roles in the $wp_roles object so that plugins can remove 199 * in nappropriate ones depending on the situation or user making edits.199 * inappropriate ones depending on the situation or user making edits. 200 200 * Specifically because without filtering anyone with the edit_users 201 201 * capability can edit others to be administrators, even if they are 202 202 * only editors or authors. This filter allows admins to delegate … … 329 329 if ( ! get_user_option('default_password_nag') ) //Short circuit it. 330 330 return; 331 331 332 //get_user_setting = JS saved UI setting. else no-js-fal back code.332 //get_user_setting = JS saved UI setting. else no-js-fallback code. 333 333 if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) { 334 334 delete_user_setting('default_password_nag'); 335 335 update_user_option($user_ID, 'default_password_nag', false, true); -
wp-admin/includes/image.php
138 138 } 139 139 140 140 /** 141 * Calculated the new dimen tions for a downsampled image.141 * Calculated the new dimensions for a downsampled image. 142 142 * 143 143 * @since 2.0.0 144 144 * @see wp_constrain_dimensions() -
wp-admin/includes/class-wp-filesystem-direct.php
89 89 * 90 90 * @param string $file Path to the file. 91 91 * @param mixed $group A group name or number. 92 * @param bool $recursive (optional) If set True changes file group recursiv ly. Defaults to False.92 * @param bool $recursive (optional) If set True changes file group recursively. Defaults to False. 93 93 * @return bool Returns true on success or false on failure. 94 94 */ 95 95 function chgrp($file, $group, $recursive = false) { … … 112 112 * 113 113 * @param string $file Path to the file. 114 114 * @param int $mode (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs. 115 * @param bool $recursive (optional) If set True changes file group recursiv ly. Defaults to False.115 * @param bool $recursive (optional) If set True changes file group recursively. Defaults to False. 116 116 * @return bool Returns true on success or false on failure. 117 117 */ 118 118 function chmod($file, $mode = false, $recursive = false) { … … 140 140 * 141 141 * @param string $file Path to the file. 142 142 * @param mixed $owner A user name or number. 143 * @param bool $recursive (optional) If set True changes file owner recursiv ly. Defaults to False.143 * @param bool $recursive (optional) If set True changes file owner recursively. Defaults to False. 144 144 * @return bool Returns true on success or false on failure. 145 145 */ 146 146 function chown($file, $owner, $recursive = false) { -
wp-admin/includes/class-wp-filesystem-ftpext.php
338 338 } 339 339 340 340 $pwd = @ftp_pwd($this->link); 341 if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesn t exist341 if ( ! @ftp_chdir($this->link, $path) ) // Cant change to folder = folder doesn't exist 342 342 return false; 343 343 $list = @ftp_rawlist($this->link, '-a', false); 344 344 @ftp_chdir($this->link, $pwd); -
wp-admin/includes/class-wp-filesystem-ssh2.php
306 306 } 307 307 308 308 function touch($file, $time = 0, $atime = 0) { 309 //Not impl mented.309 //Not implemented. 310 310 } 311 311 312 312 function mkdir($path, $chmod = false, $chown = false, $chgrp = false) { -
wp-admin/edit-form-comment.php
54 54 55 55 <div class="misc-pub-section curtime misc-pub-section-last"> 56 56 <?php 57 // translators: Publish box date form t, see http://php.net/date57 // translators: Publish box date format, see http://php.net/date 58 58 $datef = __( 'M j, Y @ G:i' ); 59 59 $stamp = __('Submitted on: <b>%1$s</b>'); 60 60 $date = date_i18n( $datef, strtotime( $comment->comment_date ) ); -
wp-admin/menu.php
134 134 $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' ); 135 135 } 136 136 137 // Add 'Editor' to the bottom of the Appear ence menu.137 // Add 'Editor' to the bottom of the Appearance menu. 138 138 if ( ! is_multisite() ) 139 139 add_action('admin_menu', '_add_themes_utility_last', 101); 140 140 function _add_themes_utility_last() {
