You should really only need to run this on an existing post, since new posts will be created in the manner you specify.
add_action( 'load-post.php', 'custom_content_conversion' );
function custom_content_conversion()
{
if (! empty($_GET['post']) )
{
// Get the post object
$post = get_post($_GET['post']);
// If the post object has content, store it in the meta field you are using
if (! empty($post->post_content) )
{
update_post_meta($post->ID, 'your_custom_key', $post->post_content);
}
}
}
Related Posts:
- how to limit edit_form_after_title hook to page and post edit only?
- Custom Field in Featured image for A particular post
- Better post meta efficiency?
- Populating a page with content from post custom fields
- Adding buttons to Add New Post and Add New Page
- How to dynamically parse and transform post/page content before displaying it?
- Output Post with ACF Fields into other Post
- Custom Fields – How to get the list of a specific active widget each time it rendered
- Is there a way to know when a page has been updated and do some action only once?
- Using Post ID and Page ID in same function
- Home page: using custom fields for posts and pages
- Query Posts With Over 1000 Views
- Cannot retrieve a custom RSS field from posts
- Copy post to separate database with “add_action(….)”
- 404 error on default post type and default taxonomy fronted page
- Overwrite posts/pages via import
- Auto-realod with new posts // Ajax call
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- Start post pagination at 0 instead of 1
- Query Posts by Custom Field
- Trying to alter the post_content through the_post
- How do I do a page break?
- Is there a way to specify an extra class for a post or page with no title?
- Automatically create a new page daily with last three posts
- Using wp_list_pages() after calling query_posts()
- When changing pages to posts, how do you set up 301 redirects for the page URLs?
- Display Posts on Custom Page
- User Selectable Delete of Pages
- Call Web Services on post first publish
- 2 dynamic sidebars registered, not showing up
- Multiple Loops Breaking Pages
- How to rate a post from Admin Side / Manually?
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- How to get ID of the page included with get_page()?
- Posts vs Pages and categories
- How to make default “Privacy Policy Page” a normal page?
- Customize rel=canonical tag for single blog post
- How to I retrieve the ID from the Posts page?
- disable Tab post on nav-menus page (Admin)
- What does WordPress do if I save a post without content/title? [duplicate]
- Proper way of establishing custom landing pages in WordPress
- Adding bootstrap classes to video shortcodes
- Get post ID from a link
- is_page Funtion for Posts ?
- is_page() and is_page_template() not being differentiated
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Hide custom metabox value from custom fields
- Admin – no Featured image choice in create new/page|post
- How to detect when admin user is on the All Posts page?
- preg_replace not removed “class”
- why the same code got different results when using query_posts in functions.php and index.php
- static landing page leading to author specific pages w/ “live” content
- Get post meta retrieving wrong value
- Divs appearing everywhere in post content
- Total number of posts in query (category/tag/author/search results/main page…)
- Custom Permalink Structure for Pages & Posts
- Getting a “404 Not Found” error when “Preview Changes” is clicked
- Why won’t pagination work?
- Modify posts listing at back end
- WordPress Query Posts From Category Post on Static Page
- How to create a “latest news” page showing a list of posts from blog category
- Edit multiple custom post types while saving a new or edited post
- How do you search for a post or page with a certain url on the WordPress admin panel?
- How to add some html formated text to every new post in WordPress
- Hook for changing excerpt content when excerpt not set
- if in category but only with post meta
- Is it possible to add a shortcode below post title?
- Intercept page request and add value to it
- WordPress 302 Redirect to Random Product/Post/Page
- How to create a page that shows the last 10 posts?
- Automatically set post_parent value
- $_GET parametters not working in an specific template
- Saving Post Data in Another Database
- New Posts and Pages Won’t Save
- My Custom Post Type Still Using index.php
- get_children returns older images
- Posts and Pages: 404 Page not found
- Add two custom fields as a default to the “new post” page.
- the_content() Not Grabbing All Content
- Display Featured Posts Grid on Static Page (Gazette)
- After ajax image is outside the “ tag
- Detecting current page from class method
- Edit custom fields in posts list
- Add multiple meta keys to a post at once
- Having pages after specifying post_type post
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- List all posts, pages and custom post types in admin
- WP_Query custom field pass the post id
- Make ‘blog’ page show content as well as posts underneath it
- I don’t want the complete article to show on homepage
- Post/page title to permalink transformation – what is behind the scenes?
- Change Author Name to Sitename on Frontend
- Would a “hub” page work better as a page or a post?
- Display on page every post in blog WITH comments
- Are post, page and category IDs unique to each other?
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- If custom field is empty, use one from a previous post
- saving/reading custom field value does not work – no value gets POSTed