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 | |
/** | |
* Update Single Post Content images to include image credit | |
* | |
* @param string $content | |
* @return string | |
*/ | |
function _codeable_addCreditToImage(string $content){ | |
global $post; | |
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( | |
'page_template', | |
function ($template) { | |
global $post; | |
if ($post->post_parent) { | |
// get top level parent page | |
$parent = get_post( | |
reset(array_reverse(get_post_ancestors($post->ID))) |
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 | |
// Use this function to add Parent and Child Page Templates | |
// Structure: | |
// theme_folder/page-templates/parent_page_slug/page.php - Parent Template | |
// theme_folder/page-templates/parent_page_slug/page-child_page_slug.php - Child Template | |
// theme_folder/page-templates/parent_page_slug/page-child_page_ID.php - Child Template | |
add_filter( | |
'page_template', | |
function ($template) { |
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 | |
/********** CLEANUP *************/ | |
/** | |
* Disable the emoji's | |
*/ | |
function disable_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); |
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
These are the two steps you need to take to get S3 to work with Digital Ocean Spaces. | |
https://github.com/humanmade/S3-Uploads |
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 | |
// helper function to get term children | |
function pd_get_term_children($slug, $term_type = 'category'){ | |
// set up category by slug | |
$category = get_term_by('slug', "{$slug}", "{$term_type}"); | |
// get out if no category | |
if(!$category){return;} |
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 Phone field to Shipping on checkout page | |
* Validation automatically happens since we set it via WooCommerce Hook | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'custom_override_default_address_fields' ); | |
function custom_override_default_address_fields($fields){ | |
// Get access to WooCommerce and grab the current billing and shipping countries on page load. | |
global $woocommerce; | |
$billingCountryCode = $woocommerce->customer->get_billing_country(); |
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 | |
/** | |
* Change Google Calendar description and title | |
*/ | |
function tribe_google_calendar_link_modify( $params ) { | |
// unset parameters | |
unset($params['details']); | |
unset($params['text']); | |
NewerOlder