mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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: http://svn.automattic.com/wordpress/trunk@20105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e251ff1c04
commit
c973568e76
@ -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…
x
Reference in New Issue
Block a user