• How would I automatically assign a specific author to all custom posts assigned to a specific custom post type?

    Any help appreciated ??

    Pete

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Hi Pete,

    You need to hook the ‘wp_insert_post_data’ filter. Your callback function is passed the entire post data array just before it is inserted into the posts table. If the ‘post_type’ value is your target CPT, then set the ‘post_author’ value to whatever author ID you want assigned to all posts of this type.

    Thread Starter Pete

    (@perthmetro)

    Remember the scene in one of the Transformers movies where the Commando guy is explaining to the annoying security chief guy how to use his parachute in the back of the plane? Well you’re the commando and i’m the annoying guy wishing like hell i had a clue what you were saying… sigh ??

    Where’s the “like” button on this damn thing?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to automatically assign a specific author to a custom post type’ is closed to new replies.