Last active
January 3, 2023 16:56
-
-
Save Niloys7/9d02294cfecb0c4e43080b34587c4427 to your computer and use it in GitHub Desktop.
Filter for preorder available date text on single product page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('preorder_avaiable_date_text',function($text , $id){ | |
$custom_date_format = date( 'D M d, Y', strtotime( get_post_meta($id, '_pre_order_date', true)) ); | |
return '<span class="preorder-avaiable-date-text">Available on '.$custom_date_format.'</span>'; | |
},10,2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can modify line number 3 if you want another format
example: replace
D M d, Y
toF j, Y
date( '
F j, Y
', strtotime( get_post_meta($id, '_pre_order_date', true)) );