使用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 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-61514 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/tips/2024091461514.html" data-wpel-link="internal">如何更新到 WordPress 6.6.2 维护版本</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61502 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="85" src="https://wpjian.com/wp-content/uploads/2024/09/Error.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/tips/2024091461502.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/tips/2024091461502.html" data-wpel-link="internal">如何修复 WordPress 网站上的 500 内部服务器错误</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61489 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="69" src="https://wpjian.com/wp-content/uploads/2024/09/wpcode-search-1024x473-1.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/tips/2024091461489.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/tips/2024091461489.html" data-wpel-link="internal">如何修复 WordPress 中的“您所关注的链接已过期”错误</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61485 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/tips/2024091461485.html" data-wpel-link="internal">如何修复 WordPress 帖子 404 错误:快速简便的解决方案</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61470 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="85" src="https://wpjian.com/wp-content/uploads/2024/09/common-block-editor-issues-and-how-to-fix-it.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/tips/2024091461470.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/tips/2024091461470.html" data-wpel-link="internal">13 个常见的 WordPress 块编辑器问题及其解决方法</a> </h3> </div> </div> </article> </li> <li class="pk-post-item"> <article class="post-61459 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="64" src="https://wpjian.com/wp-content/uploads/2024/09/20240914.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="激活默认主题" decoding="async" loading="lazy" /> </div> <a class="cs-overlay-link" href="https://wpjian.com/tips/2024091461459.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/tips/2024091461459.html" data-wpel-link="internal">如何修复“您的网站出现严重错误”错误</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-34540 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/tips/2020081234540.html" data-wpel-link="internal">WordPress 5.5在这里! 您需要知道的5件事</a></h2> <div class="cs-entry__excerpt"> 乔斯特·德·沃克 Joost de Valk是Yoast的创始人兼首席产品官。 他是… </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">2020年8月12日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/tips/2020081234540.html" data-wpel-link="internal"> 阅读更多 </a> </div> </div> </div> </div> </article> <article class="cs-entry-default post-59757 post type-post status-publish format-standard 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/tips/2022120959757.html" data-wpel-link="internal">为您的企业使用客户在线聊天的 5 个理由</a></h2> <div class="cs-entry__excerpt"> 近年来,实时聊天功能席卷了商业世界。 如今,它在提供数字客户服务方面发挥着至关重要的… </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年12月9日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/tips/2022120959757.html" data-wpel-link="internal"> 阅读更多 </a> </div> </div> </div> </div> </article> <article class="cs-entry-default post-51472 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/tips/2021120351472.html" data-wpel-link="internal">如何更改 HTML 字体颜色</a></h2> <div class="cs-entry__excerpt"> 在定制您的网站时,字体颜色经常被忽视。在大多数情况下,网站所有者会保留默认字体颜色,… </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年12月3日</div></div> </div> </div> <div class="cs-entry__read-more"> <a href="https://wpjian.com/tips/2021120351472.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/" data-wpel-link="internal"> WP建站 </a> </div> <div class="cs-footer__desc"> <p class="copyright">© 2019 - 2022 by <a href="https://wpjian.com" 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> <!-- This website is like a Rocket, isn't it? Performance optimized by WP Rocket. Learn more: https://wp-rocket.me -->