Making WordPress.org


Ignore:
Timestamp:
07/02/2014 07:55:53 PM (10 years ago)
Author:
coffee2code
Message:

Code Reference: once one optional parameter is encountered the rest are optional as well, even if the declaration is missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r736 r737  
    474474
    475475        if ( $tags ) {
     476            $encountered_optional = false;
    476477            foreach ( $tags as $tag ) {
    477478                if ( 'param' == $tag['name'] ) {
     
    484485                        $params[ $tag['variable'] ]['required'] = 'Optional';
    485486                        $params[ $tag['variable'] ]['content'] = substr( $tag['content'], 10 );
     487                        $encountered_optional = true;
     488                    } elseif ( $encountered_optional ) {
     489                        $params[ $tag['variable'] ]['required'] = 'Optional';
    486490                    } else {
    487491                        $params[ $tag['variable'] ]['required'] = 'Required';
Note: See TracChangeset for help on using the changeset viewer.