Skip to content

Commit

Permalink
update GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
threadi committed Dec 22, 2024
1 parent 0353563 commit dadec84
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
composer update
- name: Run WordPress Coding Standard fixes
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 .
run: vendor/bin/phpcbf --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .

- name: Run WordPress Coding Standard checks
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 .
run: vendor/bin/phpcs --extensions=php --ignore=*/vendor/*,*/doc/*,*/svn/*,*/node_modules/* --standard=ruleset.xml .

- name: Set version number 1
uses: richardrigutins/replace-in-files@v2
Expand Down
30 changes: 15 additions & 15 deletions auto-category-for-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ function auto_category_save_post( int $post_id, WP_Post $post, bool $update ): v
* @return array
*/
function auto_category_add_term_action( array $actions, WP_Term $tag ): array {
// bail if it is not the category taxonomy.
// bail if it is not the category taxonomy.
if ( 'category' !== $tag->taxonomy ) {
return $actions;
}

// get taxonomy as object.
$tax = get_taxonomy('category');
if (current_user_can($tax->cap->manage_terms)) {
$text = __('Set as default', 'auto-category-for-posts');
$value = '';
if (absint(get_option(AUTOCATEGORY_OPTIONNAME)) === $tag->term_id) {
$text = __('Default category', 'auto-category-for-posts');
$value = ' class="default_category"';
}
$actions['auto_category'] = '<a href="#"' . $value . ' data-termid="' . $tag->term_id . '" data-nonce="' . wp_create_nonce('auto_category_change_state') . '">' . esc_html( $text ) . '</a>';
}
return $actions;
}

// get taxonomy as object.
$tax = get_taxonomy( 'category' );
if ( current_user_can( $tax->cap->manage_terms ) ) {
$text = __( 'Set as default', 'auto-category-for-posts' );
$value = '';
if ( absint( get_option( AUTOCATEGORY_OPTIONNAME ) ) === $tag->term_id ) {
$text = __( 'Default category', 'auto-category-for-posts' );
$value = ' class="default_category"';
}
$actions['auto_category'] = '<a href="#"' . $value . ' data-termid="' . $tag->term_id . '" data-nonce="' . wp_create_nonce( 'auto_category_change_state' ) . '">' . esc_html( $text ) . '</a>';
}
return $actions;
}
add_filter( 'tag_row_actions', 'auto_category_add_term_action', 10, 2 );
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ OR use ant in build/-directory: `ant json-translations`

### Run

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

### Repair

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

0 comments on commit dadec84

Please sign in to comment.