*/ public static function get_reasons(): array { return [ 'false_positive' => [ 'label' => __( 'False positive', 'accessibility-checker' ), 'description' => __( 'The scanner flagged this, but it does not apply to this content.', 'accessibility-checker' ), ], 'remediated' => [ 'label' => __( 'Remediated', 'accessibility-checker' ), 'description' => __( 'The issue has been fixed, but the page has not been rescanned yet.', 'accessibility-checker' ), ], 'accessible' => [ 'label' => __( 'Confirmed accessible', 'accessibility-checker' ), 'description' => __( 'Reviewed and verified to meet accessibility requirements.', 'accessibility-checker' ), ], ]; } /** * Render the full ignore/dismiss panel for an issue. * * Produces the entire ignore panel: user info, dismiss reason radios, * comment textarea, and the submit/manage button. Used by both the * classic metabox (AJAX details) and the pro log/issues pages. * * @param array $args { * Panel arguments. * * @type int $issue_id The issue ID. * @type bool $is_ignored Whether the issue is currently dismissed. * @type int $ignore_user The user ID who dismissed the issue. * @type string $ignore_date The UTC datetime string when the issue was dismissed. * @type string $ignore_comment The dismiss comment. * @type string $ignore_reason The dismiss reason key (e.g. 'false_positive'). * @type int $ignore_global Whether the issue was globally ignored (1 or 0). * @type string $ignore_type The rule type ('error' or 'warning'). * @type bool $ignore_permission Whether the current user can ignore issues. * } * @return string The ignore panel HTML. */ public static function render_ignore_panel( array $args ): string { $issue_id = (int) ( $args['issue_id'] ?? 0 ); $is_ignored = (bool) ( $args['is_ignored'] ?? false ); $ignore_user = (int) ( $args['ignore_user'] ?? 0 ); $ignore_date_raw = (string) ( $args['ignore_date'] ?? '' ); $ignore_comment = (string) ( $args['ignore_comment'] ?? '' ); $ignore_reason = (string) ( $args['ignore_reason'] ?? '' ); $ignore_global = (int) ( $args['ignore_global'] ?? 0 ); $ignore_type = (string) ( $args['ignore_type'] ?? '' ); $ignore_permission = (bool) ( $args['ignore_permission'] ?? true ); // Derive display values. $ignore_user_info = get_userdata( $ignore_user ); $username_html = is_object( $ignore_user_info ) ? '' . esc_html__( 'Username:', 'accessibility-checker' ) . ' ' . esc_html( $ignore_user_info->user_login ) : ''; $date_text = ''; if ( $ignore_date_raw && '0000-00-00 00:00:00' !== $ignore_date_raw ) { $date_text = function_exists( 'edac_format_datetime_from_utc' ) ? edac_format_datetime_from_utc( $ignore_date_raw ) : ''; } $date_html = $date_text ? '' . esc_html__( 'Date:', 'accessibility-checker' ) . ' ' . esc_html( $date_text ) : ''; $ignore_action = $is_ignored ? 'disable' : 'enable'; $ignore_submit_label = $is_ignored ? __( 'Reopen Issue', 'accessibility-checker' ) : __( 'Dismiss Issue', 'accessibility-checker' ); $comment_disabled = $is_ignored ? 'disabled' : ''; $ignore_icon = defined( 'EDAC_SVG_IGNORE_ICON' ) ? EDAC_SVG_IGNORE_ICON : ''; // Build the HTML. $html = '