Automattic\WooCommerce\Blueprint\ResourceStorages
OrgThemeResourceStorage::get_download_link
Get the download link.
Метод класса: OrgThemeResourceStorage{}
Хуков нет.
Возвращает
string|null. The download link.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_download_link( $slug ): ?string;
- $slug(строка) (обязательный)
- The slug of the theme to be downloaded.
Код OrgThemeResourceStorage::get_download_link() OrgThemeResourceStorage::get download link WC 11.2.2
protected function get_download_link( $slug ): ?string {
$info = $this->wp_themes_api(
'theme_information',
array(
'slug' => $slug,
'fields' => array(
'sections' => false,
),
)
);
if ( is_wp_error( $info ) ) {
return null;
}
if ( isset( $info->download_link ) ) {
return $info->download_link;
}
return null;
}