Skip to content

Commit 2604149

Browse files
authored
Merge branch 'main' into copilot/add-font-library-commands
2 parents d84384c + b551837 commit 2604149

File tree

8 files changed

+43
-5
lines changed

8 files changed

+43
-5
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@v3
24+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
2525
with:
2626
files: "composer.json"
2727

2828
- name: Set up PHP environment
2929
if: steps.check_composer_file.outputs.files_exists == 'true'
30-
uses: shivammathur/setup-php@v2
30+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
3131
with:
3232
php-version: 'latest'
3333
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Install Composer dependencies & cache dependencies
4040
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@v3
41+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
4242
env:
4343
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4444
with:

.github/workflows/issue-triage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ name: Issue and PR Triage
1313
required: false
1414
type: string
1515

16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
actions: write
20+
contents: read
21+
models: read
22+
1623
jobs:
1724
issue-triage:
1825
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main

.github/workflows/regenerate-readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- "features/**"
1111
- "README.md"
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
regenerate-readme:
1519
uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main

.github/workflows/welcome-new-contributors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
- master
99

10+
permissions:
11+
pull-requests: write
12+
1013
jobs:
1114
welcome:
1215
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
5+
"(#|//)\\s*spellchecker:ignore-next-line\\n.*"
6+
]

features/option-pluck-patch.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ Feature: Option commands have pluck and patch.
301301
"""
302302
303303
@patch
304-
Scenario: When we don't pass all necessary argumants.
304+
Scenario: When we don't pass all necessary arguments
305305
Given a WP install
306306
And an input.json file:
307307
"""

features/post.feature

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ Feature: Manage WordPress posts
5757
When I try the previous command again
5858
Then the return code should be 1
5959

60+
Scenario: Deleting already trashed custom post type posts
61+
When I run `wp post create --post_title='Test CPT post' --post_type='book' --porcelain`
62+
Then STDOUT should be a number
63+
And save STDOUT as {BOOK_POST_ID}
64+
65+
When I run `wp post update {BOOK_POST_ID} --post_status='trash'`
66+
Then STDOUT should be:
67+
"""
68+
Success: Updated post {BOOK_POST_ID}.
69+
"""
70+
71+
When I run `wp post delete {BOOK_POST_ID}`
72+
Then STDOUT should be:
73+
"""
74+
Success: Deleted post {BOOK_POST_ID}.
75+
"""
76+
6077
Scenario: Updating an invalid post should exit with an error
6178
Given a WP install
6279

src/Post_Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ protected function delete_callback( $post_id, $assoc_args ) {
507507
$post_type = get_post_type( $post_id );
508508

509509
if ( ! $assoc_args['force']
510+
&& 'trash' !== $status
510511
&& ( 'post' !== $post_type && 'page' !== $post_type ) ) {
511512
return [
512513
'error',

0 commit comments

Comments
 (0)