使用Shortnotes WordPress插件發布文本,圖像和圖庫片段

昨天,Happy Prime所有者兼工程師Jeremy Felt獲釋 短注,這是一個用於從WordPress編輯器編寫筆記的插件。 目的是讓用戶創建簡短的內容,例如在Twitter,Instagram和類似的社交網路上找到的內容。 但是,它沒有附帶前端發布界面,至少在1.0版中沒有。

該插件的工作方式類似於帖子和頁面編輯器。 對於大多數用戶來說,它應該很簡單。

雖然Shortnotes插件目前還比較簡陋,但它可以作為更多功能的基礎。 使社交網路具有吸引力的部分原因是易於發布快速內容。 通過插件發布注釋需要訪問WordPress管理員,單擊「添加新」,編寫內容,發布,然後單擊新鏈接以在前端對其進行查看。 通過儀錶板小部件或前端表單快速發布的界面將是有用的補充。

使用短注詞WordPress插件發布文本圖像和圖庫片段使用短注詞WordPress插件發布文本,圖像和圖庫片段在塊編輯器中記錄帖子類型。

並非所有用戶都熟悉的一些新概念是「回復URL」和「回複姓名」欄位。 這些是用於創建筆記以回復網路上其他帖子或人的語義欄位。 插件將自動在前端輸出此回復鏈接。

該插件與 Webmention插件。 Webmention是用於在網路上進行提及和對話的標準化協議。 目標是建立一個分散的社交「網路」,每個人都擁有並控制其內容。 它是什麼的替代品 獨立網 稱為大型高科技公司可以控制的「公司」網路。

輸入URL答覆時,Shortnotes將自動通過Webmentions插件系統發送該URL。 如果存在,它還會將帖子內容中的URL解析為webmentions。

用戶可能還會注意到注釋標題欄位丟失。 這是故意的。 該插件會自動生成標題。 標記需要它們,例如搜索引擎使用的工具。</p> <p>這個想法是為了使標題不出現在主題布局中。 因為大多數主題在顯示之前都沒有編碼為檢查後類型支持,所以用戶主題很有可能會在前端輸出自動生成的標題。 目前,這意味著為不希望出現的主題編輯一些主題代碼。 感到有一個 <a rel="nofollow external noopener noreferrer" href="https://github.com/jeremyfelt/writemore/blob/0b344cc9613b1ed011cba13cb3c09376def596fc/template-parts/content/content-single.php#L16-L36" data-wpel-link="external" target="_self">他如何修改此示例</a> 他網站的自定義「二十一二十一」兒童主題。 從長遠來看,隨著更多主題開始支持即將到來的網站編輯器,用戶將能夠直接在WordPress管理員中進行此自定義。</p> <p>通過一些調整,例如刪除標題和一些小的CSS調整,我能夠使用Genesis Block主題創建一個乾淨的Notes存檔頁面:</p> <p><img decoding="async" class="alignnone size-full wp-image-42767" src="https://wpjian.com/wp-content/uploads/2021/03/20210312-7.jpg" width="1280" height="720" alt="使用shortnotes發布文本圖像和圖庫片段wordpress-plugin-1使用Shortnotes WordPress插件發布文本,圖像和圖庫片段" title="使用shortnotes發布文本圖像和圖庫片段wordpress-plugin-1使用Shortnotes WordPress插件發布文本,圖像和圖庫片段" srcset="https://wpjian.com/wp-content/uploads/2021/03/20210312-7.jpg 1280w, https://wpjian.com/wp-content/uploads/2021/03/20210312-7-300x169.jpg 300w, https://wpjian.com/wp-content/uploads/2021/03/20210312-7-1024x576.jpg 1024w, https://wpjian.com/wp-content/uploads/2021/03/20210312-7-768x432.jpg 768w" sizes="(max-width: 1280px) 100vw, 1280px" />修改後的筆記存檔。</p> <p>我檢查該項目的興趣之一是深入研究一個插件的真實示例,該示例限制了哪些塊可與編輯器一起使用。 注釋帖子類型僅允許「段落」,「圖像」和「圖庫」塊。 同樣,該想法是複製您在社交網路上可以做的事情的感覺。 總體而言,此功能按預期工作,將注釋限制在塊的子集中。</p> <p>但是,我在塊編輯器中遇到了一個錯誤。 所有塊模式,無論它們包含什麼塊,都出現在插入器中。 單擊包含不允許的塊的塊不會將其插入到帖子中。 但是,編輯器確實添加了它具有的彈出注釋。 有一個 <a rel="nofollow external noopener noreferrer" href="https://github.com/WordPress/gutenberg/issues/23275" data-wpel-link="external" target="_self">這個錯誤的GitHub問題</a> 自2020年6月開放以來,幾乎沒有動靜。</p> <p>感覺創建了一個插件來解決這個問題 <a rel="nofollow external noopener noreferrer" href="https://wordpress.org/plugins/unregister-broken-patterns/" data-wpel-link="external" target="_self">取消註冊損壞的圖案</a>。 它刪除任何包含帖子類型不支持的塊的模式。 充其量,這只是一個臨時措施,需要在WordPress中解決。</p> <h3 class="sd-title">像這樣:</h3> <p>像載入中…</p> <p> <a rel="nofollow external noopener noreferrer" href="https://wptavern.com/publish-text-image-and-gallery-snippets-with-the-shortnotes-wordpress-plugin?utm_source=rss&utm_medium=rss&utm_campaign=publish-text-image-and-gallery-snippets-with-the-shortnotes-wordpress-plugin" data-wpel-link="external" target="_self">來源</a></p> </div> </div> </div> </div> </div> <aside id="secondary" class="cs-widget-area cs-sidebar__area"> <div class="cs-sidebar__inner"> <div class="widget_text widget custom_html-2 widget_custom_html"><div class="textwidget custom-html-widget"><a href="https://www.vultr.com/?ref=8945630-8H" data-wpel-link="external" target="_self" rel="nofollow external noopener noreferrer"><img src="https://wpjian.com/wp-content/uploads/2020/09/VULTR.jpg" width="100%" height="auto"></a></div></div><div class="widget widget_wpcc-2 widget_wpcc"> <div id="wpcc_widget_inner"> <span id="wpcc_original_link" class="wpcc_lang" ><a class="wpcc_link" href="https://wpjian.com/tips/2021031242768.html" title="簡體中文" data-wpel-link="internal">簡體中文</a></span> <span id="wpcc_zh-tw_link" class="wpcc_current_lang" ><a class="wpcc_link" href="https://wpjian.com/zh-tw/tips/2021031242768.html" title="繁体中文" data-wpel-link="internal">繁体中文</a></span> </div> </div><div class="widget powerkit_widget_posts-2 powerkit_widget_posts"> <div class="widget-body pk-widget-posts pk-widget-posts-template-default pk-widget-posts-template-list posts-per-page-6"> <ul> <li class="pk-post-item"> <article class="post-61438 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__thumbnail cs-overlay-ratio cs-ratio-original"> <div class="cs-overlay-background cs-overlay-transparent"> <img width="150" height="97" src="https://wpjian.com/wp-content/uploads/2024/01/wordpress-theme-file-editor.webp.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/zh-tw/tips/2024010561438.html" data-wpel-link="internal"></a> </div> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2024010561438.html" data-wpel-link="internal">如何在沒有插件的情況下在 WordPress 中導入 CSV 文件</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61410 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__thumbnail cs-overlay-ratio cs-ratio-original"> <div class="cs-overlay-background cs-overlay-transparent"> <img width="150" height="67" src="https://wpjian.com/wp-content/uploads/2024/01/how-to-enable-maintenance-mode-in-wordpress.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/zh-tw/tips/2024010561410.html" data-wpel-link="internal"></a> </div> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2024010561410.html" data-wpel-link="internal">如何將 WordPress 置於維護模式(安全且簡單的方法)</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61400 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__thumbnail cs-overlay-ratio cs-ratio-original"> <div class="cs-overlay-background cs-overlay-transparent"> <img width="150" height="46" src="https://wpjian.com/wp-content/uploads/2024/01/how-to-add-images-708x218-1.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/zh-tw/tips/2024010561400.html" data-wpel-link="internal"></a> </div> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2024010561400.html" data-wpel-link="internal">如何向 WordPress 帖子添加多媒體</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61390 post type-post status-publish format-standard category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2023092061390.html" data-wpel-link="internal">谷歌域名與WordPress集成:建立您的專業網站</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61386 post type-post status-publish format-standard category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2023092061386.html" data-wpel-link="internal">了解WordPress社區:專訪揭示內部運作</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61382 post type-post status-publish format-standard category-tips cs-entry cs-video-wrap" style=""> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h3 class="cs-entry__title"> <a href="https://wpjian.com/zh-tw/tips/2023092061382.html" data-wpel-link="internal">Azure 提供的 WordPress 免費遊樂場</a> </h3> </div> </div> </article> </li> </ul> </div> </div><div class="widget_text widget custom_html-4 widget_custom_html"><div class="textwidget custom-html-widget"><script type="rocketlazyloadscript" async data-rocket-src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8713839794068339" crossorigin="anonymous"></script> <!-- block --> <ins class="adsbygoogle" style="display:inline-block;width:300px;height:250px" data-ad-client="ca-pub-8713839794068339" data-ad-slot="7982876503"></ins> <script type="rocketlazyloadscript"> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div></div> </div> </aside> </div> <div class="cs-entry__post-related"> <h5 class="cs-section-heading cs-section-heading-common is-style-cnvs-block-section-heading-default halignleft "><span class="cs-section-subheadings">相關文章</span></h5> <div class="cs-entry__post-wrap"> <article class="cs-entry-default post-9080 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap"> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h2 class="cs-entry__title"><a href="https://wpjian.com/zh-tw/tips/201909199080.html" data-wpel-link="internal">cPanel與Plesk for WordPress用戶</a></h2> <div class="cs-entry__excerpt"> [ad_1] cPanel和Plesk是當今最著名的兩個控制面板。兩者都具有一流的功… </div> <div class="cs-entry__details "> <div class="cs-entry__details-data"> <div class="cs-entry__details-meta"> <div class="cs-entry__post-meta" ><div class="cs-meta-date">2019年9月19日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/zh-tw/tips/201909199080.html" data-wpel-link="internal"> 閱讀更多 </a> </div> </div> </div> </div> </article> <article class="cs-entry-default post-40484 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap"> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h2 class="cs-entry__title"><a href="https://wpjian.com/zh-tw/tips/2021012140484.html" data-wpel-link="internal">拜登白宮堅持使用WordPress來重新啟動網站</a></h2> <div class="cs-entry__excerpt"> 總統拜登今天上任並揭幕了 whitehouse.gov 在WordPress上已重新… </div> <div class="cs-entry__details "> <div class="cs-entry__details-data"> <div class="cs-entry__details-meta"> <div class="cs-entry__post-meta" ><div class="cs-meta-date">2021年1月21日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/zh-tw/tips/2021012140484.html" data-wpel-link="internal"> 閱讀更多 </a> </div> </div> </div> </div> </article> <article class="cs-entry-default post-55178 post type-post status-publish format-standard has-post-thumbnail category-tips cs-entry cs-video-wrap"> <div class="cs-entry__outer"> <div class="cs-entry__inner cs-entry__content"> <h2 class="cs-entry__title"><a href="https://wpjian.com/zh-tw/tips/2022042155178.html" data-wpel-link="internal">​​以下是如何在 Instagram 上獲得更多關注者</a></h2> <div class="cs-entry__excerpt"> Instagram 是增長最快的社交媒體網站之一,也是社交媒體營銷的關鍵部分。 這對… </div> <div class="cs-entry__details "> <div class="cs-entry__details-data"> <div class="cs-entry__details-meta"> <div class="cs-entry__post-meta" ><div class="cs-meta-date">2022年4月21日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/zh-tw/tips/2022042155178.html" data-wpel-link="internal"> 閱讀更多 </a> </div> </div> </div> </div> </article> </div> </div> </div> </div> </main> <footer class="cs-footer cs-footer-one" data-scheme="default"> <div class="cs-container"> <div class="cs-footer__item"> <div class="cs-footer__col cs-col-left"> <div class="cs-footer__inner"> <div class="cs-logo"> <a class="cs-footer__logo cs-logo-once" href="https://wpjian.com/zh-tw/" data-wpel-link="internal"> WP建站 </a> </div> <div class="cs-footer__desc"> <p class="copyright">© 2019 - 2022 by <a href="https://wpjian.com/zh-tw/" data-wpel-link="internal">WPJIAN</a>. </p> </div> </div> </div> <div class="cs-footer__col cs-col-center"> </div> <div class="cs-footer__col cs-col-right"> <div class="cs-footer-social-links"> </div> </div> </div> </div> </footer> </div> </div> <script type="rocketlazyloadscript" id="rocket-browser-checker-js-after"> "use strict";var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var RocketBrowserCompatibilityChecker=function(){function RocketBrowserCompatibilityChecker(options){_classCallCheck(this,RocketBrowserCompatibilityChecker),this.passiveSupported=!1,this._checkPassiveOption(this),this.options=!!this.passiveSupported&&options}return _createClass(RocketBrowserCompatibilityChecker,[{key:"_checkPassiveOption",value:function(self){try{var options={get passive(){return!(self.passiveSupported=!0)}};window.addEventListener("test",null,options),window.removeEventListener("test",null,options)}catch(err){self.passiveSupported=!1}}},{key:"initRequestIdleCallback",value:function(){!1 in window&&(window.requestIdleCallback=function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)}),!1 in window&&(window.cancelIdleCallback=function(id){return clearTimeout(id)})}},{key:"isDataSaverModeOn",value:function(){return"connection"in navigator&&!0===navigator.connection.saveData}},{key:"supportsLinkPrefetch",value:function(){var elem=document.createElement("link");return elem.relList&&elem.relList.supports&&elem.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype}},{key:"isSlowConnection",value:function(){return"connection"in navigator&&"effectiveType"in navigator.connection&&("2g"===navigator.connection.effectiveType||"slow-2g"===navigator.connection.effectiveType)}}]),RocketBrowserCompatibilityChecker}(); </script> <script id="rocket-preload-links-js-extra"> var RocketPreloadLinksConfig = {"excludeUris":"\/page\/|\/(?:.+\/)?feed(?:\/(?:.+\/?)?)?$|\/(?:.+\/)?embed\/|\/(index\\.php\/)?(.*)wp\\-json(\/.*|$)|\/refer\/|\/go\/|\/recommend\/|\/recommends\/","usesTrailingSlash":"","imageExt":"jpg|jpeg|gif|png|tiff|bmp|webp|avif|pdf|doc|docx|xls|xlsx|php","fileExt":"jpg|jpeg|gif|png|tiff|bmp|webp|avif|pdf|doc|docx|xls|xlsx|php|html|htm","siteUrl":"https:\/\/wpjian.com","onHoverDelay":"100","rateThrottle":"3"}; </script> <script type="rocketlazyloadscript" id="rocket-preload-links-js-after"> (function() { "use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var t=function(){function n(e,t){i(this,n),this.browser=e,this.config=t,this.options=this.browser.options,this.prefetched=new Set,this.eventTime=null,this.threshold=1111,this.numOnHover=0}return e(n,[{key:"init",value:function(){!this.browser.supportsLinkPrefetch()||this.browser.isDataSaverModeOn()||this.browser.isSlowConnection()||(this.regex={excludeUris:RegExp(this.config.excludeUris,"i"),images:RegExp(".("+this.config.imageExt+")$","i"),fileExt:RegExp(".("+this.config.fileExt+")$","i")},this._initListeners(this))}},{key:"_initListeners",value:function(e){-1<this.config.onHoverDelay&&document.addEventListener("mouseover",e.listener.bind(e),e.listenerOptions),document.addEventListener("mousedown",e.listener.bind(e),e.listenerOptions),document.addEventListener("touchstart",e.listener.bind(e),e.listenerOptions)}},{key:"listener",value:function(e){var t=e.target.closest("a"),n=this._prepareUrl(t);if(null!==n)switch(e.type){case"mousedown":case"touchstart":this._addPrefetchLink(n);break;case"mouseover":this._earlyPrefetch(t,n,"mouseout")}}},{key:"_earlyPrefetch",value:function(t,e,n){var i=this,r=setTimeout(function(){if(r=null,0===i.numOnHover)setTimeout(function(){return i.numOnHover=0},1e3);else if(i.numOnHover>i.config.rateThrottle)return;i.numOnHover++,i._addPrefetchLink(e)},this.config.onHoverDelay);t.addEventListener(n,function e(){t.removeEventListener(n,e,{passive:!0}),null!==r&&(clearTimeout(r),r=null)},{passive:!0})}},{key:"_addPrefetchLink",value:function(i){return this.prefetched.add(i.href),new Promise(function(e,t){var n=document.createElement("link");n.rel="prefetch",n.href=i.href,n.onload=e,n.onerror=t,document.head.appendChild(n)}).catch(function(){})}},{key:"_prepareUrl",value:function(e){if(null===e||"object"!==(void 0===e?"undefined":r(e))||!1 in e||-1===["http:","https:"].indexOf(e.protocol))return null;var t=e.href.substring(0,this.config.siteUrl.length),n=this._getPathname(e.href,t),i={original:e.href,protocol:e.protocol,origin:t,pathname:n,href:t+n};return this._isLinkOk(i)?i:null}},{key:"_getPathname",value:function(e,t){var n=t?e.substring(this.config.siteUrl.length):e;return n.startsWith("/")||(n="/"+n),this._shouldAddTrailingSlash(n)?n+"/":n}},{key:"_shouldAddTrailingSlash",value:function(e){return this.config.usesTrailingSlash&&!e.endsWith("/")&&!this.regex.fileExt.test(e)}},{key:"_isLinkOk",value:function(e){return null!==e&&"object"===(void 0===e?"undefined":r(e))&&(!this.prefetched.has(e.href)&&e.origin===this.config.siteUrl&&-1===e.href.indexOf("?")&&-1===e.href.indexOf("#")&&!this.regex.excludeUris.test(e.href)&&!this.regex.images.test(e.href))}}],[{key:"run",value:function(){"undefined"!=typeof RocketPreloadLinksConfig&&new n(new RocketBrowserCompatibilityChecker({capture:!0,passive:!0}),RocketPreloadLinksConfig).init()}}]),n}();t.run(); }()); </script> <script type="rocketlazyloadscript" data-rocket-src="https://wpjian.com/wp-includes/js/imagesloaded.min.js?ver=5.0.0" id="imagesloaded-js" defer></script> <script type="rocketlazyloadscript" data-rocket-src="https://wpjian.com/wp-content/themes/networker/assets/vendor/flickity.pkgd.min.js?ver=1.1.4" id="flickity-js" defer></script> <script id="csco-scripts-js-extra"> var csLocalize = {"siteSchemeMode":"light","siteSchemeToogle":"1"}; var csco_mega_menu = {"rest_url":"https:\/\/wpjian.com\/wp-json\/csco\/v1\/menu-posts"}; </script> <script type="rocketlazyloadscript" data-rocket-src="https://wpjian.com/wp-content/themes/networker/assets/js/scripts.js?ver=1.1.4" id="csco-scripts-js" defer></script> </body> </html> <!-- WP Chinese Conversion Full Page Converted. Target Lang: zh-tw --> <!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me -->