diff --git a/src/my-calendar-templating.php b/src/my-calendar-templating.php
index 390521fc..53e60f0d 100644
--- a/src/my-calendar-templating.php
+++ b/src/my-calendar-templating.php
@@ -101,15 +101,16 @@ function mc_php_templates_docs() {
);
$output = '';
foreach ( $templates as $type => $template ) {
- $base = '/mc-templates/' . $type;
- $output .= '
' . $base . '
';
+ $base = 'mc-templates/' . $type;
+ $output .= '/' . $base . '
';
foreach ( $template as $temp ) {
- $exists = mc_template_exists( $base . '/' . $temp . '.php' );
- $id = 'template_' . $type . '-' . $temp;
- $nonce = wp_nonce_field( 'mc-copy-file' );
- $button = '
';
- $append = ( $exists ) ? ' Copied to Theme' : $button;
- $output .= '- ' . $append . '
' . $base . '/' . $temp . '.php' . '
';
+ $exists = mc_template_exists( '/' . $base . '/' . $temp . '.php' );
+ $edit_link = ( $exists ) ? add_query_arg( 'file', $base . '/' . $temp . '.php', admin_url( 'theme-editor.php' ) ) : '';
+ $id = 'template_' . $type . '-' . $temp;
+ $nonce = wp_nonce_field( 'mc-copy-file' );
+ $button = '
';
+ $append = ( $exists ) ? ' ' . __( 'Edit in Theme', 'my-calendar' ) . '' : $button;
+ $output .= '' . $append . '/' . $base . '/' . $temp . '.php' . '
';
}
$output .= '';
}