Changeset 3102915
- Timestamp:
- 06/14/2024 08:09:00 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dailystory/trunk/includes/class-dailystory-shortcodes.php
r3067059 r3102915 19 19 // Add the [ds-popup] shortcode 20 20 add_shortcode('ds-popup', array( 'DailyStoryShortCodes', 'dailystory_popup_shortcode' )); 21 // Add the [ds-test] shortcode22 add_shortcode('ds-test', array( 'DailyStoryShortCodes', 'dailystory_webform_test' ));23 24 21 } 25 22 } … … 98 95 99 96 // override default attributes with user attributes 100 $webform_id = shortcode_atts(['id' => '0',], $atts, $tag); 101 $webform_id = esc_html__($webform_id['id'], 'ds-webform') ; 97 $atts = shortcode_atts(['id' => '0', 'redirect_url' => ''], $atts); 98 $webform_id = esc_html__($atts['id'], 'ds-webform'); 99 $redirect_url = esc_url_raw($atts['redirect_url']); 100 102 101 // Add the script reference, pulled from DailyStory, but eventually will be served from a CDN 103 102 wp_register_script('ds-landingpages', 'https://pages.dailystory.com/bundles/dailystory-landingpage', null,'2.0.6', true); 104 103 wp_enqueue_script('ds-landingpages'); 104 105 105 // enqueue css 106 106 wp_enqueue_style('ds-webform','https://forms.dailystory.com/content/hosted-webform-min', null, '2.0.6', 'all'); 107 // get the tenant uid 107 108 // get the tenant uid 108 109 $options = get_option('dailystory_settings'); 109 110 $tenantuid = $options['dailystory_tenant_uid']; 111 112 // Build the URL with query string 113 $url = 'https://forms.dailystory.com/webform/' . $tenantuid . '/' . $webform_id; 114 if (!empty($redirect_url)) { 115 $url = add_query_arg('redirectUrl', $redirect_url, $url); 116 } 117 110 118 // get the contents 111 list($cc_result, $cc_error) = self::get_data('https://forms.dailystory.com/webform/' . $tenantuid . '/' . $webform_id); 119 list($cc_result, $cc_error) = self::get_data($url); 120 112 121 return $cc_result; 113 } 114 122 } 115 123 } 116 124 ?>
Note: See TracChangeset
for help on using the changeset viewer.