{"id":33889,"date":"2019-03-01T13:06:45","date_gmt":"2019-03-01T13:06:45","guid":{"rendered":"http:\/\/getshortcodes.com\/?post_type=docs&#038;p=33889"},"modified":"2019-03-02T08:05:05","modified_gmt":"2019-03-02T08:05:05","slug":"modifying-original-shortcodes","status":"publish","type":"docs","link":"https:\/\/getshortcodes.com\/docs\/modifying-original-shortcodes\/","title":{"rendered":"Modifying original shortcodes"},"content":{"rendered":"\n<p>Use&nbsp;<em>su\/data\/shortcodes<\/em>&nbsp;filter to modify original shortcodes. You can find default shortcodes in the&nbsp;<em>\/wp-content\/plugins\/shortcodes-ultimate\/includes\/shortcodes\/<\/em>&nbsp;folder.<\/p>\n\n\n\n<p>Use the following code snippets in the&nbsp;<em>functions.php<\/em>&nbsp;of your theme.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example-modifying-attributes\">Example (modifying attributes)<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">add_filter( 'su\/data\/shortcodes', 'add_custom_button_style' );<br><br>\/**<br> * Filter to modify original shortcodes data.<br> *<br> * @param array   $shortcodes Default shortcodes<br> * @return array Modified array<br> *\/<br>function add_custom_button_style( $shortcodes ) {<br><br>  \/\/ Remove all default styles before adding custom one<br>  $shortcodes['button']['atts']['style']['values'] = array();<br><br>  \/\/ Add new button style<br>  $shortcodes['button']['atts']['style']['values']['custom-style'] = 'Custom style';<br><br>  \/\/ Remove target attribute<br>  unset( $shortcodes['button']['atts']['target'] );<br><br>  \/\/ Return modified data<br>  return $shortcodes;<br>}<\/pre>\n","protected":false},"featured_media":0,"template":"","docs_category":[24],"class_list":["post-33889","docs","type-docs","status-publish","hentry","docs_category-api"],"_links":{"self":[{"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs\/33889","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=33889"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/getshortcodes.com\/api\/wp\/v2\/docs_category?post=33889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}