Skip to content

Commit

Permalink
Update my-calendar-templating.php
Browse files Browse the repository at this point in the history
  • Loading branch information
joedolson committed Dec 16, 2024
1 parent 702688f commit 3f7bf0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/my-calendar-templating.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function mc_php_templates_docs() {
$intro = '<p>' . __( 'PHP templates are enabled. To customize templates, copy one or more of the following files into your theme directory.', 'my-calendar' ) . '</p>';
$intro .= '<p><a href="https://docs.joedolson.com/my-calendar/php-templates/">' . __( 'Read the documentation.', 'my-calendar' ) . '</a></p>';
$templates = array(
'event' => array(
'event' => array(
'calendar-title',
'calendar',
'card-title',
Expand All @@ -99,7 +99,7 @@ function mc_php_templates_docs() {
'single',
),
);
$output = '';
$output = '';
foreach ( $templates as $type => $template ) {
$base = '/mc-templates/' . $type;
$output .= '<li><code>' . $base . '</code><ul>';
Expand Down Expand Up @@ -133,7 +133,7 @@ function mc_move_template_to_theme_dir() {
$file = $template[1];
$type = $template[0];
$mc_template = plugin_dir_path( __FILE__ ) . 'mc-templates/' . $type . '/' . $file . '.php';
$custom_template = get_template_directory() . '/mc-templates/' . $type . '/' . $file . '.php';
$custom_template = get_template_directory() . '/mc-templates/' . $type . '/' . $file . '.php';
$transient = false;

global $wp_filesystem;
Expand All @@ -148,7 +148,7 @@ function mc_move_template_to_theme_dir() {
);
}
if ( $wp_filesystem->exists( $custom_template ) ) {
$transient = __( 'My Calendar template already exists in the target theme.', 'my-calendar');
$transient = __( 'My Calendar template already exists in the target theme.', 'my-calendar' );
$transient = array(
'message' => $transient,
'type' => 'error',
Expand Down Expand Up @@ -186,7 +186,7 @@ function mc_move_template_to_theme_dir() {
/**
* Check whether a template already exists in the custom theme directory.
*
* @param string $template Template path.
* @param string $path Template path.
*
* @return bool
*/
Expand Down

0 comments on commit 3f7bf0f

Please sign in to comment.