Skip to content

Commit

Permalink
Merge pull request #10 from globalis-ms/develop
Browse files Browse the repository at this point in the history
version 1.0.0
  • Loading branch information
Pierre Dargham authored Oct 14, 2019
2 parents 4acc9d3 + fd34a4e commit 2d09770
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 99 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ sudo: false
language: php

php:
- 7.0
- 7.1
- 7.2
- 7.3
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
"issues": "https://github.com/globalis-ms/wp-cubi-robo/issues"
},
"require": {
"php": ">=7.1",
"globalis/robo-task": "^1.1.0",
"rmccue/requests" : "~1.6"
},
"require-dev": {
"squizlabs/php_codesniffer": "^2.5.1"
"squizlabs/php_codesniffer": "^3.5.0"
},
"autoload": {
"psr-4": {
Expand Down
153 changes: 64 additions & 89 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<!-- Show sniff codes in all reports -->
<arg value="ns"/>

<!-- Use PSR-2 as a base -->
<rule ref="PSR2"/>
<!-- Use PSR-12 as a base -->
<rule ref="PSR12"/>

<!-- Custom rule: disallow long `array()` syntax, use short `[]` syntax instead -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
Expand Down
19 changes: 13 additions & 6 deletions src/WordPressTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,18 +301,25 @@ protected function wpClean()
->arg('blogdescription')
->execute();

self::wpCli()
$cmd = self::wpCli()
->arg('post')
->arg('delete')
->arg('1')
->option('force')
->arg('list')
->option('post_type=', 'any', '=')
->option('format', 'ids', '=')
->execute();

self::wpCli()
$post_ids = $cmd->getOutput();

if (empty($post_ids)) {
return;
}

$cmd = self::wpCli()
->arg('post')
->arg('delete')
->arg('2')
->arg(explode(' ', $post_ids))
->option('force')
->option('quiet')
->execute();
}

Expand Down

0 comments on commit 2d09770

Please sign in to comment.