| @@ 539-546 (lines=8) @@ | ||
| 536 | $media = array_values( |
|
| 537 | array_filter( |
|
| 538 | $block['media'], |
|
| 539 | function ( $single ) { |
|
| 540 | // Only images and videos can be uploaded. |
|
| 541 | if ( 0 === strpos( $single['type'], 'image/' ) || 0 === strpos( $single['type'], 'video/' ) ) { |
|
| 542 | return true; |
|
| 543 | } |
|
| 544 | ||
| 545 | return false; |
|
| 546 | } |
|
| 547 | ) |
|
| 548 | ); |
|
| 549 | ||
| @@ 559-565 (lines=7) @@ | ||
| 556 | $filtered_media = array_values( |
|
| 557 | array_filter( |
|
| 558 | $media, |
|
| 559 | function ( $single ) { |
|
| 560 | if ( 0 === strpos( $single['type'], 'video/' ) || 'image/gif' === $single['type'] ) { |
|
| 561 | return false; |
|
| 562 | } |
|
| 563 | ||
| 564 | return true; |
|
| 565 | } |
|
| 566 | ) |
|
| 567 | ); |
|
| 568 | // We can only add the first four images found to the tweet. |
|