| @@ 395-410 (lines=16) @@ | ||
| 392 | case 'publicize_URLs' : |
|
| 393 | $publicize_URLs = array(); |
|
| 394 | $publicize = get_post_meta( $post->ID, 'publicize_results', true ); |
|
| 395 | if ( $publicize ) { |
|
| 396 | foreach ( $publicize as $service => $data ) { |
|
| 397 | switch ( $service ) { |
|
| 398 | case 'twitter' : |
|
| 399 | foreach ( $data as $datum ) { |
|
| 400 | $publicize_URLs[] = esc_url_raw( "https://twitter.com/{$datum['user_id']}/status/{$datum['post_id']}" ); |
|
| 401 | } |
|
| 402 | break; |
|
| 403 | case 'fb' : |
|
| 404 | foreach ( $data as $datum ) { |
|
| 405 | $publicize_URLs[] = esc_url_raw( "https://www.facebook.com/permalink.php?story_fbid={$datum['post_id']}&id={$datum['user_id']}" ); |
|
| 406 | } |
|
| 407 | break; |
|
| 408 | } |
|
| 409 | } |
|
| 410 | } |
|
| 411 | $response[$key] = (array) $publicize_URLs; |
|
| 412 | break; |
|
| 413 | case 'tags' : |
|
| @@ 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 | ||