{"id":342,"date":"2013-04-29T14:56:38","date_gmt":"2013-04-29T19:56:38","guid":{"rendered":"http:\/\/www.marcblase.com\/blog\/?p=342"},"modified":"2013-08-21T09:57:36","modified_gmt":"2013-08-21T14:57:36","slug":"add-button-to-wordpress-editor-tinymce","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2013\/04\/add-button-to-wordpress-editor-tinymce\/","title":{"rendered":"Add button to WordPress editor ~ TinyMCE"},"content":{"rendered":"<p>Don&#8217;t know why I&#8217;ve never done this before, but it&#8217;s quite simple. And makes it easier for users to add items in the visual editor, instead of [*gasp*] the text editor.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction enable_more_buttons($buttons) {\r\n  $buttons&#x5B;] = 'hr';\r\n  \/\/ Repeat with any other buttons you want to add, e.g.\r\n  \/\/ $buttons&#x5B;] = 'fontselect';\r\n  \/\/ $buttons&#x5B;] = 'sup';\r\n  return $buttons;\r\n}\r\nadd_filter(&quot;mce_buttons&quot;, &quot;enable_more_buttons&quot;);\r\n<\/pre>\n<p>For more info here&#8217;s <a href=\"http:\/\/codex.wordpress.org\/TinyMCE_Custom_Buttons\" target=\"_blank\">the article<\/a> at WordPress Codex.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Don&#8217;t know why I&#8217;ve never done this before, but it&#8217;s quite simple. And makes it easier for users to add items in the visual editor, instead of [*gasp*] the text editor. function enable_more_buttons($buttons) { $buttons&#x5B;] = &#8216;hr&#8217;; \/\/ Repeat with any other buttons you want to add, e.g. \/\/ $buttons&#x5B;] = &#8216;fontselect&#8217;; \/\/ $buttons&#x5B;] = [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3],"tags":[],"class_list":["post-342","post","type-post","status-publish","format-standard","hentry","category-coding","category-discoveries"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/342","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=342"}],"version-history":[{"count":2,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/342\/revisions"}],"predecessor-version":[{"id":356,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/342\/revisions\/356"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=342"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=342"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=342"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}