Exemplo n.º 1
0
 /**
  * @return array
  */
 public function description()
 {
     $cardDescription = $this->opts['twitterPostPageDesc'];
     if ($this->post_ID) {
         $cardDescription = Utilities::get_excerpt_by_id($this->post_ID);
         if (!empty($this->opts['twitterCardDesc'])) {
             $desc = get_post_meta($this->post_ID, $this->opts['twitterCardDesc'], true);
             $cardDescription = !empty($desc) ? htmlspecialchars(stripcslashes($desc)) : Utilities::get_excerpt_by_id($this->post_ID);
         } elseif (empty($this->opts['twitterCardDesc']) && (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack'))) {
             $cardDescription = $this->get_seo_plugin_datas('desc');
         }
     }
     $cardDescription = Utilities::remove_lb($cardDescription);
     return array('description' => apply_filters('jm_tc_get_excerpt', $cardDescription));
 }
Exemplo n.º 2
0
 /**
  * @param $lb
  *
  * @return string
  */
 function jm_tc_remove_lb($lb)
 {
     return \TokenToMe\TwitterCards\Utilities::remove_lb($lb);
 }