/**
  * Appends current variation id onto a URL
  *
  * @param link STRING URL that param will be appended onto
  * 
  *
  * @return STRING modified URL.
  */
 public static function append_variation_id_to_url($link)
 {
     global $post;
     if (!isset($post) || $post->post_type != 'wp-call-to-action') {
         return $link;
     }
     $current_variation_id = CTA_Variations::get_current_variation_id();
     $link = add_query_arg(array('wp-cta-variation-id' => $current_variation_id), $link);
     return $link;
 }
 /**
  * Renders shortcode data for user to copy for user
  */
 public static function add_hidden_inputs()
 {
     global $post, $CTA_Variations;
     if (!$post || $post->post_type != 'wp-call-to-action') {
         return;
     }
     /* Add hidden param for visual editor */
     if (isset($_REQUEST['frontend']) && $_REQUEST['frontend'] == 'true') {
         echo '<input type="hidden" name="frontend" id="frontend-on" value="true" />';
     }
     /* Get current variation id */
     $vid = CTA_Variations::get_current_variation_id();
     /* Add variation status */
     $variations_status = $CTA_Variations->get_variation_status($post->ID, $vid);
     echo '<input type="hidden" name="wp-cta-variation-status[' . $vid . ']" value = "' . $variations_status . '">';
     /* Add variation id */
     echo '<input type="hidden" name="wp-cta-variation-id" id="open_variation" value = "' . $vid . '">';
     /* Add call to action permalink */
 }