[wp-trac] [WordPress Trac] #46555: update fails when I have a print statement in my code.

WordPress Trac noreply at wordpress.org
Mon Mar 18 18:12:42 UTC 2019


#46555: update fails when I have a print statement in my code.
-------------------------------+------------------------------
 Reporter:  rweil55            |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  5.1
 Severity:  minor              |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by rweil55):

 I had some shortcode code that instead of returning output for wordpress
 to display, it had a "print" statement to send some debugging text to the
 browser.  i.e sending output directly to the browser rather than through
 wordpress.

 Obviously a no-no, but it took me a while to figure out that was what was
 causing the "update failed" message.

 Here is a short code function that will cause the message. Remove the
 print statement, and no message.
 function dothework($atts) {
    print "hello world - should not do this";
    return "this is the right way";
 }

 Hope this helps
 Roy

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46555#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list