| @@ 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' : | |
| @@ 194-209 (lines=16) @@ | ||
| 191 | 	public function get_publicize_urls() { | |
| 192 | $publicize_URLs = array(); | |
| 193 | $publicize = get_post_meta( $this->post->ID, 'publicize_results', true ); | |
| 194 | 		if ( $publicize ) { | |
| 195 | 			foreach ( $publicize as $service => $data ) { | |
| 196 | 				switch ( $service ) { | |
| 197 | case 'twitter' : | |
| 198 | 					foreach ( $data as $datum ) { | |
| 199 | 						$publicize_URLs[] = esc_url_raw( "https://twitter.com/{$datum['user_id']}/status/{$datum['post_id']}" ); | |
| 200 | } | |
| 201 | break; | |
| 202 | case 'fb' : | |
| 203 | 					foreach ( $data as $datum ) { | |
| 204 | 						$publicize_URLs[] = esc_url_raw( "https://www.facebook.com/permalink.php?story_fbid={$datum['post_id']}&id={$datum['user_id']}" ); | |
| 205 | } | |
| 206 | break; | |
| 207 | } | |
| 208 | } | |
| 209 | } | |
| 210 | return (array) $publicize_URLs; | |
| 211 | } | |
| 212 | ||