Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #48035


Ignore:
Timestamp:
09/14/2019 06:46:47 AM (6 years ago)
Author:
SergeyBiryukov
Comment:

Hi there, welcome to WordPress Trac! Thanks for the ticket.

I agree with the comment above.

This looks similar to the discussions in #17299, #18927, #23767, and #27489 (those tickets are unrelated to this particular function, but they suggest a similar enhancement for other functions). The consensus was that we should not hide warnings caused by developer errors, unless there is a strong reason. It would just make debugging harder.

If a valid parameter generates a warning, we should certainly fix that. However, in case of an invalid parameter, I think the warning is to be expected.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #48035

    • Property Status changed from new to closed
    • Property Resolution changed from to wontfix
    • Property Milestone changed from Awaiting Review to
  • Ticket #48035 – Description

    initial v2  
    11Function 'shortcode_regex( $tagnames = null )' expects an array. But if the users enters a string it triggers an php warning error. It's would be better to just type set the parameter to an array. For example:
    22
    3 
     3{{{
    44function get_shortcode_regex( $tagnames = null ) {
    55        global $shortcode_tags;
     
    99        if ( empty( $tagnames ) ) {
    1010//....more core code
    11 
     11}}}
    1212source: includes/shortcodes.php