record = $record; } /** * Registers hooks. * * @return void */ public function register(): void { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Core's own dynamic hook name, built from this plugin's basename. add_action( 'after_plugin_row_' . AIBLACKOUT_BASENAME, array( $this, 'render' ), 10, 0 ); } /** * Prints the status line. * * @return void */ public function render(): void { if ( ! current_user_can( self::CAPABILITY ) ) { return; } global $wp_list_table; $columns = ( $wp_list_table instanceof \WP_List_Table ) ? $wp_list_table->get_column_count() : 5; $status = $this->record->get_live_status(); $parts = array( Result::label_for( $status ) ); $streak = $this->record->get_streak(); if ( $streak > 0 ) { $parts[] = sprintf( /* translators: %s: Number of consecutive days. */ _n( '%s day protected', '%s days protected', $streak, 'ai-blackout' ), number_format_i18n( $streak ) ); } $companies = $this->record->get_blocked_companies(); if ( ! empty( $companies ) ) { $parts[] = sprintf( /* translators: %s: Number of AI companies blocked. */ _n( 'blocking %s AI company', 'blocking %s AI companies', count( $companies ), 'ai-blackout' ), number_format_i18n( count( $companies ) ) ); } printf( '
%6$s %7$s