Allow get_screenshots() to return absolute URLs. Make this the default; relative can be achieved with 'relative' as the argument. see #20103.
git-svn-id: https://develop.svn.wordpress.org/trunk@20105 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
90a115e4b4
commit
3ec423dc93
@ -791,7 +791,7 @@ final class WP_Theme implements ArrayAccess {
|
|||||||
* @since 3.4.0
|
* @since 3.4.0
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
* @param string $uri Type of URL to include, either 'relative' or an absolute URI. Defaults to absolute URI.
|
* @param string $uri Type of URL to return, either 'relative' or an absolute URI. Defaults to absolute URI.
|
||||||
* @return mixed Screenshot file. False if the theme does not have a screenshot.
|
* @return mixed Screenshot file. False if the theme does not have a screenshot.
|
||||||
*/
|
*/
|
||||||
public function get_screenshot( $uri = 'uri' ) {
|
public function get_screenshot( $uri = 'uri' ) {
|
||||||
@ -861,15 +861,18 @@ final class WP_Theme implements ArrayAccess {
|
|||||||
* @since 3.4.0
|
* @since 3.4.0
|
||||||
* @access public
|
* @access public
|
||||||
*
|
*
|
||||||
* @return array Screenshots.
|
* @param string $uri Type of URL to return, either 'relative' or an absolute URI. Defaults to absolute URI.
|
||||||
|
* @return array Screenshots. Empty array if no screenshors are found.
|
||||||
*/
|
*/
|
||||||
public function get_screenshots() {
|
public function get_screenshots( $uri = 'uri' ) {
|
||||||
if ( ! $count = $this->get_screenshot_count() )
|
if ( ! $count = $this->get_screenshot_count() )
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
$screenshots = array( $this->get_screenshot( 'relative' ) );
|
$pre = 'relative' == $uri ? '' : $this->get_stylesheet_directory_uri() . '/';
|
||||||
|
|
||||||
|
$screenshots = array( $pre . $this->get_screenshot( 'relative' ) );
|
||||||
for ( $i = 2; $i <= $count; $i++ )
|
for ( $i = 2; $i <= $count; $i++ )
|
||||||
$screenshots[] = 'screenshot-' . $i . '.png';
|
$screenshots[] = $pre . 'screenshot-' . $i . '.png';
|
||||||
return $screenshots;
|
return $screenshots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user