PluginProbe ʕ •ᴥ•ʔ
WP Chat App / trunk
WP Chat App vtrunk
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 months ago Woocommerce.php 2 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 protected $isActive = false;
11
12 public static function getInstance() {
13 if ( null === self::$instance ) {
14 self::$instance = new self();
15 self::$instance->doHooks();
16 }
17 return self::$instance;
18 }
19
20 private function doHooks() {
21 global $sitepress;
22
23 if ( $sitepress !== null && get_class( $sitepress ) === 'SitePress' ) {
24 $settings = $sitepress->get_setting( 'custom_posts_sync_option', array() );
25 $post_type = 'whatsapp-accounts';
26 if ( isset( $settings[ $post_type ] ) && ( $settings[ $post_type ] == 1 || $settings[ $post_type ] == 2 ) ) {
27 $this->isActive = true;
28 add_filter( 'njt_wa_get_post_type', array( $this, 'getPostType' ), 10, 1 );
29 }
30 }
31 }
32
33 public function getPostType( $args ) {
34 $args['suppress_filters'] = false;
35 return $args;
36 }
37 }
38