function alo_em_placeholders_replace_customlink_tag($content, $newsletter, $recipient, $stop_recursive_the_content = false) { if (!is_object($recipient)) { $recipient = new stdClass(); } if (empty($recipient->lang)) { $recipient->lang = alo_em_short_langcode(get_locale()); } if (preg_match_all('/\\[CUSTOM-LINK(.*)\\]/i', $content, $matches, PREG_SET_ORDER)) { if (is_array($matches)) { foreach ($matches as $match) { // Complete palceholder $found = $match[0]; // Placeholder attributes $atts = shortcode_parse_atts(trim($match[1])); $params = shortcode_atts(array('href' => '', 'title' => '', 'tracking' => 1, 'class' => 'alo-easymail-link', 'style' => ''), $atts); if (empty($params['href'])) { continue; } // skip if 'href' is empty // Numeric = post ID if (is_numeric($params['href'])) { if ($obj_post = get_post($params['href'])) { $title = !empty($params['title']) ? stripslashes($params['title']) : stripslashes(alo_em_translate_text($recipient->lang, $obj_post->post_title, $obj_post->ID, 'post_title')); $link = alo_em_translate_url($obj_post->ID, $recipient->lang); } } else { $title = !empty($params['title']) ? stripslashes($params['title']) : esc_url($params['href']); $link = esc_url($params['href']); } if ($params['tracking'] == 1) { $link = alo_em_make_url_trackable($recipient, $link); } $content = str_replace($found, '<a href="' . $link . '" class="' . esc_attr($params['class']) . '" style="' . esc_attr($params['style']) . '">' . $title . '</a>', $content); } } } return $content; }
$end = get_post_meta($newsletter, "_easymail_completed", current_time('mysql', 0)); echo $end ? date_i18n(__('j M Y @ G:i', "alo-easymail"), strtotime($end)) : __("No", "alo-easymail"); ?> </dd> </dl> <dl> <dt><?php _e("Main body", "alo-easymail"); ?> (<?php _e("without formatting", "alo-easymail"); ?> ):</dt> <dd id="mailbody"> <?php echo strip_tags(alo_em_translate_text($lang, $newsletter_post->post_content), "<img>"); //echo apply_filters('the_content', $newsletter_post->post_content ) ?> </dd> </dl> </div> <!-- Newsletter's recipients list --> <div id="par-2"> <?php // If archived if ($archived_raw = alo_em_is_newsletter_recipients_archived($newsletter)) { $archived_meta = $archived_raw[0]; $tot_recipients = $archived_meta['tot']; $already_sent = $archived_meta['sent'];