Changeset 27672
- Timestamp:
- 03/24/2014 02:44:17 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r27546 r27672 195 195 * 196 196 * @uses wp_handle_upload_error 197 * @uses apply_filters198 197 * @uses is_multisite 199 198 * @uses wp_check_filetype_and_ext … … 215 214 } 216 215 216 /** 217 * Filter data for the current file to upload. 218 * 219 * @since 2.9.0 220 * 221 * @param array $file An array of data for a single file. 222 */ 217 223 $file = apply_filters( 'wp_handle_upload_prefilter', $file ); 218 224 … … 326 332 delete_transient( 'dirsize_cache' ); 327 333 334 /** 335 * Filter the data array for the uploaded file. 336 * 337 * @since 2.1.0 338 * 339 * @param array $upload { 340 * Array of upload data. 341 * 342 * @type string $file Filename of the newly-uploaded file. 343 * @type string $url URL of the uploaded file. 344 * @type string $type File type. 345 * } 346 * @param string $context The type of upload action. Accepts 'upload' or 'sideload'. 347 */ 328 348 return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'upload' ); 329 349 } … … 337 357 * 338 358 * @uses wp_handle_upload_error 339 * @uses apply_filters340 359 * @uses wp_check_filetype_and_ext 341 360 * @uses current_user_can … … 451 470 $url = $uploads['url'] . "/$filename"; 452 471 472 /** This filter is documented in wp-admin/includes/file.php */ 453 473 $return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ), 'sideload' ); 454 474 … … 544 564 545 565 // Unzip can use a lot of memory, but not this much hopefully 566 /** This filter is documented in wp-admin/admin.php */ 546 567 @ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) ); 547 568 … … 567 588 } 568 589 569 if ( class_exists('ZipArchive') && apply_filters('unzip_file_use_ziparchive', true ) ) { 590 /** 591 * Filter whether to use ZipArchive to unzip archives. 592 * 593 * @since 3.0.0 594 * 595 * @param bool $ziparchive Whether to use ZipArchive. Default true. 596 */ 597 if ( class_exists( 'ZipArchive' ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) { 570 598 $result = _unzip_file_ziparchive($file, $to, $needed_dirs); 571 599 if ( true === $result ) { … … 844 872 845 873 if ( ! class_exists("WP_Filesystem_$method") ) { 846 $abstraction_file = apply_filters('filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method); 874 875 /** 876 * Filter the path for a specific filesystem method class file. 877 * 878 * @since 2.6.0 879 * 880 * @see get_filesystem_method() 881 * 882 * @param string $path Path to the specific filesystem method class file. 883 * @param string $method The filesystem method to use. 884 */ 885 $abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method ); 886 847 887 if ( ! file_exists($abstraction_file) ) 848 888 return; … … 916 956 if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; 917 957 if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread 918 return apply_filters('filesystem_method', $method, $args); 958 959 /** 960 * Filter the filesystem method to use. 961 * 962 * @since 2.6.0 963 * 964 * @param string $method Filesystem method to return. 965 * @param array $args An array of connection details for the method. 966 */ 967 return apply_filters( 'filesystem_method', $method, $args ); 919 968 } 920 969 … … 937 986 */ 938 987 function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false, $extra_fields = null) { 988 989 /** 990 * Filter the filesystem credentials form output. 991 * 992 * Returning anything other than an empty string will effectively short-circuit 993 * output of the filesystem credentials form, returning that value instead. 994 * 995 * @since 2.5.0 996 * 997 * @param mixed $output Form output to return instead. Default empty. 998 * @param string $form_post URL to POST the form to. 999 * @param string $type Chosen type of filesystem. 1000 * @param bool $error Whether the current request has failed to connect. 1001 * Default false. 1002 * @param string $context Full path to the directory that is tested for 1003 * being writable. 1004 * @param array $extra_fields Extra POST fields. 1005 */ 939 1006 $req_cred = apply_filters( 'request_filesystem_credentials', '', $form_post, $type, $error, $context, $extra_fields ); 940 1007 if ( '' !== $req_cred ) … … 1015 1082 $types[ 'ssh' ] = __('SSH2'); 1016 1083 1017 $types = apply_filters('fs_ftp_connection_types', $types, $credentials, $type, $error, $context); 1084 /** 1085 * Filter the connection types to output to the filesystem credentials form. 1086 * 1087 * @since 2.9.0 1088 * 1089 * @param array $types Types of connections. 1090 * @param array $credentials Credentials to connect with. 1091 * @param string $type Chosen filesystem method. 1092 * @param object $error Error object. 1093 * @param string $context Full path to the directory that is tested 1094 * for being writable. 1095 */ 1096 $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context ); 1018 1097 1019 1098 ?> -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r27554 r27672 4996 4996 'type' => $type 4997 4997 ); 4998 4999 /** This filter is documented in wp-admin/includes/file.php */ 4998 5000 return apply_filters( 'wp_handle_upload', $struct, 'upload' ); 4999 5001 }
Note: See TracChangeset
for help on using the changeset viewer.