[wp-trac] Re: [WordPress Trac] #6834: More descriptive create directory/copy errors in file.php

WordPress Trac wp-trac at lists.automattic.com
Fri Apr 25 03:02:24 GMT 2008


#6834: More descriptive create directory/copy errors in file.php
-------------------------------------+--------------------------------------
 Reporter:  plankers                 |        Owner:  anonymous
     Type:  enhancement              |       Status:  new      
 Priority:  normal                   |    Milestone:  2.7      
Component:  Administration           |      Version:  2.5      
 Severity:  normal                   |   Resolution:           
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by DD32):

 You cannot use Variables within translate functions( __(), _e() )

 Instead you need to use things such as:{{{
 return new WP_Error('mkdir_failed', sprintf(__('Could not create
 directory: %s', $to . $tmppath));
 }}
 (Thats just an example).

 Another option is to pass the error data along with the WP Error:
 {{{
 return new WP_Error('mkdir_failed', __('Could not create directory'), $to
 . $tmppath );
 }}}

 The updater message will show "Could not create directory: $errordata"

 I agree that it needs to be a bit more verbose.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6834#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list