Commit 02cb9ec
Add STDIN support to wp media import (#221)
* Initial plan
* Implement STDIN support for wp media import command
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
* Simplify STDIN file naming logic and update class documentation
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
* Add clarifying comment about WordPress slug sanitization in test
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
* Fix STDIN file type detection using mime_content_type
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
* Fix test to use correct field name post_name instead of name
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/media-command/sessions/4e4b402c-3f76-450c-abcd-1f37785681e8
* Fix STDIN imports to use generated filename for title instead of '-'
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/media-command/sessions/0f687dc2-b2b2-4363-8524-c9f12cb1338a
* Update src/Media_Command.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update features/media-import.feature
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix double extension issue by stripping extension from file_name before appending
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/media-command/sessions/25fc9db3-37e7-41b5-aef7-c41b4b633a8c
* Stream STDIN directly to temp file to avoid memory issues with large files
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/media-command/sessions/2d71c7b3-1844-42e8-ab88-e67d3b17e044
* Update test expectation for post_name after fixing double extension bug
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wp-cli/media-command/sessions/125cfbc3-1470-4b02-98d1-cadf88177d9c
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: Pascal Birchler <pascalb@google.com>
Co-authored-by: Pascal Birchler <pascal.birchler@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 3c223c6 commit 02cb9ec
2 files changed
Lines changed: 156 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
290 | 335 | | |
291 | 336 | | |
292 | 337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
377 | 382 | | |
378 | 383 | | |
379 | 384 | | |
| 385 | + | |
380 | 386 | | |
381 | 387 | | |
382 | 388 | | |
| |||
453 | 459 | | |
454 | 460 | | |
455 | 461 | | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
456 | 467 | | |
457 | 468 | | |
458 | 469 | | |
| |||
514 | 525 | | |
515 | 526 | | |
516 | 527 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
521 | 535 | | |
522 | | - | |
523 | | - | |
524 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
525 | 541 | | |
526 | 542 | | |
527 | 543 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
532 | 552 | | |
533 | | - | |
534 | 553 | | |
535 | | - | |
536 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
537 | 560 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
548 | 569 | | |
549 | 570 | | |
550 | 571 | | |
551 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
552 | 631 | | |
553 | 632 | | |
554 | 633 | | |
| |||
594 | 673 | | |
595 | 674 | | |
596 | 675 | | |
597 | | - | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
598 | 679 | | |
599 | 680 | | |
600 | 681 | | |
| |||
2005 | 2086 | | |
2006 | 2087 | | |
2007 | 2088 | | |
2008 | | - | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
2009 | 2093 | | |
2010 | 2094 | | |
2011 | 2095 | | |
| |||
0 commit comments