<?php 
/**
 * @package WordPress
 * @subpackage Campoal
 */

global $post;
global $campoal_options;

$post_type = get_post_type($post->ID);
if ($post_type != 'petition' && $post_type != 'give_forms') {
    $petition_id = get_post_meta($post->ID, $post_type . '_post_id', true);
} else {
    $petition_id = $post->ID;
}

$copiable_url       = conikal_get_shorten_link($petition_id);
?>

<div class="ui divider"></div>
<div class="ui right action left icon fluid small input">
    <i class="linkify icon"></i>
    <input type="text" class="short-link" id="short-link<?php echo esc_attr($petition_id) ?>" data-id="<?php echo esc_attr($petition_id) ?>" value="<?php echo esc_attr($copiable_url); ?>" data-load="0" readonly>
    <button class="ui basic button copy-link" id="copy-link<?php echo esc_attr($petition_id) ?>" data-id="<?php echo esc_attr($petition_id) ?>"><i class="copy icon"></i><?php esc_html_e('Copy', 'campoal') ?></button>
</div>
<div id="msg-copy<?php echo esc_attr($petition_id) ?>"></div>