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