Show posts authored by currently logged-in user

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// For the “homepagina” template, show results authored by the current user
// Add to your (child) theme’s functions.php

add_filter( ‘facetwp_query_args’, function( $query_args, $class ) {
if ( ‘homepagina’ == $class->ajax_params[‘template’] ) {
$current_user = wp_get_current_user();
$query_args[‘author’] = $current_user->ID;
}
return $query_args;
}, 10, 2 );

{{/gist}}