Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_upload_error

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
4929                return $this->error;
4930
4931           do_action('xmlrpc_call', 'metaWeblog.newMediaObject');
4932
4933           if ( !current_user_can('upload_files') ) {
4934                $this->error = new IXR_Error( 401, __( 'You do not have permission to upload files.' ) );
4935                return $this->error;
4936           }
4937
4938           if ( $upload_err = apply_filters( 'pre_upload_error', false ) )
4939                return new IXR_Error(500, $upload_err);
4940
4941           if ( !empty($data['overwrite']) && ($data['overwrite'] == true) ) {
4942                // Get postmeta info on the object.
4943                $old_file = $wpdb->get_row("
4944                     SELECT ID
4945                     FROM {$wpdb->posts}
4946                     WHERE post_title = '{$name}'
4947                          AND post_type = 'attachment'