Manage Templates page. Version: 1.05.1 Author: Binny V A Author URI: http://binnyva.com/ */ /** * Add a new menu under Manage, visible for all users with template viewing level. */ add_action( 'admin_menu', 'templates_add_menu_links' ); function templates_add_menu_links() { global $wp_version; $view_level= 2; $page = 'edit.php'; if($wp_version >= '2.7') $page = 'tools.php'; add_submenu_page($page, __('Manage Templates', 'article-templates'), __('Manage Templates', 'article-templates'), $view_level, 'article-templates/manage.php' ); $hookname = get_plugin_page_hookname('article-templates/template_form.php', '' ); $GLOBALS['_registered_pages'][$hookname] = true; } /** * Add a Drop down in the post create page that lists all the templates. */ add_action( 'edit_form_advanced', 'templates_post_page_templates_list' ); add_action( 'edit_page_form', 'templates_post_page_templates_list' ); function templates_post_page_templates_list() { global $current_user; $templates = templates_get_users_templates($current_user->ID); $template_js_data = array(); ?>
Manage Templates section.', 'article-templates') ?>