Use pluggable functions only around functions which cannot be unhooked (#1480)

This commit is contained in:
Ismail El Korchi 2022-01-01 22:15:14 +01:00 committed by GitHub
parent d6ccb97e0b
commit 8852c27641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 99 additions and 99 deletions

View file

@ -50,16 +50,18 @@ function _s_jetpack_setup() {
}
add_action( 'after_setup_theme', '_s_jetpack_setup' );
/**
* Custom render function for Infinite Scroll.
*/
function _s_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_type() );
endif;
if ( ! function_exists( '_s_infinite_scroll_render' ) ) :
/**
* Custom render function for Infinite Scroll.
*/
function _s_infinite_scroll_render() {
while ( have_posts() ) {
the_post();
if ( is_search() ) :
get_template_part( 'template-parts/content', 'search' );
else :
get_template_part( 'template-parts/content', get_post_type() );
endif;
}
}
}
endif;