I want to copy custom field content of all posts to default post author field. How can i do that?
Hello, the simple answer is it's quite complicated and there's nothing built-in to Toolset that will help you achieve this. Even with custom code, it's quite difficult. When you want to set the post author programmatically, you need to know the author's WordPress User ID. This is how post authorship is managed in the database - a User ID is stored in the post table. It looks like the Autor Musica custom field does not include the author's User ID, but includes some other information instead. This complicates things because you need a way to translate from this information to the WordPress User ID. I'm not sure how that would be possible. You could look into the wordpress WP_User_Query class: https://developer.wordpress.org/reference/classes/wp_user_query/
You can search by several criteria like 'ID', 'user_login', 'user_email', 'user_url', 'user_nicename', 'display_name', as well as custom field values on the User Profile. However, I'm not sure what information your Autor Musica field contains. My guess is the information here is not easily translatable into author ID, am I correct?
My issue is resolved now. Thank you!