*/ protected static array $request_overrides = array(); /** * Title of the table. * * @var string */ protected $table_title = 'Base Table'; /** * Type of items being listed. * * @var string */ protected string $item_type = 'item'; /** * Whether to show bulk actions; override in child classes. * * @var bool */ protected $show_bulk_actions = false; /** * Render action buttons; override in child classes. */ protected function show_action_buttons() {} /** * Public wrapper for the protected pagination method. * * @param string $which The location of the pagination nav, 'top' or 'bottom'. * @return void */ public function render_pagination( $which = 'top' ) { $this->pagination( $which ); } /** * Register a sanitized scalar override for downstream request helpers. * * @param string $key The key to store the override under. * @param string $value The string value to store. */ public static function set_request_override( string $key, string $value ): void { self::$request_overrides[ $key ] = $value; } /** * Register a sanitized array override for downstream request helpers. * * @param string $key The key to store the override under. * @param array $value Array of scalar values. */ public static function set_request_override_array( string $key, array $value ): void { self::$request_overrides[ $key ] = array_values( $value ); } /** * Retrieve a request override value if one exists. * * @param string $key The key to look up. * @return mixed */ public static function get_request_override( string $key ) { return self::$request_overrides[ $key ] ?? null; } /** * Remove overrides (used after AJAX handlers finish configuring tables). * * @param string|null $key The key to remove, or null to clear all. */ public static function clear_request_override( ?string $key = null ): void { if ( null === $key ) { self::$request_overrides = array(); return; } unset( self::$request_overrides[ $key ] ); } }