{"id":36283,"date":"2020-07-27T10:22:05","date_gmt":"2020-07-27T10:22:05","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=36283"},"modified":"2020-07-27T10:22:05","modified_gmt":"2020-07-27T10:22:05","slug":"how-to-disable-the-last-used-settings-preset","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/how-to-disable-the-last-used-settings-preset\/","title":{"rendered":"How to disable the &#8220;Last used settings&#8221; preset"},"content":{"rendered":"\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-1024x640.png\" alt=\"\" class=\"wp-image-36284\" srcset=\"https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-1024x640.png 1024w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-512x320.png 512w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-128x80.png 128w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-768x480.png 768w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-80x50.png 80w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-24x15.png 24w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11-114x70.png 114w, https:\/\/getshortcodes.com\/wp-content\/uploads\/2020\/07\/27-07-2020@13-11-11.png 1392w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><em>Last used settings<\/em> is a service preset which is automatically created every time you insert a shortcode using the <em>Insert shortcode<\/em> tool. It stores the settings you used for the inserted shortcode and restores them next time you&#8217;re going to insert the shortcode.<\/p>\n\n\n\n<p>Sometimes you may need to disable this behavior. To do that, follow the steps below.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1\">Step 1<\/h2>\n\n\n\n<p>Add the following snippet to the end of the <em>functions.php<\/em> file of your theme:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter(\n\t'option_su_presets_SHORTCODENAME',\n\tfunction( $value ) {\n\n\t\tif ( isset( $value&#091;'last_used'] ) ) {\n\t\t\tunset( $value&#091;'last_used'] );\n\t\t}\n\n\t\treturn $value;\n\n\t}\n);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2\">Step 2<\/h2>\n\n\n\n<p>Replace <em>SHORCODENAME<\/em> in the snippet with the name of a shortcode you want to disable the preset for, without the <em>su_<\/em> prefix. For example, if you want to disable the <em>Last used settings<\/em> preset for the <em><a href=\"https:\/\/getshortcodes.com\" class=\"su-button su-button-style-default\" style=\"color:#FFFFFF;background-color:#2D89EF;border-color:#246ec0;border-radius:5px\" target=\"_self\"><span style=\"color:#FFFFFF;padding:0px 16px;font-size:13px;line-height:26px;border-color:#6cadf4;border-radius:5px;text-shadow:none\"> <\/span><\/a><\/em> shortcode, use the following snippet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter(\n\t'option_su_presets_button',\n\tfunction( $value ) {\n\n\t\tif ( isset( $value&#091;'last_used'] ) ) {\n\t\t\tunset( $value&#091;'last_used'] );\n\t\t}\n\n\t\treturn $value;\n\n\t}\n);<\/code><\/pre>\n","protected":false},"featured_media":0,"template":"","docs_category":[24,22],"class_list":["post-36283","docs","type-docs","status-publish","hentry","docs_category-api","docs_category-troubleshooting"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/36283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/types\/docs"}],"wp:attachment":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/media?parent=36283"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=36283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}