PluginProbe ʕ •ᴥ•ʔ
WP Chat App / 3.4
WP Chat App v3.4
3.8.1 3.8.2 trunk 2.6 3.4 3.4.1 3.4.2 3.4.4 3.4.5 3.4.6 3.5 3.6 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0
wp-whatsapp / includes / Support / WPML.php
wp-whatsapp / includes / Support Last commit date
WPML.php 3 years ago Woocommerce.php 3 years ago
WPML.php
38 lines
1 <?php
2 namespace NTA_WhatsApp\Support;
3
4 defined('ABSPATH') || exit;
5
6 class WPML
7 {
8 protected static $instance = null;
9
10 public static function getInstance()
11 {
12 if (null == self::$instance) {
13 self::$instance = new self;
14 self::$instance->doHooks();
15 }
16 return self::$instance;
17 }
18
19 private function doHooks(){
20 global $sitepress;
21
22 if ($sitepress !== null && get_class($sitepress) === 'SitePress') {
23 $settings = $sitepress->get_setting('custom_posts_sync_option', array());
24 $post_type = 'whatsapp-accounts';
25 if (isset($settings[$post_type]) && ($settings[$post_type] == 1 || $settings[$post_type] == 2)) {
26 $this->isActive = true;
27 add_filter('njt_wa_get_post_type', array($this, 'getPostType'), 10, 1);
28 }
29 }
30 }
31
32 public function getPostType($args)
33 {
34 $args['suppress_filters'] = false;
35 return $args;
36 }
37 }
38