acf_get_home_url()
An ACF specific getter to replace home_url our license checks to ensure we can avoid third party filters.
Хуков нет.
Возвращает
Строку. $home_url The output from home_url, sans known third party filters which cause license activation issues.
Использование
acf_get_home_url();
Список изменений
| С версии 6.0.1 | Введена. |
| С версии 6.2.8 | - Renamed to acf_pro_get_home_url to match pro exclusive function naming. |
| С версии 6.3.10 | - Renamed to acf_get_home_url now updater logic applies to free. |
Код acf_get_home_url() acf get home url ACF 6.4.2
function acf_get_home_url() {
if ( acf_is_pro() ) {
// Disable WPML and TranslatePress's home url overrides for our license check.
add_filter( 'wpml_get_home_url', 'acf_pro_license_ml_intercept', 99, 2 );
add_filter( 'trp_home_url', 'acf_pro_license_ml_intercept', 99, 2 );
if ( acf_pro_is_legacy_multisite() && acf_is_multisite_sub_site() ) {
$home_url = get_home_url( get_main_site_id() );
} else {
$home_url = home_url();
}
// Re-enable WPML and TranslatePress's home url overrides.
remove_filter( 'wpml_get_home_url', 'acf_pro_license_ml_intercept', 99 );
remove_filter( 'trp_home_url', 'acf_pro_license_ml_intercept', 99 );
} else {
$home_url = home_url();
}
return $home_url;
}