fred-r.M
In den letzten 30 Tagen erstellte Support-Threads: 0
Lieblings-Forenthemen
This user has no favorite topics.
Forum Topics Created
Status | Thema | Supporter | Stimmen | Artikel | Aktualität |
---|---|---|---|---|---|
How to show futures dates – each on one line?
Gestartet von: fred-r.M in: Toolset Professional Support |
|
2 | 3 | vor 4 Jahre, 3 Monaten | |
How to get the values of a date field?
Gestartet von: fred-r.M
in: Toolset Professional Support
Problem: I would like to get the values of a repeating date custom field, and output a custom data structure including the formatted dates. Solution: $post_id = 1234; $start_dates = get_post_meta($post_id, 'wpcf-start-tour-date', false); Note that the Types field slug includes a wpcf- prefix here. This will return an array of date values in Unix timestamp format. To get a single field value, like the number of tour nights, you can use get_post_meta again like so: $number_of_tour_nights = get_post_meta($post_id, 'wpcf-number-of-tour-nights, true); Once you have those values, you can loop over the repeating values and create your own array of information to output. You'll need a way to format dates based on Unix timestamps. You can use PHP's date function for this. For example, to format a date like 2021-08-31 from a Unix timestamp like 1630368000, you can use the date function like so: $timestamp = 1630368000; $formatted_date = date('Y-m-d', $timestamp); If you want to calculate a date in the future based on the start date and number of nights, you can use the number of seconds in a day (60 seconds per minute * 60 minutes per hour * 24 hours per day) in your PHP calculations, then format the end date: $start_date = 1630368000; $number_of_nights = 4; $end_date = $start_date + (60 * 60 * 24 * $number_of_nights); $formatted_end_date = date( 'Y-m-d', $end_date); Relevant Documentation: |
|
2 | 6 | vor 4 Jahre, 5 Monaten | |
Repeating date fields in calendar
Gestartet von: fred-r.M in: Chat Support |
|
1 | 2 |
vor 4 Jahre, 5 Monaten
|
|
How to "connect" a post type (listing) with "super user" / member?
Gestartet von: fred-r.M in: Toolset Professional Support |
|
3 | 4 | vor 4 Jahre, 8 Monaten | |
How to translate "strings" in custom code?
Gestartet von: fred-r.M in: Toolset Professional Support |
|
2 | 15 | vor 4 Jahre, 8 Monaten | |
How to add a reCaptcha field in the expert mode?
Gestartet von: fred-r.M
in: Toolset Professional Support
Problem: Solution: You can find the proposed solution in this case with the following reply: Relevant Documentation: |
|
2 | 3 | vor 4 Jahre, 9 Monaten | |
Showing post titles as select dropdown in views search form
Gestartet von: fred-r.M in: Toolset Professional Support |
|
2 | 11 | vor 4 Jahre, 10 Monaten |