Changes between Initial Version and Version 1 of Ticket #22325, comment 20
- Timestamp:
- 11/02/12 21:36:13 (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #22325, comment 20
initial v1 72 72 > // vs: 73 73 > if ( _check( _get( 'myVar' ), 'default value' ) ) 74 > }}} 74 75 75 76 This adds even more surface area to WordPress. There's a cost in terms of runtime overhead, and learning; everyone will need to learn what `_check()` does. People who are familiar with PHP don't have to learn this: … … 85 86 In the case of the proposed `_GET()`, we'd already be are adding it so we can kill three (3) birds with one stone; #2: Be graceful when $_GET['foo'] doesn't exist, and #3: Allow us to add a default value when we need one. 86 87 88 > {{{ 87 89 > // vs: 88 90 > if ( _GET( 'myVar', 'default value' ) != 'default value' ) … … 94 96 95 97 {{{ 96 >if ( _GET( 'myVar' ) != 'default value' )98 if ( _GET( 'myVar' ) != 'default value' ) 97 99 }}} 98 100 99 101 > And finally to output the value: 100 102 > 103 > {{{ 101 104 > // vs: 102 105 > echo _default( _get( 'myVar'), 'default value' );
