Changeset 27745
- Timestamp:
- 03/26/2014 06:21:45 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme.php
r27471 r27745 536 536 * 537 537 * @param string $header Theme header. Name, Description, Author, Version, ThemeURI, AuthorURI, Status, Tags. 538 * @return string String on success, false on failure.538 * @return string|bool String on success, false on failure. 539 539 */ 540 540 public function get( $header ) { … … 572 572 * @param bool $markup Optional. Whether to mark up the header. Defaults to true. 573 573 * @param bool $translate Optional. Whether to translate the header. Defaults to true. 574 * @return string Processed header, false on failure.574 * @return string|bool Processed header, false on failure. 575 575 */ 576 576 public function display( $header, $markup = true, $translate = true ) { 577 577 $value = $this->get( $header ); 578 if ( false === $value ) { 579 return false; 580 } 578 581 579 582 if ( $translate && ( empty( $value ) || ! $this->load_textdomain() ) ) -
trunk/tests/phpunit/tests/theme/WPTheme.php
r27710 r27745 129 129 return 'subdir/theme with spaces'; 130 130 } 131 132 /** 133 * @ticket 26873 134 */ 135 function test_display_method_on_get_method_failure() { 136 $theme = new WP_Theme( 'nonexistent', $this->theme_root ); 137 $this->assertEquals( 'nonexistent', $theme->get( 'Name' ) ); 138 $this->assertFalse( $theme->get( 'AuthorURI' ) ); 139 $this->assertFalse( $theme->get( 'Tags' ) ); 140 $this->assertFalse( $theme->display( 'Tags' ) ); 141 } 131 142 }
Note: See TracChangeset
for help on using the changeset viewer.