If you can grab your data early enough you can do this:
function alter_title($t) {
return 'altered-title';
}
add_filter('pre_post_title','alter_title');
add_filter('pre_post_name','alter_title');
That will change the title and the slug before the post is saved. Of course, you need to work out some logic for that function. As is, it changes all post/page/CPT names and slugs on both save and edit. Probably not what you want… 🙂
That should work. Your game data should be in $_POST
. If for some reason it doesn’t you can run a function on save_post
but you will need to push another write to the database.
There are a lot of hooks for post insert/edits so you may even find something more appropriate by browsing the source file.
Related Posts:
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- How to set the seo title tag on a page by page basis?
- Media library – Limit images to custom post type
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- Filter a custom field based on selection of another custom field (ACF) [closed]
- Set post title from two meta fields
- ACF Relationships in Custom Post Type Permalink
- Query by 2 values of a repeater ACF field
- Show ACF field from custom taxonomy and display on the single template
- Get Custom Field Values by Another Custom Field in WordPress
- What is the impact if i ignore title and content in my custom post types CPT?
- Show custom field from custom taxanomy term on custom post type
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- Custom Post type with ACF in REST API, how do I get those values?
- Custom Post Types not showing, custom WP_Query
- Rewrite WordPress URL to show CPT meta field data
- Create 3 Level Relations with ACF and WordPress
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- Retrieve value of a category’s custom field
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- Bulk Update Custom Fields for Custom Post Types
- Cluster CPT posts to users based on ACF value from their profile on dashboard
- ACF Values Don’t Show After Import Unless I Edit/Update Post
- Stuck in Order by more then one
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- Custom title set on quick edit
- Query Custom Post Type Taxonomy term with multiple parameters
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- How to group posts and get a mixed posts and groups view?
- Custom Postype specific changes in admin panel
- Custom Post Types vs. Advanced Custom Fields (with Repeater Field add-on)
- Integrate Custom Post Type Events into Calendar
- WebP Fallback for Inline Background Image in Style Attribute
- Query based on custom fields start and end date
- Why is my WP Query not returning first result’s post meta?
- Recoverable Fatal Error – Object of class WP_Post could not be converted to string
- How to get a custom type post data when it has a connection with another custom type post?
- Getting all ID’s matching a title in a custom post type
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- set_query_params using custom params defined in functions file?
- ACF for custom post type archive pages: which hook to use?
- How to define the template for custom posts?
- Distribute Custom Post in different pages
- How do I replace the post title with a custom field?
- Advanced custom fields Post Object image field not displaying in custom post type single.php
- Sum and count of custom field values
- Custom Post Type with Configurable Sidebar via ACF
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- SQL query – get ids – Advanced Custom Fields / WPeC
- Custom field with Types: get custom field’s value label (of type select)
- How to set a ‘page’ as parent of a custom post type?
- Create if else for post types in WP_Query ‘post__in’ values
- Using ACF values in nested WP queries for CPT with date values in the past
- Create/populate Custom Posts ACF fields from external JSON file
- WordPress URL rewrites using Advanced Custom Field
- Custom Post Type and Structure Question
- CPT email notification including only new value custom fields
- Query posts by current ACF meta key value on single page as related posts
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- Display Custom Field or Custom Taxonomy in front page /post/product
- Why do my custom post types stop displaying over time?
- How to access repeater field of a custom field?
- ACF Pro Accessing fields on a Custom Post Type
- Modify Publish Metabox location on CPT
- Some posts not displaying by taxonomy term
- Save_post acf data not updating category of post type
- Permalink URL connection between two custom types
- Display Specific Posts at Start of Loop
- Show specific posts with WP_Query using ACF Post object
- Display custom tax in “while” loop
- Autofill advanced custom field with user data
- Advanced search form with multiple custom fields
- Custom post type option page template
- How to get a custom post type archive paged when using a custom field for post sorting?
- ACF Post Content Not Being Searched
- How to disable Publish button on Edit post if post title exists
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- Can’t pick up a field created with Advanced Custom Fields
- Custom post tag images not displaying with ACF
- using ACF datepicker to filter posts on a page
- Get post id of permalink for a specific custom post type?
- If you’re calling a dynamic css inline style does that div have to be in the loop?
- How to query the content of a specific custom post type?
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Copying custom field value in to title
- How to show animal lineage/pedigree in WordPress?
- Custom Post Type Loop breaking php
- Styling first post using Advanced Custom Fields
- ACF Relationship: Group posts by parent category term, then child [closed]
- ACF Field to set Publish Date – Post Duplication upon Update
- Getting ACF relationship field information
- How to I add count of custom posts listed in a post as a prefix to its title
- Filter page ID outside the loop and order
- Elementor Custom Query to get Posts by ACF (Post Object Field
- Custom taxonomy meta fields
- Create WP multisites as a custom post type
- WordPress WP_Query Sort by 2 dates – custom fields
- Custom Sort Order for Custom Post Type Taxonomy
- WordPress post objects in one parent post object