Add edit and view links to the 'templates used' page
authorLaury GvR <laury@gaslightmedia.com>
Thu, 14 Feb 2019 22:35:26 +0000 (17:35 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 14 Feb 2019 22:35:26 +0000 (17:35 -0500)
functions.php

index c2b5758..1deadc1 100644 (file)
@@ -452,14 +452,17 @@ function list_templates_by_type( $type = 'page' ) {
             if ( $count == 0 ) {
                 $output .= ' <span>Every '. $type .' not listed below has template "Default".</span></b></br><br>';
                 $output .= ' <table style="border-collapse: collapse;">';
-                $output .= ' <tr><th>ID</th><th>Name</th><th>Slug</th><th>Template</th></tr>';
+                $output .= ' <tr><th>ID</th><th>Name</th><th>Slug</th><th>Template</th><th></th><th></th></tr>';
             }
             $count++;
             $output .= '<tr style="background-color: white;">';
             $output .= '<td style="border: 1px solid black;padding: 4px;">' . $post->ID . '</td>';
-            $output .= '<td style="border: 1px solid black;padding: 4px;"><a href="' . get_permalink( $post->ID ) . '">' . $post->post_title . '</a></td>';
+            $output .= '<td style="border: 1px solid black;padding: 4px;">' . $post->post_title . '</td>';
             $output .= '<td style="border: 1px solid black;padding: 4px;">' . $post->post_name . '</td>';
             $output .= '<td style="border: 1px solid black;padding: 4px;">' . get_page_template_slug( $post->ID ) . '</td>';
+            $output .= '<td style="border: 1px solid black;padding: 4px;"><a href="' . get_edit_post_link( $post->ID ) . '">Edit</td>';
+            $output .= '<td style="border: 1px solid black;padding: 4px;"><a href="' . get_permalink( $post->ID ) . '">View</td>';
+
             $output .= '</tr>';
         }