Skip to content

Commit dadec84

Browse files
committed
update GitHub action
1 parent 0353563 commit dadec84

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

.github/workflows/build-zip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
composer update
2323
2424
- name: Run WordPress Coding Standard fixes
25-
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/*,*/gettext-helper.php,*/classes/multilingual-plugins/easy-language/pagebuilder/divi/build/,*/classes/multilingual-plugins/easy-language/blocks/*/build/,*translatepress* --standard=ruleset.xml .
25+
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .
2626

2727
- name: Run WordPress Coding Standard checks
28-
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/*,*/gettext-helper.php,*/classes/multilingual-plugins/easy-language/pagebuilder/divi/build/,*/classes/multilingual-plugins/easy-language/blocks/*/build/,*translatepress* --standard=ruleset.xml .
28+
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .
2929

3030
- name: Set version number 1
3131
uses: richardrigutins/replace-in-files@v2

auto-category-for-posts.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ function auto_category_save_post( int $post_id, WP_Post $post, bool $update ): v
8484
* @return array
8585
*/
8686
function auto_category_add_term_action( array $actions, WP_Term $tag ): array {
87-
// bail if it is not the category taxonomy.
87+
// bail if it is not the category taxonomy.
8888
if ( 'category' !== $tag->taxonomy ) {
89-
return $actions;
90-
}
91-
92-
// get taxonomy as object.
93-
$tax = get_taxonomy('category');
94-
if (current_user_can($tax->cap->manage_terms)) {
95-
$text = __('Set as default', 'auto-category-for-posts');
96-
$value = '';
97-
if (absint(get_option(AUTOCATEGORY_OPTIONNAME)) === $tag->term_id) {
98-
$text = __('Default category', 'auto-category-for-posts');
99-
$value = ' class="default_category"';
100-
}
101-
$actions['auto_category'] = '<a href="#"' . $value . ' data-termid="' . $tag->term_id . '" data-nonce="' . wp_create_nonce('auto_category_change_state') . '">' . esc_html( $text ) . '</a>';
102-
}
89+
return $actions;
90+
}
91+
92+
// get taxonomy as object.
93+
$tax = get_taxonomy( 'category' );
94+
if ( current_user_can( $tax->cap->manage_terms ) ) {
95+
$text = __( 'Set as default', 'auto-category-for-posts' );
96+
$value = '';
97+
if ( absint( get_option( AUTOCATEGORY_OPTIONNAME ) ) === $tag->term_id ) {
98+
$text = __( 'Default category', 'auto-category-for-posts' );
99+
$value = ' class="default_category"';
100+
}
101+
$actions['auto_category'] = '<a href="#"' . $value . ' data-termid="' . $tag->term_id . '" data-nonce="' . wp_create_nonce( 'auto_category_change_state' ) . '">' . esc_html( $text ) . '</a>';
102+
}
103103
return $actions;
104104
}
105105
add_filter( 'tag_row_actions', 'auto_category_add_term_action', 10, 2 );

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ OR use ant in build/-directory: `ant json-translations`
5050

5151
### Run
5252

53-
`vendor/bin/phpcs --standard=WordPress file`
53+
`vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .`
5454

5555
### Repair
5656

57-
`vendor/bin/phpcbf --standard=WordPress file`
57+
`vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .`

0 commit comments

Comments
 (0)