Skip to content

Instantly share code, notes, and snippets.

View digisavvy's full-sized avatar

Alex Vasquez digisavvy

View GitHub Profile
<?php
function dgs_function_with_current_time() {
// Get the current date and time based on your WordPress settings
// 'Y-m-d H:i:s' will return the date and time in 'YYYY-MM-DD HH:MM:SS' format
return current_time('Y-m-d H:i:s');
}
<?php
$video_id = get_post_meta(get_the_ID(), 'session_video_file_download', true);
if ($video_id) {
$video_url = wp_get_attachment_url($video_id);
if ($video_url) {
$shortcode = '[presto_player src="' . esc_attr($video_url) . '"]';
$player_output = do_shortcode($shortcode);
echo $player_output;
}
}
SELECT *
FROM wp_postmeta
WHERE post_id = {your_post_id}
AND post_id IN (SELECT ID FROM wp_posts WHERE post_type = '{your_posttype}');
With the above query, replace {your_post_id} and {your_posttype} with the appropriate post ID and posttype.
{"content":[{"id":"xjassy","name":"container","parent":"lgznqb","children":["oyosks"],"settings":{"_display:mobile_landscape":"block","_display":"none","_cssCustom:mobile_landscape":".table-row {\n background-color: var(--bricks-color-zqxmyk) !important;\n}\n"},"label":"Mobile Table"},{"id":"oyosks","name":"block","parent":"xjassy","children":["kyskls","yutqfe","bfghtd","zgafvm","rutdaj","odijlh","napgsg","qmqlih","ncwhow","bpchxc","wlsqmb","ypulps","jaqieg","uzmgvr"],"settings":{"_display:tablet_portrait":"grid","_gridGap:tablet_portrait":"1","_gridTemplateColumns:tablet_portrait":"1fr 1fr","_cssCustom":".div-table-mobile > div {\n padding: 1em;\n}\n\n.div-table-mobile {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: minmax(0px, 1fr);\n}\n\n\n.div-table-mobile > * {\n\ttext-align: center;\n}\n\n.div-table-mobile > div {\n background: #fff;\n}\n\n.div-table-mobile {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n background-color: var(--bricks-
{"content":[{"id":"xezkft","name":"container","parent":"lgznqb","children":["rzvkzk"],"settings":{"_display:mobile_landscape":"none","_cssCustom":"/* .div-table > div:nth-child(-n+3) {\n background: var(--bricks-color-zqxmyk);\n} */\n\n.div-table > div:nth-child(3n-8) {\n background: var(--bricks-color-zqxmyk);\n}\n\n.div-table > div {\n max-height: 120px;\n}","_cssCustom:tablet_portrait":".div-table > div {\n max-height: 150px;\n}","_cssCustom:mobile_landscape":".div-table > div {\n max-height: 170px;\n}"},"label":"Desktop Table"},{"id":"rzvkzk","name":"block","parent":"xezkft","children":["eymaow","oxmriy","jbhbyl","xywekp","ukbfut","zlurfz","dlxndd","ohhagr","bopokw","wbmlzg","rxydhh","btzhtv","kqxfaj","sbdivc","imlayu"],"settings":{"_display":"grid","_cssCustom":".div-table > div {\n padding: 1em;\n}\n\n.div-table {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-auto-rows: minmax(100px, 1fr);\n}\n\n.div-table > div {\n background: #fff;\n}\n\n.div-table {\n
<?php
$post_id = get_the_ID();
$start_time = get_post_meta( $post_id, '_EventStartDate', true );
$end_time = get_post_meta( $post_id, '_EventEndDate', true );
$time_zone = get_post_meta( $post_id, '_EventTimezoneAbbr', true );
$start_formatted_time = date_i18n( 'g:i a', strtotime( $start_time ) );
$end_formatted_time = date_i18n( 'g:i a', strtotime( $end_time ) );
SELECT *
FROM wp_postmeta
WHERE post_id = 11432
AND post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'tribe_events');
<?php
$post_id = get_the_ID();
$start_time = get_post_meta( $post_id, '_EventStartDate', true );
$end_time = get_post_meta( $post_id, '_EventEndDate', true );
$time_zone = get_post_meta( $post_id, '_EventTimezoneAbbr', true );
$start_formatted_time = date_i18n( 'g:i a', strtotime( $start_time ) );
$end_formatted_time = date_i18n( 'g:i a', strtotime( $end_time ) );

Just some snippets of working with Bricks Builder and the Events Calendar. Definitely not comprehensive. If you are comfortable finding post meta for an tribe_events post, you can then use Bricks' dynamic data tags to get most of the data you need and then write some PHP to get any data or format things as needed.

Convert the Date/Time to another format to display only start and end time.

<?php
$post_id = get_the_ID();

$start_time = get_post_meta( $post_id, '_EventStartDate', true );
$end_time = get_post_meta( $post_id, '_EventEndDate', true );