';
$html .=
'
Affected Code
Image
Actions
';
foreach ( $results as $row ) {
$id = intval( $row['id'] );
$ignore = intval( $row['ignre'] );
$ignore_class = $ignore ? ' active' : '';
$ignore_label = $ignore ? 'Ignored' : 'Ignore';
$ignore_user = intval( $row['ignre_user'] );
$ignore_user_info = get_userdata( $ignore_user );
$ignore_username = is_object( $ignore_user_info ) ? '
Username: ' . $ignore_user_info->user_login : '';
$ignore_date = ( $row['ignre_date'] && '0000-00-00 00:00:00' !== $row['ignre_date'] ) ? '
Date: ' . gmdate( 'F j, Y g:i a', strtotime( esc_html( $row['ignre_date'] ) ) ) : '';
$ignore_comment = esc_html( $row['ignre_comment'] );
$ignore_action = $ignore ? 'disable' : 'enable';
$ignore_type = $rule['rule_type'];
$ignore_submit_label = $ignore ? 'Stop Ignoring' : 'Ignore This ' . $ignore_type;
$ignore_comment_disabled = $ignore ? 'disabled' : '';
$ignore_global = intval( $row['ignre_global'] );
// check for images and svgs in object code.
$object_img = null;
$object_svg = null;
$object_img_html = str_get_html( htmlspecialchars_decode( $row['object'], ENT_QUOTES ) );
if ( $object_img_html ) {
$object_img_elements = $object_img_html->find( 'img' );
$object_svg_elements = $object_img_html->find( 'svg' );
if ( $object_img_elements ) {
foreach ( $object_img_elements as $element ) {
$object_img = $element->getAttribute( 'src' );
if ( $object_img ) {
break;
}
}
} elseif ( $object_svg_elements ) {
foreach ( $object_svg_elements as $element ) {
$object_svg = $element;
break;
}
}
}
$html .= '
Issue ID ' . $id . '
';
$html .= '
';
$html .= '
';
$html .= '' . esc_html( $row['object'] ) . '';
$html .= '
';
$html .= '
';
if ( $object_img ) {
$html .= '

';
} elseif ( $object_svg ) {
$html .= $object_svg;
}
$html .= '
';
$html .= '
';
$html .= '
';
if ( 'missing_headings' !== $rule['slug'] ) {
$url = add_query_arg(
array(
'edac' => $id,
'edac_nonce' => wp_create_nonce( 'edac_highlight' ),
),
get_the_permalink( $postid )
);
$html .= '
View on page';
}
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '' . $ignore_username . '';
$html .= ' ' . $ignore_date . '';
$html .= '
';
$html .= ( true === $ignore_permission || ! empty( $ignore_comment ) ) ? '
' : '';
$html .= ( true === $ignore_permission || ! empty( $ignore_comment ) ) ? '' : '';
if ( $ignore_global ) {
$html .= ( true === $ignore_permission ) ? '
Manage Globally Ignored' : '';
} else {
$html .= ( true === $ignore_permission ) ? '
' : '';
}
$html .= ( false === $ignore_permission && false === $ignore ) ? __( 'Your user account doesn\'t have permission to ignore this issue.', 'edac' ) : '';
$html .= '
';
$html .= '
';
}
$html .= '