Skip to content

Commit

Permalink
Test new interactive API with Query Loop block
Browse files Browse the repository at this point in the history
This block has it natively, it would be nice to use in our listing pages
  • Loading branch information
mleray committed Nov 26, 2024
1 parent 0b5d2f3 commit 0b45173
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/src/js/external_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {__} = wp.i18n;
export const setupExternalLinks = () => {
const siteURL = window.location.host;

const linkSelector = ['.page-content', 'article', '.author-details'].map(sel => `${sel} a:not(.btn):not(.cover-card-heading):not(.wp-block-button__link):not(.share-btn):not([href*="${siteURL}"]):not([href*=".pdf"]):not([href^="/"]):not([href^="#"]):not([href^="javascript:"])`).join(', ');
const linkSelector = ['.page-content', 'article', '.author-details'].map(sel => `${sel} a:not(.btn):not(.cover-card-heading):not(.wp-block-button__link):not(.share-btn):not([href*="${siteURL}"]):not([href*=".pdf"]):not([href^="/"]):not([href^="#"]):not([href^="javascript:"]):not(.page-numbers)`).join(', ');
const links = [...document.querySelectorAll(linkSelector)];

links.forEach(link => {
Expand Down
2 changes: 1 addition & 1 deletion parts/query-listing-page.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- wp:query { "query":{ "inherit": true } } -->
<!-- wp:query {"queryId":0,"query":{"inherit":true},"enhancedPagination":true} -->
<div id="listing-page-content" class="wp-block-query wp-block-query--list">
<!-- wp:post-template -->
<div class="query-list-item-image query-list-item-image-max-width">
Expand Down

0 comments on commit 0b45173

Please sign in to comment.