{"id":42054,"date":"2016-02-26T16:56:59","date_gmt":"2016-02-26T16:56:59","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=42054"},"modified":"2021-07-16T11:41:45","modified_gmt":"2021-07-16T11:41:45","slug":"twig-how-to-create-custom-extensions-or-filters","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/","title":{"rendered":"Twig &#8211; How to create custom extensions or filters"},"content":{"rendered":"\n<p>In PHP template engine, Twig there are various inbuilt awesome filters&nbsp;using that anyone can write large apps in less no. of lines like<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">{% for user in users %}\n\/\/write code based on user\n{% else %}\n\/\/you can add else condition in for array which will work is users is blank\n{% endfor %}\n<\/pre>\n\n\n\n<p>and various others filter too but these are limited and various default PHP function are not available in Twig then how can we use those ? For those cases Twig provide ways so that you can add your custom filters\/ extension. I am going to show you how.<\/p>\n\n\n\n<p><strong>First<\/strong> &nbsp;&#8211; Create your custom extension class extending&nbsp;class <em>\\Twig_Extension&nbsp;<\/em><\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php \nnamespace Webkul\\DemoBundle\\Twig;\n\nclass DemoExtension extends \\Twig_Extension\n{\n  \/\/here we will write code\n  \/\/two functions are necessary\n  \/\/ 1st - getFilters() where you declare all your custom extensions\n  \/\/ 2nd - getName() for your Extension class name\n}<\/pre>\n\n\n\n<p>It&#8217;s basic requirement&nbsp;is to declare two functions getFilters() and getName() &nbsp;so we add those here. In&nbsp;getFilters() function we declare our all custom filters\/ extensions and in&nbsp;getName() function we add this class name (any name).<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">&lt;?php\nnamespace Webkul\\DemoBundle\\Twig;\n\nclass DemoExtension extends \\Twig_Extension\n{\n    \/**\n     * Here we declare our custom filter with their respective function\n     *\/\n    public function getFilters()\n    {\n        return array(\n            new \\Twig_SimpleFilter('addslashes', array($this, 'addslashes')),\n            new \\Twig_SimpleFilter('utf8_decode', array($this, 'utf8_decode')),\n            new \\Twig_SimpleFilter('json_decode', array($this, 'json_decode')),\n            new \\Twig_SimpleFilter('urldecode', array($this, 'urldecode')),\n            \/\/here first urldecode is name which we use in twig and 2nd one is with refer to function written in this class\n        );\n    }\n\n    \/**\n     * add slash on string\n     *\/\n    public function addslashes($string)\n    {\n        return addslashes($string);\n    }\n\n    \/**\n     * utf8 decode string\n     *\/\n    public function utf8_decode($string) {\n        return utf8_decode($string);\n    }\n    \n    \/**\n     * json decode string\n     *\/\n    public function json_decode($string) {\n        return json_decode($string);\n    }\n    \n    \/**\n     * urldecode string\n     *\/\n    public function urldecode($string) {\n        return urldecode($string);\n    }\n\n    \/**\n     * {@inheritdoc}\n     *\/\n    public function getName()\n    {\n        return 'twig_extension';\n    }\n}\n\n?&gt;<\/pre>\n\n\n\n<p>So we created a class with various custom functions now we have to just notify Symfony about these filters\/ extensions. We do it after declaring this in our service.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">services:\n    webkul.twig_extension:\n        class: Webkul\\DemoBundle\\Twig\\DemoExtension\n        tags:\n            - { name: twig.extension }<\/pre>\n\n\n\n<p>That&#8217;s it our Custom filters\/ extensions are ready to use. We can use these like Twig default once.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted brush:php\">{{ \"Webkul's Awesome Symfony Twig Blog\"|addslashes }}<\/pre>\n\n\n\n<p>Framework used &#8211; Symfony 2.7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In PHP template engine, Twig there are various inbuilt awesome filters&nbsp;using that anyone can write large apps in less no. of lines like {% for user in users %} \/\/write code based on user {% else %} \/\/you can add else condition in for array which will work is users is blank {% endfor %} <a href=\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":14,"featured_media":41420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,2707,2708,2709],"tags":[2796,2057,2710,2772,2711,2712],"class_list":["post-42054","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-symfony","category-symfony2","category-twig","tag-custom-extension","tag-php","tag-symfony","tag-symfony-2","tag-symfony2","tag-twig"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Twig - How to create custom extensions or filters - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Twig - How to create custom extensions or filters - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"In PHP template engine, Twig there are various inbuilt awesome filters&nbsp;using that anyone can write large apps in less no. of lines like {% for user in users %} \/\/write code based on user {% else %} \/\/you can add else condition in for array which will work is users is blank {% endfor %} [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-26T16:56:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-16T11:41:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Nikhil Malik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Malik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\"},\"author\":{\"name\":\"Nikhil Malik\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/9a90e1b1a80142fc7445195c9ca8c8a4\"},\"headline\":\"Twig &#8211; How to create custom extensions or filters\",\"datePublished\":\"2016-02-26T16:56:59+00:00\",\"dateModified\":\"2021-07-16T11:41:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\"},\"wordCount\":187,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png\",\"keywords\":[\"custom extension\",\"PHP\",\"symfony\",\"Symfony 2\",\"symfony2\",\"twig\"],\"articleSection\":[\"php\",\"Symfony\",\"Symfony2\",\"Twig\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\",\"url\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\",\"name\":\"Twig - How to create custom extensions or filters - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png\",\"datePublished\":\"2016-02-26T16:56:59+00:00\",\"dateModified\":\"2021-07-16T11:41:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Twig &#8211; How to create custom extensions or filters\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/9a90e1b1a80142fc7445195c9ca8c8a4\",\"name\":\"Nikhil Malik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/335b26b1a56ac61c8dcf3b6fa4c8c3d1e68ed57cd9db7e6f5dfa97cc506cf0d5?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/335b26b1a56ac61c8dcf3b6fa4c8c3d1e68ed57cd9db7e6f5dfa97cc506cf0d5?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Nikhil Malik\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/nikhil\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Twig - How to create custom extensions or filters - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/","og_locale":"en_US","og_type":"article","og_title":"Twig - How to create custom extensions or filters - Webkul Blog","og_description":"In PHP template engine, Twig there are various inbuilt awesome filters&nbsp;using that anyone can write large apps in less no. of lines like {% for user in users %} \/\/write code based on user {% else %} \/\/you can add else condition in for array which will work is users is blank {% endfor %} [...]","og_url":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-02-26T16:56:59+00:00","article_modified_time":"2021-07-16T11:41:45+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png","type":"image\/png"}],"author":"Nikhil Malik","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Nikhil Malik","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/"},"author":{"name":"Nikhil Malik","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/9a90e1b1a80142fc7445195c9ca8c8a4"},"headline":"Twig &#8211; How to create custom extensions or filters","datePublished":"2016-02-26T16:56:59+00:00","dateModified":"2021-07-16T11:41:45+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/"},"wordCount":187,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png","keywords":["custom extension","PHP","symfony","Symfony 2","symfony2","twig"],"articleSection":["php","Symfony","Symfony2","Twig"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/","url":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/","name":"Twig - How to create custom extensions or filters - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png","datePublished":"2016-02-26T16:56:59+00:00","dateModified":"2021-07-16T11:41:45+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/arec_919adv21204-2888_to_9197184677ssszzcv11_03-Aug-15_14-50-1-1-1.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/twig-how-to-create-custom-extensions-or-filters\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Twig &#8211; How to create custom extensions or filters"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/9a90e1b1a80142fc7445195c9ca8c8a4","name":"Nikhil Malik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/335b26b1a56ac61c8dcf3b6fa4c8c3d1e68ed57cd9db7e6f5dfa97cc506cf0d5?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/335b26b1a56ac61c8dcf3b6fa4c8c3d1e68ed57cd9db7e6f5dfa97cc506cf0d5?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Nikhil Malik"},"url":"https:\/\/webkul.com\/blog\/author\/nikhil\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/42054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=42054"}],"version-history":[{"count":6,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/42054\/revisions"}],"predecessor-version":[{"id":296471,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/42054\/revisions\/296471"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/41420"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=42054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=42054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=42054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}