updated plugin Event Bridge for ActivityPub version 1.3.0
This commit is contained in:
@ -13,14 +13,13 @@
|
||||
namespace Event_Bridge_For_ActivityPub\Table;
|
||||
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
\defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
|
||||
|
||||
use WP_List_Table;
|
||||
use Event_Bridge_For_ActivityPub\ActivityPub\Collection\Event_Sources as Event_Sources_Collection;
|
||||
use Event_Bridge_For_ActivityPub\ActivityPub\Model\Event_Source;
|
||||
use WP_List_Table;
|
||||
|
||||
if ( ! \class_exists( '\WP_List_Table' ) ) {
|
||||
// @phpstan-ignore-next-line
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
||||
}
|
||||
|
||||
@ -118,7 +117,7 @@ class Event_Sources extends WP_List_Table {
|
||||
foreach ( $event_sources['actors'] as $event_source_post_id => $event_source_activitypub_id ) {
|
||||
$event_source = Event_Source::get_by_id( (int) $event_source_post_id );
|
||||
|
||||
if ( ! $event_source || ! in_array( $event_source->get_status(), array( 'publish', 'pending' ), true ) ) {
|
||||
if ( ! $event_source || ! \in_array( $event_source->get_status(), array( 'publish', 'pending' ), true ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -155,7 +154,7 @@ class Event_Sources extends WP_List_Table {
|
||||
* @return string
|
||||
*/
|
||||
public function column_default( $item, $column_name ) {
|
||||
if ( ! array_key_exists( $column_name, $item ) ) {
|
||||
if ( ! \array_key_exists( $column_name, $item ) ) {
|
||||
return __( 'None', 'event-bridge-for-activitypub' );
|
||||
}
|
||||
return $item[ $column_name ];
|
||||
@ -167,8 +166,8 @@ class Event_Sources extends WP_List_Table {
|
||||
* @param array $item Item.
|
||||
* @return string
|
||||
*/
|
||||
public function column_icon( $item ): string {
|
||||
return sprintf(
|
||||
public function column_icon( array $item ): string {
|
||||
return \sprintf(
|
||||
'<img src="%s" width="25px;" />',
|
||||
$item['icon']
|
||||
);
|
||||
@ -181,7 +180,7 @@ class Event_Sources extends WP_List_Table {
|
||||
* @return string
|
||||
*/
|
||||
public function column_url( $item ): string {
|
||||
return sprintf(
|
||||
return \sprintf(
|
||||
'<a href="%s" target="_blank">%s</a>',
|
||||
esc_url( $item['url'] ),
|
||||
$item['url']
|
||||
@ -195,7 +194,7 @@ class Event_Sources extends WP_List_Table {
|
||||
* @return string
|
||||
*/
|
||||
public function column_cb( $item ): string {
|
||||
return sprintf( '<input type="checkbox" name="event_sources[]" value="%s" />', esc_attr( $item['identifier'] ) );
|
||||
return \sprintf( '<input type="checkbox" name="event_sources[]" value="%s" />', esc_attr( $item['identifier'] ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@ -204,7 +203,7 @@ class Event_Sources extends WP_List_Table {
|
||||
* @param array $item Item.
|
||||
* @return string
|
||||
*/
|
||||
public function column_accepted( $item ): string {
|
||||
public function column_accepted( array $item ): string {
|
||||
if ( $item['accepted'] ) {
|
||||
return esc_html__( 'Accepted', 'event-bridge-for-activitypub' );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user