{"id":148,"date":"2013-09-05T17:40:32","date_gmt":"2013-09-05T17:40:32","guid":{"rendered":"http:\/\/aurelio.audero.it\/blog\/?p=148"},"modified":"2022-08-16T23:04:52","modified_gmt":"2022-08-16T23:04:52","slug":"how-to-create-custom-filters-in-jquery","status":"publish","type":"post","link":"https:\/\/www.audero.it\/blog\/2013\/09\/05\/how-to-create-custom-filters-in-jquery\/","title":{"rendered":"How to Create Custom Filters in jQuery"},"content":{"rendered":"<p>In some cases you may need a shortcut to collect elements for which jQuery doesn&#8217;t provide a specific filter. This is exactly where custom filters come into play.<\/p>\n<p>In this article, extracted from my book <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Instant jQuery Selectors<\/a>, you&#8217;ll learn how to build a custom filter in <a href=\"https:\/\/jquery.com\/\" target=\"_blank\" rel=\"noopener\">jQuery<\/a>. Please note that, to be a complete post, it has some minor adjustment compared to the original recipe titled <cite>Custom filters (Become an expert)<\/cite>.<br \/>\n<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"797\" data-permalink=\"https:\/\/www.audero.it\/blog\/2013\/09\/16\/15-tips-to-improve-your-jquery-selectors\/jquery-logo-2\/\" data-orig-file=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png\" data-orig-size=\"1666,833\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo-1024x512.png\" src=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png\" alt=\"jquery logo\" width=\"1666\" height=\"833\" class=\"aligncenter size-full wp-image-797\" srcset=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png 1666w, https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo-300x150.png 300w, https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo-1024x512.png 1024w\" sizes=\"auto, (max-width: 1666px) 100vw, 1666px\" \/><\/p>\n<div class=\"note clearfix\">\n<a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignleft\" src=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/instant-jquery-selectors-cover.png\" alt=\"Instant jQuery Selectors cover\"  \/><\/a><br \/>\nThis article is extracted from my book <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Instant jQuery Selectors<\/a>. Consider buying it on the <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Packt Publishing website<\/a> or on <a href=\"https:\/\/www.amazon.com\/Instant-jQuery-Selectors-ebook\/dp\/B00ESX17MU\/\" target=\"_blank\" rel=\"noopener\">Amazon<\/a>.<\/p>\n<p><cite>Instant jQuery Selectors<\/cite> is a practical guide that will teach you how to use jQuery&#8217;s selectors efficiently in order to easily select the elements of your pages to operate upon with jQuery&#8217;s methods. You will go through the most common problems that you could face while developing your project and will learn how to solve them with the help of focused examples that <cite>Instant jQuery Selectors<\/cite> has to offer.\n<\/div>\n<h2>How to do it&#8230;<\/h2>\n<p>Our goal is to print the length of the elements having the placeholder attribute set, taking advantage of a previously created custom filter. In addition, to see all of the available options in action, we&#8217;ll create a second filter to collect all of the elements having a name with less than a given number of characters.<\/p>\n<p>To complete the task, follow the steps described below.<\/p>\n<h3>Step 1<\/h3>\n<p>Create a file and rename it as <code>custom-filters.html<\/code>.<\/p>\n<h3>Step 2<\/h3>\n<p>Open the file using a simple text editor, like Notepad++ on Windows, Sublime on Mac, or Gedit on Linux, or with your favourite IDE. In this file, we&#8217;ll create a simple form with some typical fields like &#8220;Name&#8221;, &#8220;Surname&#8221;, and so on. All these fields have the specification of the type (<code>type<\/code> attribute) and the name (<code>name<\/code> attribute), but few of them also have a placeholder set (<code>placeholder<\/code> attribute).<\/p>\n<p>Now, that you know what we&#8217;ll put in the file, just copy the HTML code below and save the changes.<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n   &lt;head&gt;\r\n      &lt;meta charset=&quot;UTF-8&quot;&gt;\r\n      &lt;title&gt;Instant jQuery Selector How-to&lt;\/title&gt;\r\n      &lt;style&gt;\r\n         input,\r\n         select,\r\n         textarea\r\n         {\r\n            display: block;\r\n         }\r\n      &lt;\/style&gt;\r\n      &lt;!-- Script will be placed here... --&gt;\r\n   &lt;\/head&gt;\r\n   &lt;body&gt;\r\n      &lt;form name=&quot;registration-form&quot; id=&quot;registration-form&quot; action=&quot;registration.php&quot; method=&quot;post&quot;&gt;\r\n         &lt;label&gt;Name:&lt;\/label&gt;\r\n         &lt;input type=&quot;text&quot; name=&quot;name&quot; placeholder=&quot;Name&quot; \/&gt;\r\n         &lt;label&gt;Surname:&lt;\/label&gt;\r\n         &lt;input type=&quot;text&quot; name=&quot;surname&quot; placeholder=&quot;Surname&quot; \/&gt;\r\n         &lt;label&gt;Email:&lt;\/label&gt;\r\n         &lt;input type=&quot;email&quot; name=&quot;email&quot; placeholder=&quot;Email&quot; \/&gt;\r\n         &lt;label&gt;Phone:&lt;\/label&gt;\r\n         &lt;input type=&quot;tel&quot; name=&quot;phone-number&quot; placeholder=&quot;Phone number&quot; disabled=&quot;disabled&quot; \/&gt;\r\n         &lt;label&gt;Privacy:&lt;\/label&gt;\r\n         &lt;input name=&quot;privacy&quot; type=&quot;checkbox&quot; checked=&quot;checked&quot; \/&gt;\r\n         &lt;label&gt;Contact me:&lt;\/label&gt;\r\n         &lt;input name=&quot;contact-me&quot; type=&quot;checkbox&quot; \/&gt;\r\n         &lt;label&gt;Sex:&lt;\/label&gt;\r\n         &lt;select name=&quot;sex&quot;&gt;\r\n            &lt;option selected=&quot;selected&quot; value=&quot;m&quot;&gt;Male&lt;\/option&gt;\r\n            &lt;option value=&quot;f&quot;&gt;Female&lt;\/option&gt;\r\n         &lt;\/select&gt;\r\n         &lt;input type=&quot;submit&quot; value=&quot;Register&quot; \/&gt;\r\n      &lt;\/form&gt;\r\n   &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>Step 3<\/h3>\n<p>Replace the comment we put (<code>&lt;!-- Script will be placed here... --&gt;<\/code>) with the following code:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script src=&quot;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.10.1\/jquery.min.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n    $.expr&#x5B;':'].placeholder = function(elem) {\r\n        return $(elem).attr('placeholder') !== undefined;\r\n    };\r\n    $.expr&#x5B;':'].nameLengthLessThan = \r\n    $.expr.createPseudo(function(filterParam) {\r\n        var length = parseInt(filterParam);\r\n        return function(elem, context, isXml) {\r\n            return $(elem).attr('name') !== undefined &amp;&amp; \r\n            $(elem).attr('name').length &lt; length;\r\n      }\r\n    });\r\n    $(document).ready(function() {\r\n        console.log($(':placeholder').length);\r\n        console.log($('input:nameLengthLessThan(5)').length);\r\n    });\r\n&lt;\/script&gt;\r\n<\/pre>\n<h3>Step 4<\/h3>\n<p>Save the file and open it with your favorite browser. Once the page is loaded, look at the console&#8217;s output.<\/p>\n<h2>How it works&#8230;<\/h2>\n<p>At the very beginning of our JavaScript instructions for this page, we&#8217;ve added a property, or more specifically a function called placeholder to the <code>:<\/code> (yes, it&#8217;s a property called colon, you read it right) attribute that belongs to the jQuery&#8217;s <code>expr<\/code> attribute. <code>:<\/code> is a property containing jQuery&#8217;s native filters and you can use it to add your own at runtime. Inside the function definition, we just have a single statement that checks if the current element has the placeholder attribute set, and if so, it returns true to keep the element.<\/p>\n<p>As you can see from the example, in this basic version, a filter is nothing but a function that accepts as an argument the current DOM element to process and needs to return true to keep it in the collection, and false to discard it. You should use this method when the following are true:<\/p>\n<ul>\n<li>you&#8217;re interested only in the element to process itself<\/li>\n<li>the filter doesn&#8217;t accept an argument<\/li>\n<li>the context to which the selection is applied doesn&#8217;t matter<\/li>\n<\/ul>\n<p>The second custom filter, called <code>nameLengthLessThan<\/code>, is slightly more complicated and uses the method introduced (and encouraged) starting from jQuery 1.8. To the <code>createPseudo<\/code> function we pass an <strong>anonymous function<\/strong> having a parameter that represents the argument passed to the filter when you use it. Inside it, we create another function that will be returned and that is responsible to perform the filtering. To the latter, jQuery passes the element to be processed (<code>elem<\/code> parameter), the DOMElement or DOMDocument from which selection will occur (<code>context<\/code> parameter), and a Boolean that tells if you&#8217;re operating on an XML document. As you may guess, for this filter we need this pattern because our filter needs to know the limit of characters the name attribute of the element must comply with. In other words, we need to pass the number of characters the value of the name attribute must respect.<\/p>\n<p>Inside the inner-most function, we write the code to test if the element should be kept or not, for our example, this means checking whether the name attribute is set and its length is not less than the given length (stored using a closure inside the length variable).<\/p>\n<p>Now that we&#8217;ve created the filters, we need to use it. Inside the handler for the <code>document.ready<\/code> event, there are two statements. The first calls the placeholder filter without parameters and using implicitly the Universal selector. The second uses the <code>nameLengthLessThan<\/code> filter passing 5 as parameter and using the Element selector. Using the Element selector in the second call will result in a performance improvement. The execution of our code will result, as expected, in the following lines printed on the console:<\/p>\n<pre>\r\n4\r\n1\r\n<\/pre>\n<h2>Conclusions<\/h2>\n<p>In this article I explained how you can create a custom filter in jQuery both using the old and the new, introduced in jQuery 1.8, methods. It&#8217;s important to know both because while in new projects you&#8217;ll hopefully find the latter method, in some projects you may find the former and will be an advantage if you know how to act, especially if the jQuery version can&#8217;t be updated.<\/p>\n<p><strong>Note<\/strong>: for those thinking about the best practice of putting the <code>&lt;script&gt;<\/code>s before the <code>&lt;body&gt;<\/code> tag is closed, instead of inside the <code>&lt;head&gt;<\/code> of the page, I want to outline that it&#8217;s specified in one of the first pages of the book.<\/p>\n<div class=\"note clearfix\">\n<a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" class=\"alignleft\" src=\"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/instant-jquery-selectors-cover.png\" alt=\"Instant jQuery Selectors cover\"  \/><\/a><br \/>\nIf you liked this article, consider buying my book <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Instant jQuery Selectors<\/a> on the <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Packt Publishing website<\/a> or on <a href=\"https:\/\/www.amazon.com\/Instant-jQuery-Selectors-ebook\/dp\/B00ESX17MU\/\" target=\"_blank\" rel=\"noopener\">Amazon<\/a>.<\/p>\n<p><cite>Instant jQuery Selectors<\/cite> is for web developers who want to delve into jQuery from its very starting point: selectors. Even if you&#8217;re already familiar with the framework and its selectors, you could find several tips and tricks that you aren&#8217;t aware of, especially about performance and how jQuery acts behind the scenes.\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In some cases you may need a shortcut to collect elements for which jQuery doesn&#8217;t provide a specific filter. This is exactly where custom filters come into play.<\/p>\n<p>In this article, extracted from my book <a href=\"https:\/\/www.packtpub.com\/product\/instant-jquery-selectors\/9781783282210\" target=\"_blank\" rel=\"noopener\">Instant jQuery Selectors<\/a>, you&#8217;ll learn how to build a custom filter in <a href=\"https:\/\/jquery.com\/\" target=\"_blank\" rel=\"noopener\">jQuery<\/a>. Please note that, to be a complete post, it has some minor adjustment compared to the original recipe titled <cite>Custom filters (Become an expert)<\/cite>.<\/p>\n","protected":false},"author":1,"featured_media":153,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[22,46,8,20,11],"class_list":["post-148","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-book","tag-javascript","tag-jquery","tag-jquery-selectors","tag-web"],"jetpack_featured_media_url":"https:\/\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jQuery-logo.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9Or4e-2o","jetpack-related-posts":[{"id":170,"url":"https:\/\/www.audero.it\/blog\/2013\/09\/16\/15-tips-to-improve-your-jquery-selectors\/","url_meta":{"origin":148,"position":0},"title":"15 Tips to Improve Your jQuery Selectors","author":"Aurelio De Rosa","date":"September 16, 2013","format":false,"excerpt":"Who don't know what jQuery is and how it can help in developing a web project. Based on the latest statistics, jQuery is used on ~60% of the Quantcast Top 100k websites. We use it constantly and sometimes we tend to think it's almost magic, that jQuery is capable to\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/www.audero.it\/blog\/category\/javascript\/"},"img":{"alt_text":"jquery logo","src":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/09\/jquery-logo.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":140,"url":"https:\/\/www.audero.it\/blog\/2013\/09\/03\/instant-jquery-selectors-my-first-book-is-out\/","url_meta":{"origin":148,"position":1},"title":"Instant jQuery Selectors: My first book is out!","author":"Aurelio De Rosa","date":"September 3, 2013","format":false,"excerpt":"Today I'm really pleased to announce that few days ago my first book, titled Instant jQuery Selectors, was published by the Packt Publishing. Publishing a book has always been one of my goals since I started my developer career, and now that I realized it I can't explain how I'm\u2026","rel":"","context":"In &quot;News&quot;","block_context":{"text":"News","link":"https:\/\/www.audero.it\/blog\/category\/news\/"},"img":{"alt_text":"Instant jQuery selectors cover","src":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/10\/instant-jquery-selectors-cover.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":203,"url":"https:\/\/www.audero.it\/blog\/2013\/10\/15\/codemotion-madrid-2013-giveaway-win-a-free-copy-of-instant-jquery-selectors\/","url_meta":{"origin":148,"position":2},"title":"Codemotion Madrid 2013 Giveaway: Win a Free Copy of Instant jQuery Selectors","author":"Aurelio De Rosa","date":"October 15, 2013","format":false,"excerpt":"As some of you may be already aware, on Saturday October 19th 2013 I'll speak at Codemotion Madrid with a talk titled People don't give a f**k of JavaScript. If you didn't know it, it's because you don't follow me on Twitter and you're a bad guy or girl. Anyway,\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.audero.it\/blog\/category\/general\/"},"img":{"alt_text":"Instant jQuery selectors cover","src":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2013\/10\/instant-jquery-selectors-cover.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":329,"url":"https:\/\/www.audero.it\/blog\/2014\/09\/19\/resources-beginner-front-end-developers\/","url_meta":{"origin":148,"position":3},"title":"Resources for Beginner Front-end Developers","author":"Aurelio De Rosa","date":"September 19, 2014","format":false,"excerpt":"Few weeks ago I received an email from a developer asking me for suggestions on how to delve into the front-end world. After having replied to this email, I thought that it'd have been nice to share the same suggestions on my blog. That's exactly what you'll find in this\u2026","rel":"","context":"In &quot;Discussions &amp; Opinions&quot;","block_context":{"text":"Discussions &amp; Opinions","link":"https:\/\/www.audero.it\/blog\/category\/discussions-opinions\/"},"img":{"alt_text":"html5 css3 javascript logos","src":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2014\/09\/front-end-stack.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2014\/09\/front-end-stack.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2014\/09\/front-end-stack.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2014\/09\/front-end-stack.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2014\/09\/front-end-stack.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":599,"url":"https:\/\/www.audero.it\/blog\/2016\/10\/03\/5-reasons-start-writing-technical-articles\/","url_meta":{"origin":148,"position":4},"title":"5 reasons why you should start writing technical articles","author":"Aurelio De Rosa","date":"October 3, 2016","format":false,"excerpt":"A few weeks ago, LinkedIn has reminded me that it was four years ago (on the 8th of September 2012) when my first technical article, titled Create Your Own HTML5 Environmental Thermometer, went live. The article was published by SitePoint at a time where the editor was Tom Museth (still\u2026","rel":"","context":"In &quot;Discussions &amp; Opinions&quot;","block_context":{"text":"Discussions &amp; Opinions","link":"https:\/\/www.audero.it\/blog\/category\/discussions-opinions\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2016\/10\/knowledge.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2016\/10\/knowledge.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2016\/10\/knowledge.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2016\/10\/knowledge.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/www.audero.it\/blog\/wp-content\/uploads\/2016\/10\/knowledge.jpg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":217,"url":"https:\/\/www.audero.it\/blog\/2013\/11\/05\/my-experience-at-codemotion-madrid-2013\/","url_meta":{"origin":148,"position":5},"title":"My Experience at Codemotion Madrid 2013","author":"Aurelio De Rosa","date":"November 5, 2013","format":false,"excerpt":"As I announced in September, on the 19th October 2013 I spoke at Codemotion Madrid 2013 presenting a talk titled People don't give a f**k of JavaScript, where I showed some new HTML5 APIs. This article is a wrap up of my experience at the event, both as a speaker\u2026","rel":"","context":"In &quot;Discussions &amp; Opinions&quot;","block_context":{"text":"Discussions &amp; Opinions","link":"https:\/\/www.audero.it\/blog\/category\/discussions-opinions\/"},"img":{"alt_text":"Friends of Codemotion Madrid 2013","src":"https:\/\/i0.wp.com\/aurelio.audero.it\/blog\/wp-content\/uploads\/2013\/11\/friends-of-codemotion-madrid-2013-300x225.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":30,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":950,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions\/950"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/media\/153"}],"wp:attachment":[{"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.audero.it\/blog\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}