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
- Advanced Custom Fields in WP_Query: Href Returning Empty
- Different titles on homepage vs single based on category
- How to: Easily Move a WordPress Install from Development to Production?
- Is there a flowchart for WordPress loading sequence?
- Essential technical features for high-end WordPress web hosting? [closed]
- How to remove admin menu pages inserted by plugins?
- How to put logs in WordPress
- How to get the Date Format and Time Format settings for use in my template?
- What SQL Query to do a simple find and replace
- Where are Additional CSS files stored
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Creative uses of WordPress [closed]
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples
- How to benchmark a WordPress installation? [closed]
- Should I delete the default themes?
- Moving WP install from local to live, what about wp_posts GUID?
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Running Gutenberg React in Development Mode
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Users with custom roles not showing in post author select box
- How to use more than 256MB of memory in the admin?
- How do register_sidebar() and get_sidebar() work together?
- How do you get formatted content of a post using the WordPress API?
- Localization: I want the backend: english and frontend in defined language
- Are there any forks of WordPress (and what is different about them)?
- How to Change 404 page title
- Make Custom Metaboxes Collapse by Default
- Custom maintenance page
- Add button to TinyMCE bar without creating a plugin