Skip to content

Commit

Permalink
Add filter support for plugins list status text
Browse files Browse the repository at this point in the history
  • Loading branch information
itzmekhokan committed May 26, 2024
1 parent aea04bd commit 1b80f69
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/wp-admin/includes/class-wp-plugins-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,25 @@ protected function get_views() {
$count
);
break;
default:
/**
* Filter the status text of default switch case in the Plugins list table.

Check failure on line 589 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
*

Check failure on line 590 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
* @since 6.6.0

Check failure on line 591 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
*

Check failure on line 592 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
* @param string $text Plugins list status text. Default empty string.

Check failure on line 593 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
* @param int $count Count the Number of plugins.

Check failure on line 594 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
* @param string $status Status slug of plugins list.
*/

Check failure on line 596 in src/wp-admin/includes/class-wp-plugins-list-table.php

View workflow job for this annotation

GitHub Actions / PHP coding standards / Run coding standards checks

Tabs must be used to indent lines; spaces are not allowed
$text = apply_filters( 'plugins_list_status_text', '', $count, $status );
if ( empty( $text ) ) {
$text = $status;
}
$text .= ' ' . sprintf(
'<span class="count">(%s)</span>',
$count
);
break;
}

if ( 'search' !== $type ) {
Expand Down

0 comments on commit 1b80f69

Please sign in to comment.