{"id":2634,"date":"2015-12-13T06:48:54","date_gmt":"2015-12-13T06:48:54","guid":{"rendered":"http:\/\/musilda.cz\/?p=2634"},"modified":"2015-12-13T06:48:54","modified_gmt":"2015-12-13T06:48:54","slug":"jak-vypnout-editor-obsahu-pro-urcite-stranky","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-vypnout-editor-obsahu-pro-urcite-stranky\/","title":{"rendered":"Jak vypnout editor obsahu, pro ur\u010dit\u00e9 str\u00e1nky"},"content":{"rendered":"

Editor obsahu, je obrovsk\u00fd pomocn\u00edk, pro v\u0161echny autory a d\u00edky n\u011bmu se \u010dl\u00e1nky p\u00ed\u0161i velmi snadno. V p\u0159\u00edpad\u011b, \u017ee v\u0161ak vytv\u00e1\u0159\u00edte \u0161ablonu str\u00e1nky a obsah definujete pomoc\u00ed metabox\u016f, m\u016f\u017ee se v\u00e1m hodit editor vypnout.<\/p>\n

Nen\u00ed to zrovna nezbytn\u00e1 z\u00e1le\u017eitost, ale u\u017eivatel\u00e9, kte\u0159\u00ed nepracuj\u00ed s WordPressem ka\u017ed\u00fd den, mohou m\u00edt tendenci, ps\u00e1t do editoru.<\/p>\n

Dne\u0161n\u00ed snippet v\u00e1m tady umo\u017en\u00ed vypnout editor, pro ur\u010dit\u00e9 str\u00e1nky, jen\u017e maj\u00ed p\u0159i\u0159azenou ur\u010ditou \u0161ablonu:<\/p>\n

\nif(is_admin()){\n\nadd_action( 'admin_init', 'musilda_hide_editor' );\nfunction musilda_hide_editor() {\n\n\t$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;\n\tif( !isset( $post_id ) ) return;\n\n\t$get_template_file = get_post_meta($post_id, '_wp_page_template', true);\n\n    if($get_template_file == 'kontakt.php'){ \/\/ edit the template name\n    \tremove_post_type_support('page', 'editor');\n    }\n}\n\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

Editor obsahu, je obrovsk\u00fd pomocn\u00edk, pro v\u0161echny autory a d\u00edky n\u011bmu se \u010dl\u00e1nky p\u00ed\u0161i velmi snadno. V p\u0159\u00edpad\u011b, \u017ee v\u0161ak vytv\u00e1\u0159\u00edte \u0161ablonu str\u00e1nky a obsah definujete pomoc\u00ed metabox\u016f, m\u016f\u017ee se v\u00e1m hodit editor vypnout. Nen\u00ed to zrovna nezbytn\u00e1 z\u00e1le\u017eitost, ale u\u017eivatel\u00e9, kte\u0159\u00ed nepracuj\u00ed s WordPressem ka\u017ed\u00fd den, mohou m\u00edt tendenci, ps\u00e1t do editoru. Dne\u0161n\u00ed snippet<\/p>\n","protected":false},"author":1,"featured_media":2635,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[127,210],"class_list":["post-2634","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-snippety","tag-editor","tag-jak-vypnout-editor"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2634"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=2634"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2634\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/2635"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=2634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}