get_file_handlers() as $slug => $handler ) { if ( ! in_array( $uploaded_file->get_mime_type(), $handler['mime_types'] ) ) { continue; } if ( ! is_callable( $handler['constructor'] ) ) { continue; } $instance = call_user_func( $handler['constructor'] ); if ( ! is_object( $instance ) ) { continue; } return $instance; } $message = _x( 'There is no file handler for this kind of file (). Aborting.', 'file uploads', 'another-wordpress-classifieds-plugin' ); $message = str_replace( '', $uploaded_file->get_mime_type(), $message ); throw new AWPCP_Exception( $message ); } public function get_file_handlers() { if ( is_null( $this->handlers ) ) { $this->handlers = apply_filters( 'awpcp-file-handlers', array() ); } return $this->handlers; } }