- Site List: terminus taoti:site:list
- Multidev
- Create: terminus multidev:create --
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
<?php | |
/** | |
* Create Post Example | |
* | |
*. Note: See https://www.advancedcustomfields.com/resources/update_field/ for notes. | |
*/ | |
// Create new post. | |
$post_data = array( |
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
<?php | |
### This file provides an API for rebuilding metaboxes | |
### See https://rudrastyh.com/wordpress/tag-metabox-like-categories.html | |
### for inspiration on content. | |
### See wp-admin/meta-boxes.php for source-code. | |
// add_action( 'admin_menu', 'taoti_post_taxonomy_metabox_remove' ); | |
// add_action( 'admin_menu', 'taoti_add_autosorting_taxonomy_metabox' ); | |
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
<?php | |
add_filter( 'gform_field_choice_markup_pre_render', function ( $choice_markup, $choice, $field, $value ) { | |
if ( $field->get_input_type() == 'radio') { | |
return str_replace( "<label", "<span class='faux-radio'></span><label", $choice_markup ); | |
} | |
if ( $field->get_input_type() == 'checkbox') { | |
return str_replace( "<label", "<span class='faux-checkbox'></span><label", $choice_markup ); | |
} |
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
$date = get_field('date_published', false, false); | |
$event_date = new DateTime($date); | |
$new_time = $event_date->format('ga'); | |
$first_date = $event_date->format('F j, Y'); | |
<?= $first_date; ?> |
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
<?php | |
$photoBannerId = get_post_thumbnail_id(); | |
$photoBannerUrlBase = wp_get_attachment_image_src($photoBannerId, 'listing')[0]; | |
$photoBannerUrlBaseSmall = wp_get_attachment_image_src($photoBannerId, 'listing-small')[0]; | |
if ($photoBannerId) { ?> | |
<picture> | |
<source media="(max-width: 1023px)" srcset="<?= esc_attr($photoBannerUrlBase) ?>"> | |
<source media="(min-width: 1024px)" srcset="<?= esc_attr($photoBannerUrlBaseSmall) ?>"> | |
<source srcset="<?= esc_attr($photoBannerUrlBaseSmall) ?>"> | |
<img src="<?= esc_attr($photoBannerUrlBaseSmall) ?>" alt="Photo of <?php the_title(); ?>"> |
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 ACF Content Blocks preview images. | |
jQuery(document).ready(function ($) { | |
if (typeof acf !== 'undefined') { | |
acf.addAction('load', () => { | |
$('.tmpl-popup').each((_, popup) => { | |
const regex = /data-layout="(.+?)".*?>/g; | |
const replace = `$&<img src="${taoti_admin_js.acfPreviewUrl}$1.jpg">`; | |
const result = $(popup).html().replace(regex, replace); | |
$(popup).html(result); | |
}); |
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
<?php # Live-specific configs | |
if ( in_array( $_ENV['PANTHEON_ENVIRONMENT'], array( 'live' ) ) ) { ?> | |
<script> | |
(function(i, s, o, g, r, a, m) { | |
i['GoogleAnalyticsObject'] = r; | |
i[r] = i[r] || function() { | |
(i[r].q = i[r].q || []).push(arguments) | |
}, i[r].l = 1 * new Date(); | |
a = s.createElement(o), | |
m = s.getElementsByTagName(o)[0]; |