Skip to content

Commit ce87eab

Browse files
committed
Merge branch 'main' into 72-lite-export
2 parents 2147bda + 46639c3 commit ce87eab

17 files changed

Lines changed: 318 additions & 58 deletions

‎.github/workflows/code-quality.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- main
88
- master
9+
schedule:
10+
- cron: '17 2 * * *' # Run every day on a seemly random time.
911

1012
jobs:
1113
code-quality:

‎.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/export.feature‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,3 +1319,27 @@ Feature: Export content.
13191319
"""
13201320
2
13211321
"""
1322+
1323+
Scenario: Export term meta
1324+
Given a WP install
1325+
1326+
When I run `wp term meta add 1 term_metakey term_metavalue`
1327+
Then STDOUT should contain:
1328+
"""
1329+
Success:
1330+
"""
1331+
1332+
When I run `wp export`
1333+
And save STDOUT 'Writing to file %s' as {EXPORT_FILE}
1334+
Then the {EXPORT_FILE} file should contain:
1335+
"""
1336+
<wp:termmeta>
1337+
"""
1338+
And the {EXPORT_FILE} file should contain:
1339+
"""
1340+
<wp:meta_key>term_metakey</wp:meta_key>
1341+
"""
1342+
And the {EXPORT_FILE} file should contain:
1343+
"""
1344+
<wp:meta_value><![CDATA[term_metavalue]]></wp:meta_value>
1345+
"""

‎functions.php‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<?php
22

3-
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Renaming breaks Phar compat.
4-
function wp_export( $args = array() ) {
5-
$defaults = array(
3+
/**
4+
* @param array{filters?: array<mixed>, format?: class-string<WP_Export_WXR_Formatter>, writer?: class-string<WP_Export_Base_Writer>, writer_args?: mixed} $args
5+
*/
6+
function wp_export( $args = array() ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Renaming breaks Phar compat.
7+
$defaults = array(
68
'filters' => array(),
79
'format' => 'WP_Export_WXR_Formatter',
810
'writer' => 'WP_Export_Returner',
911
'writer_args' => null,
1012
);
13+
14+
/**
15+
* @var array{filters: array<mixed>, format: class-string<WP_Export_WXR_Formatter>, writer: class-string<WP_Export_Base_Writer>, writer_args: mixed} $args
16+
*/
1117
$args = wp_parse_args( $args, $defaults );
1218
$export_query = new WP_Export_Query( $args['filters'] );
1319
$formatter = new $args['format']( $export_query );

‎phpstan.neon.dist‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
parameters:
2+
level: 9
3+
paths:
4+
- src
5+
- export-command.php
6+
- functions.php
7+
scanDirectories:
8+
- vendor/wp-cli/wp-cli/php
9+
scanFiles:
10+
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
11+
treatPhpDocTypesAsCertain: false
12+
ignoreErrors:
13+
- identifier: missingType.iterableValue
14+
- identifier: missingType.property
15+
- identifier: missingType.parameter
16+
- identifier: missingType.return

0 commit comments

Comments
 (0)