The following works for me, testing with TwentyTwelve.
Using load-{$pagenow}
instead of admin_init
avoids the checking for the global $pagenow
. See comments for further info:
// Run only when editing a page
// For new pages load-page-new.php should be used
// See: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-admin/admin.php#L217
add_action( 'load-page.php', 'hide_editor_wpse_88886' );
function hide_editor_wpse_88886()
{
// Not really necessary, but just in case
if( !isset( $_GET['post'] ) )
return;
$template = get_post_meta( $_GET['post'] , '_wp_page_template', true );
if( 'page-templates/front-page.php' == $template )
{
remove_post_type_support( 'page', 'editor' );
}
}
Related Posts:
- Hide page visual editor if certain template is selected?
- Need to create a custom page on a website
- Custom templates not showing up in template dropdown
- Get page id by template
- Change page template programmatically ?
- Listing pages which uses specific template [duplicate]
- Is there a way to change the default page template selection?
- Create a “Dummy” parent page for a hierarchy in page listing?
- Restrict admin access to certain pages for certain users
- Creating a template using a specific slug name, for a page with a parent page
- Limit number of pages that use a specific template?
- Restrict acceess of a page in backend
- Increment Page Order As Pages Are Created
- Only allow new subpages to be created
- Add custom admin menu item for pages using a certain template
- WP is not using the select custom template.php that its selected for a page
- Too many pages causes WordPress admin to be unusable
- Is it possible to set a page template on a dynamic home page (articles list)?
- Hide Visibility Option From WordPress Publish Metabox
- Page template gives ‘Parse error: syntax error’ when used, but no error found!
- more tag in the $post->content when get_pages were used
- Why is custom template not seen as page with is_page()?
- Page with page template not using template in Preview
- Backend option to include a javascript file on specific pages?
- How to make certain page templates visible to admin only
- Template for child pages / subpages
- How to dynamically save a selected option from page “Templates” selectbox?
- Include a specific page in your template
- Custom page template not working
- How do I create a separate page for each author?
- WordPress Admin – Add Edit link to specific page under Pages Menu
- How to use the same code for multiple pages?
- How to have custom tinyMCE buttons break onto next line when too long
- How do I pass data from page content to the underlying PHP template
- How do i change page template in bulk?
- Load specific page template based on URI
- I have index.php and other files, how do I display other pages?
- is_home() returns TRUE on page template
- Removing the TinyMCE editor for a given page template
- Using Pages to handle calls for custom post types
- Dash after page title
- How to make tag post listing page working?
- Custom page template with entirely different design. Is it possible in?
- How to make my category archive behave like a page
- Page template no longer exists – metaboxes won’t save
- page-name.php doesn’t execute on custom template
- Remove Content edit box from ALL pages (not posts)
- Is it possible to activate page template without manually selecting it in wp-admin?
- Hide page templates without using ‘unset’
- the_content of template page
- Disable ADD PDF media button on rich text editor
- Use same page-mypage.php template for several pages
- How to disable delete option for a specific page? [closed]
- pre-existing data, and entities
- Rewrite to load homepage for a different url
- Avoid pages losing template association on site re-deploy
- How to exclude authors from get_pages()
- List child pages within page template
- Using page-something.php as static front page
- Order by modified date working in POSTS but not PAGES
- Best way to organize data in this scenario
- creating single page with 2 columns while theme is 3 column
- Using index.php as page template
- Publish page by invoking submit via jQuery
- How does wordpress link page templates to individual pages
- Translate dashboard metabox
- Custom user tables not working after migration
- Template field missing in page attributes
- Different template parts when on different pages
- Updating page template pragmatically
- Page and admin doesnt load – i tried everything
- Pages in wp-admin is not found 404
- WordPress blog posts template bug [closed]
- Adding styles/scripts to specific page
- WordPress form submit to custom page template does not work
- How do I locate a third party page represented as a slug in my WordPress website?
- Customise the_title in admin area
- Creating content using wp-admin pages
- Display grandchild page content on parent page
- How do you assign custom template for Posts page (under Front page displays setting)
- display different pages content on single page
- How to output different content of page on different places in my template
- Avada Theme – Display results from a specific category [closed]
- Multiple pages to show posts
- How to finish this loop?
- Auto-Create Pages from Template Directory
- Loading custom jQuery and HTML in a WordPress page
- different single.php for different page templates
- Group Pages based on Parent in Admin Area
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- How to align bold,italic and underline in wp-admin?
- Naming custom page templates
- How can I use Page editor for two separate templates?
- Display random page
- How to read a page’s “Shortcodes” from the Template File?
- if and else statement not working on the iframe php page
- Custom SINGLE page with custom metaboxes and custom template
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Custom template is not showing up in templates dropdown list after re-naming it
- May I know where to edit the tax rate?