display post for logged in user only
-
HI
Im trying to make what seems like a simple adjustment to a plugin im using, unfortunately im just a ‘wannabe programmer’ and not the real deal so i wa shoping someone whom is a real programmer can help me out here. If you can help me i would be foreever grateful and even willing to pay a bit for someone to explain this process to me…… here goes:
Im working with a plugin, it has a list of posts recently created and shows ALL posts no matter which user i login with… I would like to change this to show ONLY post by the user whom is logged in… Below si the current code
<?php
global $wpdb;
$current_time = current_time(‘mysql’) + 60;$ereminder_array = $wpdb->get_results( $wpdb->prepare(“
SELECT *
FROM {$wpdb->posts}WHERE post_date <= %s
AND post_type =’ereminder’
AND post_status = ‘draft’
AND author = ‘wp_current_user’
ORDER BY post_date ASC
“, $current_time) );
$scheduled_data = array(
‘list’ => $ereminder_array,
‘type’ => ‘scheduled’
);
echo PDER_Utils::get_view( ‘ereminder-list.php’, $scheduled_data );
?>if anybody can tell me how to alter above code to show only post by the user that is logged in instead of all the users like it does now i would be forever grateful.
thanks in advance
- The topic ‘display post for logged in user only’ is closed to new replies.