Exemplo n.º 1
0
 /**
  *
  * @since 2.0.0
  *
  * @param $value
  * @return string
  */
 protected function convert_html_string_to_markdown($value)
 {
     if (is_string($value) and strpos($value, '<') !== false) {
         return Prompt_Html_To_Markdown::convert($value);
     }
     return $value;
 }
 public static function render_text($comment, $args, $depth)
 {
     self::set_context($comment);
     echo self::indent('', $depth);
     echo self::indent('- ' . $comment->comment_author . ' -', $depth);
     echo self::indent(Prompt_Html_To_Markdown::convert(wpautop($comment->comment_content)), $depth);
     if (comments_open($comment->comment_post_ID)) {
         echo self::indent(sprintf('%1$s: mailto:{{{reply_to_comment_%2$s}}}?subject=%3$s', sprintf(__('Reply to %s', 'Postmatic'), $comment->comment_author), $comment->comment_ID, rawurlencode(__('Reply', 'Postmatic'))), $depth);
     }
 }
 /**
  * Get Postmatic's text version of the current post content.
  * @return mixed|string
  */
 public function get_the_text_content()
 {
     $this->ensure_setup();
     $prompt_post = new Prompt_Post($this->post);
     $text = $prompt_post->get_custom_text();
     if ($text) {
         return $text;
     }
     if (Prompt_Admin_Delivery_Metabox::excerpt_only($prompt_post->id())) {
         return Prompt_Html_To_Markdown::convert(get_the_excerpt());
     }
     $html = apply_filters('the_content', get_the_content());
     $html = str_replace(']]>', ']]&gt;', $html);
     return Prompt_Html_To_Markdown::convert($html);
 }
Exemplo n.º 4
0
<h2><?php 
_e("What's next?", 'Postmatic');
?>
</h2>

<p>
	<?php 
printf(__('Keep an eye on your inbox for content from %s.', 'Postmatic'), $object->subscription_object_label());
?>
</p>

<p>
	<?php 
if ($object instanceof Prompt_Site or $object instanceof Prompt_User) {
    echo Prompt_Html_To_Markdown::convert($subscribed_introduction);
} elseif ($comments) {
    _e('The conversation so far is included below.', 'Postmatic');
}
?>
</p>

<?php 
if ($comments) {
    ?>

	<h2><?php 
    _e("Here is the discussion so far", 'Postmatic');
    ?>
</h2>
Exemplo n.º 5
0
 /**
  * If text is missing, set it to markdown of HTML. If HTML is missing, set it to the text.
  *
  * @since 2.0.0
  *
  */
 protected function fill_in_missing_content_type()
 {
     if (!isset($this->batch_message_template['text_content']) and isset($this->batch_message_template['html_content'])) {
         $html = preg_replace('@<(head|script|style)[^>]*?>.*?</\\1>@si', '', $this->batch_message_template['html_content']);
         $text = Prompt_Html_To_Markdown::convert($html);
         $this->batch_message_template['text_content'] = strip_tags($text);
     }
     if (!isset($this->batch_message_template['html_content']) and isset($this->batch_message_template['text_content'])) {
         $this->batch_message_template['html_content'] = $this->batch_message_template['text_content'];
     }
 }
 /**
  * @return string
  */
 protected function resend_notice_text()
 {
     return Prompt_Html_To_Markdown::convert($this->resend_notice_html());
 }