Skip to content

Instantly share code, notes, and snippets.

@kaskad88
Created February 3, 2020 09:09
Show Gist options
  • Save kaskad88/3c2ccc6e3d157c7c67d2216f12f3d717 to your computer and use it in GitHub Desktop.
Save kaskad88/3c2ccc6e3d157c7c67d2216f12f3d717 to your computer and use it in GitHub Desktop.
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