Im a stock photographer and now Im building my own stock images website with woocommerce in wordpress. Now im configuring all to be automathically as possible (imagine upload 50k images and edit title, tags and file to download one by one). At the moment, and searching in google for days, my website transform automathically the keywords to wordpress tags, make default downloadable product and add file to download. Also recognice the title of image (alt text) and make a title of product, but not automathically, i need add a some title manually when i publish the product. But now, i need add default title in each new product (for example one word, because when i publish it, the website add alt text in a title automathically) when i create a new product. But to publish a new product, woocommerce needs a title, and i want generate something default to change when i publish the product
The idea is: click on Products>new product> and the first i see is a default title generated (a only one letter is enough).
Its possible? i dont know... Can you help me?
Thanks!
PD: Sorry for my english, i know is poor.
It is better not to use the return inside the if statement because otherwise you will encounter error messages
function my_default_title_filter( $post_title, $post ) {
if ( $post->post_type == 'product' ) {
$post_title = 'Default title';
}
return $post_title;
}
add_filter( 'default_title', 'my_default_title_filter', 10, 2 );