This will automatically update a meta named post_title
to the value of the post’s title, no matter where you save the post from:
function wpse_275785_save_title_as_meta( $post_id, $post, $update ) {
update_post_meta( $post_id, 'post_title', $post->post_title );
}
add_action( 'save_post', 'wpse_275785_save_title_as_meta', 99, 3 );
Related Posts:
- WordPress Paginate $wpdb->get_results
- Custom Search Query
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Retrieve and display data from custom db table in admin area?
- How to find if a post with custom_field == X exists?
- Custom search page and search by title, content and tag
- Modifying loop on a custom page, strange behaviour
- Change separators in HTML tags
- How to display post title & excerpt when mouse hovers on an image?
- Replace “WordPress” word in title of Dashboard
- How I display post of the post type group by year of post?
- Load more posts with multiple queries
- Custom title, Bones theme
- Hi, I wanted to make custom search with multiple fields
- Get Image from Media Library with the Title
- $wpdb->replace: WHERE?
- wp_query get post custom taxonomy in search.php
- Get rid of title from static front page
- Set Title from Custom Template
- Order posts with a custom field but also without
- Keep Title and Description always
- Add content in between of foreach
- Custom Loop Query For Search Page
- Custom SELECT Query With Multiple Meta Values (Ordering Problem)
- How do I modify the size of the text in my page titles?
- Query for specific custom field
- Display posts by combining multiple meta key
- How to add span on WordPress Title for first and third word
- Remove link from page title
- Custom select query two tables by a meta key
- Replace a ‘Title’ tag with a Custom Field
- Custom Same Page Search
- Fatal error Call to a member function insert() on a non-object [closed]
- custom user meta query
- Recent activity query WordPress
- How to query term_id of a Custom Taxonomy by name
- title tag function
- WP Search Form Query: Add Author’s posts into search query
- query variables for custom taxonomies
- display text generated via custom get query string
- How to get the full product name by ignoring custom modification on it
- Custom query pagination with php parameter as arg problem
- Need to replace some text string on a title
- Delete page titles
- Change meta-box title- “LearnDash Quiz Settings” to “Quiz Settings”
- How to automatically pull an information from a form field onto an other page?
- Query Posts to display all posts with category “custom field value”
- Query 1 custom post type, each day, alphabetically
- Multiple Taxonomies Using Custom SQL Query
- Search a meta field for a value in all posts
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Custom MySQL query to list post
- Custom Query Arguments
- Custom Query for Taxonomy
- Include plugin´s table in custom query
- I need to make the title of the page dynamic in my custom plugin
- User Query Multiple Orderby Clause
- Any post install tips after installing WordPress 3.0.1?
- Version Control: Entire site or just pieces?
- Getting a stack trace when an error occurs?
- Maintaining synced staging/production WP sites
- WordPress Multi Site Best Practice
- Sub posts and non unique post_name
- How to let a single post have its own domain name
- How to instantly delete posts/pages permanently?
- How to re-arrange media uploaded using : media_handle_upload() as per year / month
- How could we customize the all posts page in the admin panel?
- Adding Pagination on a Custom Author Page
- How can I get the page url slug when ‘post_name’ returns an id?
- Woocommerce Product page edit
- Convert an theme options page to use in customize.php also?
- The best way to write an FAQ page?
- Get Value from Column in Plugin Table [closed]
- Display User ID instead of Name or Username
- Bind JS event to WordPress control customizer
- Function to delete a post, it’s children and it’s grand children (half way there already)
- Make custom page look exactly as homepage
- $wpdb->insert running multiple times?
- Track usernames with piwik [closed]
- Multiple Category Query
- how to add custom logo to my template
- WordPress broken after changing URL
- How to make the Pages in WordPress Customized?
- Custom “wp_login.php?action=lostpassword” and reset password
- Custom theme – how to link the image without posting it
- wp_enqueue_script JS code runs too late (after user begins interacting)
- Validate user login in php
- Easily add custom HTML outside the main container?
- Query Product categories what have a custom field
- Make Widget appear on Dashboard
- Woocommerce dependent attributes
- How to find and replace (or add) specific word in a specific category?
- Displaying all Custom fields on post except some
- How to appoint different users to different pages?
- Is there a way to hide a user’s posts from their Activity feed?
- Setting up staging area
- Do i need to use PHP in customizer api?
- Disable all Fonts that are Standard in WordPress and replacing them with a custom Font?
- Custom product sorting archive page
- Add custom information in editor summary