コード例 #1
0
ファイル: twitter.php プロジェクト: sekane81/ratoninquietoweb
 /**
  * Any additional parameters that should be passed with a broadcast.
  *
  * @static
  * @return array
  */
 public function get_broadcast_extras($account_id, $post, $args = array())
 {
     if (isset($_POST['social_account_in_reply_to']) && isset($_POST['social_account_in_reply_to'][$this->key()]) && !empty($_POST['social_account_in_reply_to'][$this->key()][$account_id])) {
         $id = $this->tweet_url_to_id(stripslashes($_POST['social_account_in_reply_to'][$this->key()][$account_id]));
         if (!empty($id)) {
             $args['in_reply_to_status_id'] = $id;
         }
     }
     return parent::get_broadcast_extras($account_id, $post, $args);
 }
コード例 #2
0
 /**
  * Any additional parameters that should be passed with a broadcast.
  *
  * @static
  * @return array
  */
 public function get_broadcast_extras($account_id, $post, $args = array())
 {
     if (get_post_format($post->ID) !== 'status') {
         setup_postdata($post);
         $link_args = array('link' => social_get_shortlink($post->ID), 'title' => get_the_title($post->ID), 'description' => get_the_excerpt());
         if (function_exists('has_post_thumbnail') and has_post_thumbnail($post->ID)) {
             $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
             $link_args = $link_args + array('picture' => $image[0]);
         }
         wp_reset_postdata();
         $args = $args + $link_args;
     }
     return parent::get_broadcast_extras($account_id, $post, $args);
 }