Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter nicholasbarry

    (@nicholasbarry)

    Ok, I found a solution. First, I’m using the Shortcode Exec PHP plugin to allow me to execute PHP on pages. Then I use this PHP:

    global $current_user;
          get_currentuserinfo();
        $my_posts = get_posts( array( 'author' => $current_user->ID, 'numberposts' => 100 ) );
    
        $output = '
    <ul>';
        foreach ( $my_posts as $my_post ) {
            $output .= '
    <li><a>ID ) . '">' . apply_filters( 'the_title', $my_post->post_title, $my_post->ID ) . '</a>, (<a>ID . '&action=edit" target="_blank">Edit</a>)</li>
    ';
        }
        $output .= '</ul>
    ';
    
        return $output;

    That loads all the posts by whoever’s logged in (up to 100). If you’re not logged in, it just shows all the posts (up to 100).

Viewing 1 replies (of 1 total)