[wp-trac] [WordPress Trac] #19342: Call to undefined function convert_to_screen when using plugins with custom meta boxes

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 25 08:12:32 UTC 2011


#19342: Call to undefined function convert_to_screen when using plugins with custom
meta boxes
------------------------------+---------------------
 Reporter:  jackdewey         |       Owner:  rboren
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  3.3
Component:  Template          |     Version:  3.3
 Severity:  major             |  Resolution:  fixed
 Keywords:  has-patch commit  |
------------------------------+---------------------

Comment (by mikeschinkel):

 Replying to [comment:11 dd32]:
 > In general, for any admin file, outside of an admin context is bad
 practice, you shouldn't need to include files, except for certain files
 which are not normally loaded, such as wp-admin/includes/upgrade.php

 Thanks for the quick reply. So basically the answer is conceptually
 ''"everything in an admin file should only be needed in admin so that's
 why it's bad form to add outside of admin"'', correct? Of course, there's
 concept and reality, such as `image.php`, also correct?

 So is `require_once()` okay ''within'' `/wp-admin` when not already
 loaded?

 > image.php is a silly one, The image manipulation functions shouldn't
 really be in admin includes IMO, and as you know, if you need to do image
 alterations outside of the admin, you currently need to include it.
 Hopefully that can change whenever media is touched again.

 Does it make sense to make a ticket for moving the image functions
 outside?

 > That being said, You certainly shouldn't be performing image
 manipulation or database schema alterations in a front end request, it
 should be deferred until the admin is viewed, or to a cron entry or
 similar..

 Only?  I have image handling code that generates a sized image the first
 time one is called by URL, which can be a front-end URL, and it only ever
 generates the one file requested, and only the first time requested. So
 only files that are used are ever generated, unlike WordPress core which
 generates every size for every image upon upload.  Do you assert that I'm
 doing it wrong with this approach?  If I'm not mistake I've heard Otto say
 he wants to see generation of sized images on demand.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19342#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list