在管理后端隐藏页面/帖子编辑器
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在管理后端隐藏页面/帖子编辑器相关的知识,希望对你有一定的参考价值。
This is a combined version of Bill Erickson's hide post editor and rilwis' Metabox include for specific IDs. It hides the editor for a specified post ID. You can have multiple IDs, just separate with commas.
<?php add_action( 'admin_init', 'hide_editor' ); function hide_editor() { // Get the Post ID // $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; // if($post_id == '104'){ // Include in back-end only return false; // Always include for ajax return true; // Check for post IDs // $checked_post_IDs = array (1,2,3,4); $post_id = $_GET['post']; $post_id = $_POST['post_ID']; else $post_id = false; $post_id = (int) $post_id; remove_post_type_support('page', 'editor'); // add custom .js to footer for uploading images function custom_admin_js() { $url = get_option('siteurl'); $url = get_bloginfo('template_directory') . '/library/js/libs/meta-content.js'; } add_action('admin_footer', 'custom_admin_js'); } return true; // If no condition matched return false; } ?>
以上是关于在管理后端隐藏页面/帖子编辑器的主要内容,如果未能解决你的问题,请参考以下文章