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