How to pass value to a plugins shortcode?
you may just check source where this shortcode is being extracted and there you can write some custom code to get first of current month and use that instead of extracted variable of shortcode.
you may just check source where this shortcode is being extracted and there you can write some custom code to get first of current month and use that instead of extracted variable of shortcode.
Use current_time to output the time based on the timezone set on the blog’s General Settings page.
You need get_the_time, not the_time to get the date (the latter echo‘s the value). You also need to re-evaluate how you’re trying to calculate the end date – you can’t just “add” the number of days. What if the event length was 3 but the start date was the 31st? if ( $event_length ) { … Read more
If you change the saved date format to YYYY-MM-DD HH:MM (always with leading zeroes). You can use the usort() array sorting function from php. usort( $array, function( $a, $b ) { return strcomp( $a[‘show_date_and_time’], $b[‘show_date_and_time’] ); } ); Without changing the date format you need a more complex compare callback: usort( $array, function( $a, $b … Read more
You could use a service like Google Timezone you could get the users lat/lng data using geolocation then store that in a transient agains the IP address. Don’t rely on the IP as users on a satellite connection like me can have the location pinged as thousands of km away.
Create 1 user_meta field for each user. Upon login, fire an action of ‘wp_login’ that will update the new user_meta field for the current logged in user. (Optional) Before updating the user_meta field, make sure it hasn’t been updated earlier today. This will help avoiding server abuse
Unfortunately as describes it is far from trivial to display just the date in localized format. The function for localized date output in WP is date_i18n(). But it doesn’t have a concept of output in arbitrary locale. It always takes locale to use from global $wp_locale context. You would have to pretty much rebuild this … Read more
WordPress Server Time not changing/displaying correctly
WordPress sets the php timezone to UTC for internal calculations. So at 4pm PST, date() will be producing a date that reads 10pm UTC. Hence the event is considered past. There are two ways to resolve this. (The preferred method) Store dates in the database in UTC. Handle all date calculations in UTC, and convert … Read more
Here you were trying to use echo as a method of DateTime object. $month = $date->echo date_i18n(‘F’); It should be: $month = date_i18n(‘F’, strtotime( $acf_date ) ); Where $acf_date is the time string not the DateTime object.