Skip to content

Commit fb4d1e7

Browse files
committed
added: include landmark data in AJAX response and updated layout for landmark display
1 parent 5baaf70 commit fb4d1e7

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

admin/class-ajax.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function ( $a, $b ) {
305305

306306
foreach ( $rules as $rule ) {
307307
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Using direct query for interacting with custom database, safe variable used for table name, caching not required for one time operation.
308-
$results = $wpdb->get_results( $wpdb->prepare( 'SELECT id, postid, object, ruletype, ignre, ignre_user, ignre_date, ignre_comment, ignre_global FROM %i where postid = %d and rule = %s and siteid = %d', $table_name, $postid, $rule['slug'], $siteid ), ARRAY_A );
308+
$results = $wpdb->get_results( $wpdb->prepare( 'SELECT id, postid, object, ruletype, ignre, ignre_user, ignre_date, ignre_comment, ignre_global, landmark FROM %i where postid = %d and rule = %s and siteid = %d', $table_name, $postid, $rule['slug'], $siteid ), ARRAY_A );
309309
$count_classes = ( 'error' === $rule['rule_type'] ) ? ' edac-details-rule-count-error' : ' edac-details-rule-count-warning';
310310
$count_classes .= ( 0 !== $rule['count'] ) ? ' active' : '';
311311

@@ -406,6 +406,8 @@ function ( $a, $b ) {
406406
$html .= ob_get_clean();
407407
}
408408

409+
410+
409411
$html .=
410412
'<div class="edac-details-rule-records-labels">
411413
<div class="edac-details-rule-records-labels-label" aria-hidden="true">
@@ -414,6 +416,9 @@ function ( $a, $b ) {
414416
<div class="edac-details-rule-records-labels-label" aria-hidden="true">
415417
Image
416418
</div>
419+
<div class="edac-details-rule-records-labels-label" aria-hidden="true">
420+
Landmark
421+
</div>
417422
<div class="edac-details-rule-records-labels-label" aria-hidden="true">
418423
Actions
419424
</div>
@@ -461,6 +466,13 @@ function ( $a, $b ) {
461466

462467
$html .= '</div>';
463468

469+
$html .= '<div class="edac-details-rule-records-record-cell edac-details-rule-records-record-landmark">';
470+
471+
$landmark = isset( $row['landmark'] ) ? esc_html( $row['landmark'] ) : '';
472+
$html .= $landmark ? $landmark : '<span class="edac-no-landmark">—</span>';
473+
474+
$html .= '</div>';
475+
464476
$html .= '<div class="edac-details-rule-records-record-cell edac-details-rule-records-record-actions">';
465477

466478
if ( ! isset( $rule['viewable'] ) || $rule['viewable'] ) {

src/admin/sass/accessibility-checker-admin.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@
621621
color: variables.$color-white;
622622
background-color: variables.$color-dark-gray;
623623
display: grid;
624-
grid-template-columns: auto 125px 125px;
624+
grid-template-columns: auto 125px 125px 125px;
625625

626626
&-label {
627627
padding: 3px;
@@ -631,7 +631,7 @@
631631

632632
&-record {
633633
display: grid;
634-
grid-template-columns: auto 125px 125px;
634+
grid-template-columns: auto 125px 125px 125px;
635635

636636
&-cell {
637637
padding: 10px;

0 commit comments

Comments
 (0)