This file contains 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 | |
/** | |
* Uses the custom fields as the document's 'post_content'. | |
*/ | |
add_action( | |
'solr_build_document', | |
function ( $doc, $post ) { | |
// Only override for this page template. |
This file contains 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_action( | |
'init', | |
function() { | |
if ( ! wp_next_scheduled( 'pantheonx_clear_sessions' ) ) { | |
wp_schedule_event( time(), 'twicedaily', 'pantheonx_clear_sessions' ); | |
} | |
} | |
); |
This file contains 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
language | english_name | native_name | |
---|---|---|---|
af | Afrikaans | Afrikaans | |
ar | Arabic | العربية | |
ary | Moroccan Arabic | العربية المغربية | |
as | Assamese | অসমীয়া | |
az | Azerbaijani | Azərbaycan dili | |
azb | South Azerbaijani | گؤنئی آذربایجان | |
bel | Belarusian | Беларуская мова | |
bg_BG | Bulgarian | Български | |
bn_BD | Bengali (Bangladesh) | বাংলা |
This file contains 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 | |
/** | |
* Ensures the "Jump to Recipe" button is added to the content really late. | |
*/ | |
add_action( 'init', function(){ | |
if ( method_exists( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ) ) { | |
remove_filter( 'the_content', array( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ), 100 ); | |
add_filter( 'the_content', array( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ), 10000 ); | |
} | |
}); |
This file contains 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 | |
/** | |
* Uses the post's featured image in the recipe card, | |
* if the recipe doesn't have an assigned image. | |
* | |
* @param array $vars Existing template variables. | |
* @return array | |
*/ | |
add_filter( 'tasty_recipes_recipe_template_vars', function( $vars ) { | |
// If there's no image HTML already for the recipe card... |
This file contains 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 | |
/** | |
* Disable pinning on the print template. | |
*/ | |
add_action( 'template_redirect', function() { | |
if ( function_exists( 'tasty_recipes_is_print' ) && tasty_recipes_is_print() ) { | |
add_action( 'wp_head', function() { | |
echo '<meta name="pinterest" content="nopin" description="Sorry, but please don\'t pin from the print page." />' . PHP_EOL; | |
}); |
This file contains 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 | |
/** | |
* Re-positions the "Jump to Recipe" button. | |
*/ | |
add_action( 'init', function(){ | |
if ( method_exists( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ) ) { | |
remove_filter( 'the_content', array( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ), 100 ); | |
add_filter( 'the_content', array( 'Tasty_Recipes\Shortcodes', 'filter_the_content_late' ), 10 ); | |
} | |
}); |
This file contains 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 | |
/** | |
* Splits a wp_mail() call with more than 40 bcc | |
* headers into multiple batches. | |
* | |
* Postmark only accepts 50 bcc, so this ensures the API call doesn't fail. | |
* | |
* @param array $args Original arguments passed to wp_mail(). | |
* @return | |
*/ |
This file contains 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 | |
/** | |
* Filters the output of the Tasty Recipes block. | |
* | |
* @param string $output Existing output. | |
* @param array $block Block data. | |
* @return string | |
*/ | |
add_filter( 'render_block', function( $output, $block ){ | |
// Only modify the Tasty Recipes block. |
This file contains 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 | |
/** | |
* Adds the Tasty Recipes ratings to the top of the post. | |
* | |
* @param string $content Existing post content. | |
* @return string | |
*/ | |
add_filter( 'the_content', function( $content ) { | |
if ( ! class_exists( 'Tasty_Recipes' ) ) { |
NewerOlder