index.js
33 lines
| 1 | const { __ } = wp.i18n; |
| 2 | import useWhatsNewRSS from "./useWhatsNewRSS"; |
| 3 | |
| 4 | const WhatsNewRSS = () => { |
| 5 | // Initialize library's custom hook. |
| 6 | useWhatsNewRSS({ |
| 7 | uniqueKey: "presto-player", |
| 8 | rssFeedURL: "https://prestoplayer.com/whats-new/feed/", |
| 9 | selector: "#whats-new-container", |
| 10 | flyout: { |
| 11 | title: __("What's New?", "presto-player"), |
| 12 | className: "presto-player-whats-new-flyout", |
| 13 | innerContent: { |
| 14 | titleLink: false, |
| 15 | }, |
| 16 | // The library's default excerpt truncates posts to 500 words by |
| 17 | // stripping every HTML tag and joining the remaining words with |
| 18 | // spaces — which flattens headings, paragraphs, and lists into a |
| 19 | // single wall of text. Setting wordLimit=0 short-circuits that |
| 20 | // path so the raw post HTML reaches the flyout intact (the |
| 21 | // library's own CSS already styles h2/h3/p/ul/ol inside the |
| 22 | // content area). |
| 23 | excerpt: { |
| 24 | wordLimit: 0, |
| 25 | }, |
| 26 | }, |
| 27 | }); |
| 28 | |
| 29 | return <div id="whats-new-container"></div>; |
| 30 | }; |
| 31 | |
| 32 | export default WhatsNewRSS; |
| 33 |