* @license https://pratikchaskar.com/ * @link https://pratikchaskar.com/ */ /** * Custom modules */ if ( ! class_exists( 'CS_Currency_Shortcode' ) ) { /** * Class define for currency convert shortcode. * * @class CS_Currency_Shortcode * @category PHP * @package Currency_Switcher * @author Display Name * @license https://pratikchaskar.com/ * @link https://pratikchaskar.com/ */ class CS_Currency_Shortcode { /** * Constructor */ public function __construct() { add_shortcode( 'currency', array( $this, 'cswp_advance_currency_switch' ) ); } /** * Define Currency_Switcher. * * @param string $atts The text to be formatted. * * @since 1.0.0 * @return return ob_get_clean(). */ public function cswp_advance_currency_switch( $atts ) { $attributes = shortcode_atts( array( 'value' => '', ), $atts ); $getval = (float) $attributes['value']; $price_convert = (float) $attributes['value']; ob_start(); ?>