{"id":4370,"date":"2018-01-13T18:23:44","date_gmt":"2018-01-13T17:23:44","guid":{"rendered":"https:\/\/florianbrinkmann.com\/en\/?p=4370"},"modified":"2020-02-09T10:59:38","modified_gmt":"2020-02-09T09:59:38","slug":"remove-theme-mod","status":"publish","type":"post","link":"https:\/\/florianbrinkmann.com\/en\/remove-theme-mod-4370\/","title":{"rendered":"Remove theme mod after button-click in the customizer"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In the upcoming version of my Hannover theme, there should be an improved user experience in the Customizer besides a reworked design and code base. Among other things, the user should be able to remove sections with a button click (like known from removing a menu in the customizer). After that, not only the section should be removed from the customizer, but also the corresponding theme mods need to be removed from the database. This post shows my solution for that.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Procedure summarized<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, it would be cool if we could use the JS API to remove theme mods after a button click. I cannot find a solution for that so we will use PHP for this part. The steps we will take:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>We add a customize control for the delete button.<\/li><li>We add a hidden customize control with a setting, which is used later in the PHP part to determine if the delete button was pressed.<\/li><li>We listen to the clicks on the delete button and change the value of the hidden control on click.<\/li><li>After saving the customize settings, we check via PHP if the button was clicked and remove the theme mods.<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">1. Creating the delete button<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For the delete button, I used core\u2019s approach for the button that removes a menu. For that, we create a small control template and include it into the customizer via PHP:<\/p>\n\n\n<pre class=\"wp-block-code lang-php\" aria-describedby=\"shcb-language-44\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n<span class=\"hljs-comment\">\/\/ Include customize control templates into the customizer.<\/span>\nadd_action( <span class=\"hljs-string\">'customize_controls_print_footer_scripts'<\/span>, <span class=\"hljs-string\">'hannover_customize_control_templates'<\/span> );\n\n<span class=\"hljs-comment\">\/**\n * Prints control templates into the customizer.\n *\/<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">hannover_customize_control_templates<\/span><span class=\"hljs-params\">()<\/span> <\/span>{ <span class=\"hljs-meta\">?&gt;<\/span><\/span>\n\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"text\/html\"<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\">\"tmpl-hannover-delete-portfolio-category-page-button\"<\/span>&gt;<\/span><span class=\"handlebars\"><span class=\"xml\">\n\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"hannover-customize-control-text-wrapper delete-portfolio-category-page\"<\/span>&gt;<\/span>\n\t\t\t<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">button<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\">\"button\"<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"button-link button-link-delete\"<\/span>&gt;<\/span>\n\t\t\t\t<span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span> _e( <span class=\"hljs-string\">'Delete category page'<\/span>, <span class=\"hljs-string\">'hannover'<\/span> ); <span class=\"hljs-meta\">?&gt;<\/span><\/span>\n\t\t\t<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">button<\/span>&gt;<\/span>\n\t\t<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n\t<\/span><\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<span class=\"php\"><span class=\"hljs-meta\">&lt;?php<\/span> }<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-44\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Now we can use the template for a control in the Customize JS API, and here is the code:<\/p>\n\n\n<pre class=\"wp-block-code lang-js\" aria-describedby=\"shcb-language-45\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\">\/**\n * Custom JavaScript functions for the customizer controls.\n *\n * <span class=\"hljs-doctag\">@version<\/span> 2.0.0\n *\n * <span class=\"hljs-doctag\">@package<\/span> Hannover\n *\/<\/span>\n;(<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-params\">(api)<\/span> <\/span>{\n\tapi.bind(<span class=\"hljs-string\">'ready'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-params\">()<\/span> <\/span>{\n\t\t<span class=\"hljs-comment\">\/\/ Create remove button control.<\/span>\n\t\tapi.control.add(\n\t\t\t<span class=\"hljs-keyword\">new<\/span> api.Control(<span class=\"hljs-string\">'portfolio_category_page&#91;1]&#91;delete]'<\/span>, {\n\t\t\t\tsection: <span class=\"hljs-string\">'hannover_portfolio_category_page_section&#91;1]'<\/span>,\n\t\t\t\ttemplateId: <span class=\"hljs-string\">'hannover-delete-portfolio-category-page-button'<\/span>\n\t\t\t})\n\t\t);\n\t});\n})(wp.customize);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-45\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Important is the value for <code class=\"lang-js\">templateId<\/code>, that corresponds to the <code class=\"lang-markup\">id<\/code> attribute of the <code class=\"lang-markup\">script<\/code> element in <code class=\"lang-php\">hannover_customize_control_templates()<\/code> \u2013 minus the <code class=\"lang-markup\">tmpl-<\/code> prefix. The number in the name of control and setting is for identification because the user can add new sections and its controls and settings dynamically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With that, we created the delete button and added it to a section. To make that work, we need a section of course, but that is not part of this article. I described the creation of panels, sections, and controls in my post \u00bb<a href=\"https:\/\/florianbrinkmann.com\/en\/4337\/panels-sections-controls-customize-js-api\/\">Creating panels, sections, and controls with the Customize JS API<\/a>\u00ab.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Creating hidden control and setting as removal flag<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To check if a delete button was clicked in the PHP part later, we create a hidden control with a setting \u2013 its value will be changed after a click on the delete button. This is the JS part:<\/p>\n\n\n<pre class=\"wp-block-code lang-js\" aria-describedby=\"shcb-language-46\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Add setting for removal flag.<\/span>\napi.add(<span class=\"hljs-keyword\">new<\/span> api.Setting(<span class=\"hljs-string\">'portfolio_category_page&#91;1]&#91;deleted]'<\/span>));\n\n<span class=\"hljs-comment\">\/\/ Add control for removal flag.<\/span>\napi.control.add(\n\t<span class=\"hljs-keyword\">new<\/span> api.Control(<span class=\"hljs-string\">'portfolio_category_page&#91;1]&#91;deleted]'<\/span>, {\n\t\t<span class=\"hljs-attr\">setting<\/span>: <span class=\"hljs-string\">'portfolio_category_page&#91;1]&#91;deleted]'<\/span>,\n\t\t<span class=\"hljs-attr\">type<\/span>: <span class=\"hljs-string\">'number'<\/span>,\n\t\t<span class=\"hljs-attr\">section<\/span>: <span class=\"hljs-string\">'hannover_portfolio_category_page_section&#91;1]'<\/span>,\n\t\t<span class=\"hljs-attr\">active<\/span>: <span class=\"hljs-literal\">false<\/span>,\n\t})\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-46\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">I described how to create a setting with the JS API in my article \u00bb<a href=\"https:\/\/florianbrinkmann.com\/en\/4345\/settings-customize-js-api\/\">Creating settings with the Customize JS API<\/a>\u00ab. We connect the control with the <code class=\"lang-js\">setting<\/code> via the setting key, declare the <code class=\"lang-js\">number<\/code> type, set the same value for <code class=\"lang-js\">section<\/code> like for the delete button and set <code class=\"lang-js\">active<\/code> to <code class=\"lang-js\">false<\/code>. With that, the control is not visible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Like said in the linked article, we need a small part of PHP to save settings that are created with the JS API:<\/p>\n\n\n<pre class=\"wp-block-code lang-php\" aria-describedby=\"shcb-language-47\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\">\/\/ Filter the dynamically created customizer settings.<\/span>\nadd_filter( <span class=\"hljs-string\">'customize_dynamic_setting_args'<\/span>, <span class=\"hljs-string\">'hannover_filter_dynamic_setting_args'<\/span>, <span class=\"hljs-number\">10<\/span>, <span class=\"hljs-number\">2<\/span> );\n\n<span class=\"hljs-comment\">\/**\n * Filters a dynamic setting's constructor args.\n *\n * For a dynamic setting to be registered, this filter must be employed\n * to override the default false value with an array of args to pass to\n * the WP_Customize_Setting constructor.\n *\n * <span class=\"hljs-doctag\">@link<\/span> https:\/\/wordpress.stackexchange.com\/a\/286503\/112824\n *\n * <span class=\"hljs-doctag\">@param<\/span> false|array $setting_args The arguments to the WP_Customize_Setting constructor.\n * <span class=\"hljs-doctag\">@param<\/span> string      $setting_id   ID for dynamic setting, usually coming from `$_POST&#91;'customized']`.\n *\n * <span class=\"hljs-doctag\">@return<\/span> array|false\n *\/<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">hannover_filter_dynamic_setting_args<\/span><span class=\"hljs-params\">( $setting_args, $setting_id )<\/span> <\/span>{\n\t<span class=\"hljs-comment\">\/\/ Create array of ID patterns.<\/span>\n\t$id_patterns = &#91;\n\t\t<span class=\"hljs-string\">'portfolio_category_page_deleted'<\/span> =&gt; <span class=\"hljs-string\">'\/^portfolio_category_page\\&#91;(\\d+)\\]\\&#91;deleted\\]\/'<\/span>,\n\t];\n\n\t<span class=\"hljs-comment\">\/\/ Match for the deleted portfolio category page setting.<\/span>\n\t<span class=\"hljs-keyword\">if<\/span> ( preg_match( $id_patterns&#91;<span class=\"hljs-string\">'portfolio_category_page_deleted'<\/span>], $setting_id, $matches ) ) {\n\t\t$setting_args = &#91;\n\t\t\t<span class=\"hljs-string\">'type'<\/span> =&gt; <span class=\"hljs-string\">'theme_mod'<\/span>,\n\t\t];\n\t}\n\n\t<span class=\"hljs-keyword\">return<\/span> $setting_args;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-47\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">3. Listening to clicks on the delete button and update the hidden control<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The complete JS code for listening to clicks and running the actions after that:<\/p>\n\n\n<pre class=\"wp-block-code lang-js\" aria-describedby=\"shcb-language-48\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-comment\">\/\/ Add click event listener to the delete button.<\/span>\n<span class=\"hljs-keyword\">var<\/span> deleteButton = <span class=\"hljs-built_in\">document<\/span>.querySelector(<span class=\"hljs-string\">'.delete-portfolio-category-page button'<\/span>);\ndeleteButton.addEventListener(<span class=\"hljs-string\">'click'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> (<span class=\"hljs-params\"><\/span>) <\/span>{\n\t<span class=\"hljs-comment\">\/\/ Close the section.<\/span>\n\tapi.section(<span class=\"hljs-string\">'hannover_portfolio_category_page_section&#91;1]'<\/span>).collapse();\n\n\t<span class=\"hljs-comment\">\/\/ Set flag that the setting needs to be removed.<\/span>\n\tapi.control(<span class=\"hljs-string\">'portfolio_category_page&#91;1]&#91;deleted]'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> (<span class=\"hljs-params\">control<\/span>) <\/span>{\n\t\tcontrol.setting.set(<span class=\"hljs-number\">-1<\/span>);\n\t});\n\n\t<span class=\"hljs-comment\">\/\/ Remove the section.<\/span>\n\tapi.section(<span class=\"hljs-string\">'hannover_portfolio_category_page_section&#91;1]'<\/span>).active(<span class=\"hljs-literal\">false<\/span>);\n});<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-48\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">After a click, we close the section first. After that, we set the value of the hidden control to <code class=\"lang-markup\">-1<\/code> and hide the section, so the user cannot see and open it in his current customizer setting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Removing theme mods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The PHP code for removing the theme mods:<\/p>\n\n\n<pre class=\"wp-block-code lang-php\" aria-describedby=\"shcb-language-49\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\">\/\/ Remove theme mods after portfolio category page was removed.<\/span>\nadd_action( <span class=\"hljs-string\">'customize_save_after'<\/span>, <span class=\"hljs-string\">'hannover_customize_save_after'<\/span> );\n\n<span class=\"hljs-comment\">\/**\n * Fires after customize settings are saved.\n *\n * <span class=\"hljs-doctag\">@param<\/span> WP_Customize_Manager $manager Instance of WP_Customize_Manager.\n *\/<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">hannover_customize_save_after<\/span><span class=\"hljs-params\">( $manager )<\/span> <\/span>{\n\t<span class=\"hljs-comment\">\/\/ Get the theme mods.<\/span>\n\t$theme_mods = get_theme_mods();\n\n\t<span class=\"hljs-comment\">\/\/ Loop them.<\/span>\n\t<span class=\"hljs-keyword\">foreach<\/span> ( $theme_mods&#91;<span class=\"hljs-string\">'portfolio_category_page'<\/span>] <span class=\"hljs-keyword\">as<\/span> $id =&gt; $portfolio_category_page_theme_mod ) {\n\t\t<span class=\"hljs-comment\">\/\/ Check if the delete flag is set.<\/span>\n\t\t<span class=\"hljs-keyword\">if<\/span> ( <span class=\"hljs-keyword\">isset<\/span>( $portfolio_category_page_theme_mod&#91;<span class=\"hljs-string\">'deleted'<\/span>] ) &amp;&amp; - <span class=\"hljs-number\">1<\/span> === $portfolio_category_page_theme_mod&#91;<span class=\"hljs-string\">'deleted'<\/span>] ) {\n\t\t\t<span class=\"hljs-comment\">\/\/ Code inspired by the remove_theme_mod() function.<\/span>\n\t\t\t<span class=\"hljs-keyword\">unset<\/span>( $theme_mods&#91;<span class=\"hljs-string\">'portfolio_category_page'<\/span>]&#91; $id ] );\n\n\t\t\t<span class=\"hljs-comment\">\/\/ Check if we have no more portfolio category pages and if so, unset the array index.<\/span>\n\t\t\t<span class=\"hljs-keyword\">if<\/span> ( <span class=\"hljs-keyword\">empty<\/span>( $theme_mods&#91;<span class=\"hljs-string\">'portfolio_category_page'<\/span>] ) ) {\n\t\t\t\t<span class=\"hljs-keyword\">unset<\/span>( $theme_mods&#91;<span class=\"hljs-string\">'portfolio_category_page'<\/span>] );\n\t\t\t} <span class=\"hljs-comment\">\/\/ End if().<\/span>\n\n\t\t\t<span class=\"hljs-comment\">\/\/ Check if that was the last theme mod and if so, remove the entry from the database.<\/span>\n\t\t\t<span class=\"hljs-keyword\">if<\/span> ( <span class=\"hljs-keyword\">empty<\/span> ( $theme_mods ) ) {\n\t\t\t\tremove_theme_mods();\n\t\t\t} <span class=\"hljs-keyword\">else<\/span> {\n\t\t\t\t<span class=\"hljs-comment\">\/\/ Get theme slug and update the theme mod option.<\/span>\n\t\t\t\t$theme = get_option( <span class=\"hljs-string\">'stylesheet'<\/span> );\n\t\t\t\tupdate_option( <span class=\"hljs-string\">\"theme_mods_$theme\"<\/span>, $theme_mods );\n\t\t\t} <span class=\"hljs-comment\">\/\/ End if().<\/span>\n\t\t} <span class=\"hljs-comment\">\/\/ End if().<\/span>\n\t} <span class=\"hljs-comment\">\/\/ End foreach().<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-49\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">We use the <code class=\"lang-php\">customize_save_after<\/code> action, which fires after saving the customizer settings. With <code class=\"lang-php\">get_theme_mods()<\/code> we fetch all theme mods and loop the <code class=\"lang-php\">$theme_mods['portfolio_category_page']<\/code> entries (because of my naming with the square brackets, the theme mods are stored in a multidimensional array in the database).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Inside the loop, we check if the <code class=\"lang-php\">deleted<\/code> key exists and if its value is <code class=\"lang-php\">-1<\/code>. If so, we remove the theme mods from the <code class=\"lang-php\">$theme_mods<\/code> array. After that, we check if <code class=\"lang-php\">$theme_mods['portfolio_category_page']<\/code> is empty now and remove it if that is the case. If this was also the last theme mod (that is the case, if <code class=\"lang-php\">$theme_mods<\/code> is empty at that point), we remove the theme mod entry from the database with <code class=\"lang-php\">remove_theme_mods()<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Otherwise, we get the slug of the theme and update the theme mod field with an <code class=\"lang-php\">update_option()<\/code> call, that gets the option name as the first param and the modified <code class=\"lang-php\">$theme_mods<\/code> array as the second.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And with that, we are at the end ? Not exactly easy and probably not the most elegant solution, but it does what I want \ud83d\ude42 If any of you have suggestions for improvements to this relatively complex procedure, please write a comment!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the upcoming version of my Hannover theme, there should be an improved user experience in the Customizer besides a reworked design and code base. Among other things, the user should be able to remove sections with a button click (like known from removing a menu in the customizer). After that, not only the section [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wpf_show_in_dewp_planet_feed":false,"flobn_post_versions":"","webmentions_disabled_pings":false,"webmentions_disabled":false,"lazy_load_responsive_images_disabled":false,"footnotes":""},"categories":[115],"tags":[],"class_list":["post-4370","post","type-post","status-publish","format-standard","hentry","category-wordpress-snippets"],"wp-worthy-pixel":{"ignored":false,"public":"d204eccadd66415d80fcf18e9303646f","server":"vg04.met.vgwort.de","url":"https:\/\/vg04.met.vgwort.de\/na\/d204eccadd66415d80fcf18e9303646f"},"wp-worthy-type":"normal","_links":{"self":[{"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/posts\/4370","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/comments?post=4370"}],"version-history":[{"count":2,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/posts\/4370\/revisions"}],"predecessor-version":[{"id":5817,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/posts\/4370\/revisions\/5817"}],"wp:attachment":[{"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/media?parent=4370"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/categories?post=4370"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/florianbrinkmann.com\/en\/wp-json\/wp\/v2\/tags?post=4370"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}