File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
visualcomposer/Modules/Vendors/Plugins Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,13 @@ protected function initialize(Request $requestHelper)
105
105
);
106
106
107
107
$ this ->addFilter ('vcv:frontend:renderContent ' , 'applyObjectId ' );
108
+
109
+ $ this ->wpAddFilter (
110
+ 'wpml_pb_should_body_be_translated ' ,
111
+ 'blockBodyTranslations ' ,
112
+ 10 ,
113
+ 2
114
+ );
108
115
}
109
116
110
117
/**
@@ -593,4 +600,24 @@ protected function applyObjectId($sourceId)
593
600
true
594
601
);
595
602
}
603
+
604
+ /**
605
+ * Prevent body translations for vcv posts.
606
+ * We use it in some specific wpml cases to prevent some duplicate translation
607
+ * that take additional credits from users
608
+ *
609
+ * @param bool $isBodyTranslate
610
+ * @param \WP_Post $post
611
+ *
612
+ * @return bool
613
+ */
614
+ protected function blockBodyTranslations ($ isBodyTranslate , $ post )
615
+ {
616
+ $ frontendHelper = vchelper ('Frontend ' );
617
+ if (empty ($ post ->ID ) || ! $ frontendHelper ->isVcvPost ($ post ->ID )) {
618
+ return $ isBodyTranslate ;
619
+ }
620
+
621
+ return false ;
622
+ }
596
623
}
You can’t perform that action at this time.
0 commit comments