WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9353 closed enhancement (duplicate)

Override default page_template and post_parent

Reported by: aldenta Owned by: anonymous
Priority: normal Milestone:
Component: Administration Version: 2.7.1
Severity: normal Keywords: has-patch
Cc:

Description

In previous versions (not sure where this stopped working but I believe it worked in 2.6) you could override the default page_template and post_parent when creating a new post/page. This was extremely useful when using WP as a CMS. I had custom meta_boxes, would set the page_template to a specific template, set the post_parent to the correct parent, and then hide them with CSS so the user could not change them (hiding doesn't work now either since page_template and page_parent aren't wrapped in their own divs).

Now, based on how get_default_post_to_edit gets called, it sets the defaults and they cannot be changed. The attached diff adds two apply_filters that will allow hooking into this.

Thanks

Attachments (1)

post.diff (1007 bytes) - added by aldenta 4 years ago.
wp-admin/includes/post.php diff file

Download all attachments as: .zip

Change History (4)

aldenta4 years ago

wp-admin/includes/post.php diff file

comment:1 Viper007Bond4 years ago

  • Component changed from General to Administration
  • Keywords has-patch added

comment:2 Denis-de-Bernardy4 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Closing as dup of #8223, which suggests a more general fix (without a patch)

comment:3 Denis-de-Bernardy4 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.