How can I open new page in wordpress plugin on anchor tag click?

I’m creating a simple plugin for learning purpose and I’m struck on a very basic point. I have page of my plugin in admin panel and in that page I have list of pages. I want when I click on page title it should open in a new page with information about that specific page. Following is the code I tried but anchor tag doesnot open new page but it give “Page not found error”.

$pages = get_pages();
foreach ($pages as $key => $pagesResult) {
echo '<a href="displayComments.php?pageId=' .$pagesResult->ID .'" target="_blank">' . $pagesResult->post_title . '<a><br>';
}

Related posts

1 comment

  1. Your link is not correct. It should be something like:

     admin.php?page=Comments+Control&pageId=
    

Comments are closed.