Don’t update modified post date when user add a product review or comment?

WooCommerce seems to update the ‘last modified’ value of a product on every change. If you want to take a look at the source code, go to woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php and check the function update. This solution seems to work, however it could be improved to make sure it doesn’t mess up with anything else. Basically checks … Read more

Image title replace with current date

You can achieve this by using following code: /* Automatically set the image Title, Alt-Text, Caption & Description upon upload ————————————————————————————–*/ add_action( ‘add_attachment’, ‘my_set_image_meta_upon_image_upload’ ); function my_set_image_meta_upon_image_upload( $post_ID ) { // Check if uploaded file is an image, else do nothing if ( wp_attachment_is_image( $post_ID ) ) { $custom_title = date(“Y-m-d”); //settings current date as … Read more

Display date and time into post edit comments section

Here is the answer given by Ferman on wpfr.net function date_commentaire( ){ $comments = get_comments( array( ‘post_id’ => get_the_ID() )); if ( doing_action( ‘wp_ajax_get-comments’ ) ) foreach ( $comments as $comment ) : $a = $comment->comment_ID; $b = get_comment_ID(); $date_comment = get_comment_date(); $time_comment = get_comment_time(); if ( $a==$b ) echo ‘<p class=”commentaire-date”>’.’Commentaire N°: ‘.$comment->comment_ID.’ du: … Read more

How can I tranlslate post date in italian?

for example use: _e(‘the things to print’) or if woocommerce is being used its possible to use this way: _e(‘the things to print’, ‘woocommerce’) add_filter( ‘get_the_date’, function($the_date, $d, $post){ $date = new DateTime( $post->post_date ); echo _e($date->format(‘j F, Y’)); // change formatting as needed }, 10, 3 ); for more information about _e() the text … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)