Merge pull request #9884 from aliaksei-tsaruk/wordpress

LAW-8010
This commit is contained in:
bivis
2024-11-29 08:52:21 +03:00
committed by GitHub

View File

@@ -176,7 +176,7 @@ function getFaaTaxonomyIds()
$tIds = [];
foreach ($posts as $post) {
$taxonomies = get_the_terms($post, 'fac_category_type');
if (count($taxonomies) > 0) {
if (is_countable($taxonomies) && count($taxonomies) > 0) {
foreach ($taxonomies as $taxonomy) {
if (!in_array($taxonomy->term_id, $tIds)) {
$tIds[] = $taxonomy->term_id;
@@ -226,16 +226,19 @@ function get_lawcarta_url(){
}
$host = implode('.', $hostParts);
//Fix for staging env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){
$host = str_replace('staging-law', 'staging-live',$host);
}
//Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == 'prod-live'){
$host = str_replace('prod-law', 'prod-live',$host);
}
//Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == ''){
$host = str_replace('app-law', 'app',$host);
if (isset($wp_sub_domain)) {
if(LAWCARTA_ENVIRONMENT_NAME == 'staging' && $wp_sub_domain == 'staging-live'){
$host = str_replace('staging-law', 'staging-live',$host);
}
//Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == 'prod-live'){
$host = str_replace('prod-law', 'prod-live',$host);
}
//Temporary fix for new prod env because of it use same domain carta.live for both lawcarta/livecarta
if(LAWCARTA_ENVIRONMENT_NAME == 'prod' && $wp_sub_domain == ''){
$host = str_replace('app-law', 'app',$host);
}
}
}