Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/nandedex/www/wp-content/plugins/wp-whatsapp/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : /home/nandedex/www/wp-content/plugins/wp-whatsapp/includes/Shortcode.php
<?php
namespace NTA_WhatsApp;

use NTA_WhatsApp\Fields;

defined( 'ABSPATH' ) || exit;
class Shortcode {

	protected static $instance = null;
	protected $accountID;

	public static function getInstance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
			self::$instance->doHooks();
		}
		return self::$instance;
	}

	private function doHooks() {
		add_shortcode( 'njwa_button', array( $this, 'button_shortcode' ) );
	}

	public function button_shortcode( $id ) {
		extract( $id );
		$displayOption   = Fields::getWidgetDisplay();
		$stylesOption    = Fields::getWidgetStyles();
		$analyticsOption = Fields::getAnalyticsSetting();

		$script = array(
			'name'          => get_the_title( $id ),
			'info'          => get_post_meta( $id, 'nta_wa_account_info', true ),
			'styles'        => Fields::getButtonStyles( $id ),
			'avatar'        => get_the_post_thumbnail_url( $id ),
			'options'       => array(
				'display'   => $displayOption,
				'styles'    => $stylesOption,
				'analytics' => $analyticsOption,
			),
			'gdprStatus'    => Helper::checkGDPR( $stylesOption ),
			'defaultAvatar' => NTA_WHATSAPP_PLUGIN_URL . 'assets/img/whatsapp_logo.svg',
		);

		$content = '<div class="nta_wa_button" data-id="' . esc_attr( $id ) . '" data-info="' . esc_attr( wp_json_encode( $script ) ) . '"></div>';

		return $content;
	}
}

F1le Man4ger