26.10 Sexta-Feira
A não perder
Dedicamos a Aretha Franklin a última sessão do Doclisboa’18 com The Blues Brothers. Na última sexta-feira, Afonso Peixoto traz-nos R-E-S-P-E-C-T!
/** * Auto Add Image Attributes From Image Filename * * @author Arun Basil Lal * @refer https://millionclues.com/?p=3908 * @plugin https://wordpress.org/plugins/auto-image-attributes-from-filename-with-bulk-updater/ */ function abl_mc_auto_image_attributes( $post_ID ) { $attachment = get_post( $post_ID ); $attachment_title = $attachment->post_title; $attachment_title = str_replace( '-', ' ', $attachment_title ); // Hyphen Removal $attachment_title = ucwords( $attachment_title ); // Capitalize First Word $uploaded_image = array(); $uploaded_image['ID'] = $post_ID; $uploaded_image['post_title'] = $attachment_title; // Image Title wp_update_post( $uploaded_image ); update_post_meta( $post_ID, '_wp_attachment_image_alt', $attachment_title ); // Image Alt Text } add_action( 'add_attachment', 'abl_mc_auto_image_attributes' );
Dedicamos a Aretha Franklin a última sessão do Doclisboa’18 com The Blues Brothers. Na última sexta-feira, Afonso Peixoto traz-nos R-E-S-P-E-C-T!