WC_WCCOM_Site_Installation_Step_Activate_Product::get_wporg_product_dir_name
Get WP.org product directory name.
Method of the class: WC_WCCOM_Site_Installation_Step_Activate_Product{}
No Hooks.
Returns
String|false.
Usage
// private - for code of main (parent) class only $result = $this->get_wporg_product_dir_name();
WC_WCCOM_Site_Installation_Step_Activate_Product::get_wporg_product_dir_name() WC WCCOM Site Installation Step Activate Product::get wporg product dir name code WC 10.8.1
private function get_wporg_product_dir_name() {
if ( empty( $this->state->get_installed_path() ) ) {
return false;
}
// Check whether product was downloaded from WordPress.org.
$download_url = $this->state->get_download_url();
$parsed_url = wp_parse_url( $download_url );
if ( ! empty( $parsed_url['host'] ) && 'downloads.wordpress.org' !== $parsed_url['host'] ) {
return false;
}
return basename( $this->state->get_installed_path() );
}