Created
February 3, 2020 09:09
-
-
Save kaskad88/3c2ccc6e3d157c7c67d2216f12f3d717 to your computer and use it in GitHub Desktop.
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_filter( 'jet-engine/listings/filters-list', function( $list ) { | |
$list['posts_list_by_ids'] = array( | |
'cb' => '__custom_posts_list_by_ids', | |
'args' => false, | |
); | |
return $list; | |
} ); | |
function __custom_posts_list_by_ids( $ids ) { | |
if ( ! is_array( $ids ) ) { | |
return; | |
} | |
$result = ''; | |
foreach ( $ids as $id ) { | |
$result .= sprintf( | |
'<a href="%1$s">%2$s</a>', | |
get_permalink( $id ), | |
get_the_title( $id ) | |
); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment