| @@ 227-242 (lines=16) @@ | ||
| 224 | public function get_publicize_urls() { |
|
| 225 | $publicize_URLs = array(); |
|
| 226 | $publicize = get_post_meta( $this->post->ID, 'publicize_results', true ); |
|
| 227 | if ( $publicize ) { |
|
| 228 | foreach ( $publicize as $service => $data ) { |
|
| 229 | switch ( $service ) { |
|
| 230 | case 'twitter' : |
|
| 231 | foreach ( $data as $datum ) { |
|
| 232 | $publicize_URLs[] = esc_url_raw( "https://twitter.com/{$datum['user_id']}/status/{$datum['post_id']}" ); |
|
| 233 | } |
|
| 234 | break; |
|
| 235 | case 'fb' : |
|
| 236 | foreach ( $data as $datum ) { |
|
| 237 | $publicize_URLs[] = esc_url_raw( "https://www.facebook.com/permalink.php?story_fbid={$datum['post_id']}&id={$datum['user_id']}" ); |
|
| 238 | } |
|
| 239 | break; |
|
| 240 | } |
|
| 241 | } |
|
| 242 | } |
|
| 243 | return (array) $publicize_URLs; |
|
| 244 | } |
|
| 245 | ||
| @@ 363-378 (lines=16) @@ | ||
| 360 | case 'publicize_URLs' : |
|
| 361 | $publicize_URLs = array(); |
|
| 362 | $publicize = get_post_meta( $post->ID, 'publicize_results', true ); |
|
| 363 | if ( $publicize ) { |
|
| 364 | foreach ( $publicize as $service => $data ) { |
|
| 365 | switch ( $service ) { |
|
| 366 | case 'twitter' : |
|
| 367 | foreach ( $data as $datum ) { |
|
| 368 | $publicize_URLs[] = esc_url_raw( "https://twitter.com/{$datum['user_id']}/status/{$datum['post_id']}" ); |
|
| 369 | } |
|
| 370 | break; |
|
| 371 | case 'fb' : |
|
| 372 | foreach ( $data as $datum ) { |
|
| 373 | $publicize_URLs[] = esc_url_raw( "https://www.facebook.com/permalink.php?story_fbid={$datum['post_id']}&id={$datum['user_id']}" ); |
|
| 374 | } |
|
| 375 | break; |
|
| 376 | } |
|
| 377 | } |
|
| 378 | } |
|
| 379 | $response[$key] = (array) $publicize_URLs; |
|
| 380 | break; |
|
| 381 | case 'tags' : |
|