null ), $shortcode_attrs ); $type = $parsed_attributes['type']; if ( ! isset( $type ) ) { return; } switch ( $type ) { case 'form': return self::render_form( $shortcode_attrs ); case 'cta': return self::render_cta( $shortcode_attrs ); case 'meeting': return self::render_meeting( $shortcode_attrs ); } } /** * Render form leadin shortcodes * * @param array $attrs Shortcode attributes. */ private static function render_form( $attrs ) { $parsed_attributes = shortcode_atts( array( 'portal' => null, 'id' => null, ), $attrs ); $portal_id = $parsed_attributes['portal']; $id = $parsed_attributes['id']; if ( ! isset( $portal_id ) || ! isset( $id ) || ! is_numeric( $portal_id ) || ! ( self::is_valid_uuid( $id ) || is_numeric( $id ) ) ) { return; } $form_div_uuid = self::generate_div_uuid(); $hublet = LeadinFilters::get_leadin_hublet(); AssetsManager::enqueue_forms_script(); return '
'; } /** * Render cta leadin shortcodes * * @param array $attrs Shortcode attributes. */ private static function render_cta( $attrs ) { $parsed_attributes = shortcode_atts( array( 'portal' => null, 'id' => null, ), $attrs ); $portal_id = $parsed_attributes['portal']; $id = $parsed_attributes['id']; if ( ! isset( $portal_id ) || ! isset( $id ) || ! is_numeric( $portal_id ) || ! ( self::is_valid_uuid( $id ) || is_numeric( $id ) ) ) { return; } return '