Skip to content

Commit

Permalink
#4332 themify compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Zabi09 committed Apr 2, 2020
1 parent fcadcc6 commit 5861948
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -8366,3 +8366,26 @@ function ampforwp_set_local_font(){
}
}

if (function_exists('themify_builder_activate')) {
add_filter('ampforwp_modify_the_content','ampforwp_themify_compatibility');
}
function ampforwp_themify_compatibility($content){
$get_data = get_post_meta(ampforwp_get_the_ID(),'_themify_builder_settings_json',true);
$decode = json_decode($get_data,true);
for($i=0;$i<count($decode);$i++){
$cols = $decode[$i]['cols'];
for($j=0;$j<count($cols);$j++){
if (isset($cols[$j]['modules'])) {
$modules = $cols[$j]['modules'];
for($k=0;$k<count($modules);$k++){
foreach ($modules as $key => $value) {
foreach ($value['mod_settings'] as $key => $val) {
$content.=$val;
}
}
}
}
}
}
return $content;
}

0 comments on commit 5861948

Please sign in to comment.