Skip to content

Commit

Permalink
Merge pull request #55 from eoxia-amandine/fix_template_call
Browse files Browse the repository at this point in the history
#54 fix: templates call
  • Loading branch information
eoxia-amandine authored May 23, 2024
2 parents ad5b9dd + 80aa640 commit 7bd1e2a
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 24 deletions.
10 changes: 5 additions & 5 deletions inc/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/

if ( class_exists( 'Sensei_Main', true ) ) {
require get_stylesheet_directory() . '/inc/blocks/bfs-course-signup/bfs-course-signup.php';
require get_stylesheet_directory() . '/inc/blocks/bfs-course-tax/bfs-course-tax.php';
require get_stylesheet_directory() . '/inc/blocks/bfs-course-lesson/bfs-course-lesson.php';
require get_stylesheet_directory() . '/inc/blocks/bfs-course-time/bfs-course-time.php';
require get_stylesheet_directory() . '/inc/blocks/bfs-login/bfs-login.php';
require get_template_directory() . '/inc/blocks/bfs-course-signup/bfs-course-signup.php';
require get_template_directory() . '/inc/blocks/bfs-course-tax/bfs-course-tax.php';
require get_template_directory() . '/inc/blocks/bfs-course-lesson/bfs-course-lesson.php';
require get_template_directory() . '/inc/blocks/bfs-course-time/bfs-course-time.php';
require get_template_directory() . '/inc/blocks/bfs-login/bfs-login.php';
}

/**
Expand Down
3 changes: 1 addition & 2 deletions inc/blocks/bfs-course-lesson/bfs-course-lesson.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define( 'BFS_COURSE_LESSON_DIR', dirname(__DIR__, 1) . '/bfs-course-lesson' );
}
if ( ! defined( 'BFS_COURSE_LESSON_URL' ) ) {
define( 'BFS_COURSE_LESSON_URL', get_stylesheet_directory_uri() . '/inc/blocks/bfs-course-lesson' );
define( 'BFS_COURSE_LESSON_URL', get_template_directory_uri() . '/inc/blocks/bfs-course-lesson' );
}

/**
Expand All @@ -40,4 +40,3 @@ function bfs_course_lesson_load_json( $paths ) {
return $paths;
}
add_filter( 'acf/settings/load_json', 'bfs_course_lesson_load_json' );

2 changes: 1 addition & 1 deletion inc/blocks/bfs-course-signup/bfs-course-signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define( 'BFS_COURSE_SIGNUP_DIR', dirname(__DIR__, 1) . '/bfs-course-signup' );
}
if ( ! defined( 'BFS_COURSE_SIGNUP_URL' ) ) {
define( 'BFS_COURSE_SIGNUP_URL', get_stylesheet_directory_uri() . '/inc/blocks/bfs-course-signup' );
define( 'BFS_COURSE_SIGNUP_URL', get_template_directory_uri() . '/inc/blocks/bfs-course-signup' );
}

/**
Expand Down
3 changes: 1 addition & 2 deletions inc/blocks/bfs-course-tax/bfs-course-tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define( 'BFS_COURSE_TAX_DIR', dirname(__DIR__, 1) . '/bfs-course-tax' );
}
if ( ! defined( 'BFS_COURSE_TAX_URL' ) ) {
define( 'BFS_COURSE_TAX_URL', get_stylesheet_directory_uri() . '/inc/blocks/bfs-course-tax' );
define( 'BFS_COURSE_TAX_URL', get_template_directory_uri() . '/inc/blocks/bfs-course-tax' );
}

/**
Expand All @@ -40,4 +40,3 @@ function bfs_course_tax_load_json( $paths ) {
return $paths;
}
add_filter( 'acf/settings/load_json', 'bfs_course_tax_load_json' );

3 changes: 1 addition & 2 deletions inc/blocks/bfs-course-time/bfs-course-time.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define( 'BFS_COURSE_TIME_DIR', dirname(__DIR__, 1) . '/bfs-course-time' );
}
if ( ! defined( 'BFS_COURSE_TIME_URL' ) ) {
define( 'BFS_COURSE_TIME_URL', get_stylesheet_directory_uri() . '/inc/blocks/bfs-course-time' );
define( 'BFS_COURSE_TIME_URL', get_template_directory_uri() . '/inc/blocks/bfs-course-time' );
}

/**
Expand All @@ -40,4 +40,3 @@ function bfs_course_time_load_json( $paths ) {
return $paths;
}
add_filter( 'acf/settings/load_json', 'bfs_course_time_load_json' );

3 changes: 1 addition & 2 deletions inc/blocks/bfs-login/bfs-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
define( 'BFS_LOGIN_DIR', dirname(__DIR__, 1) . '/bfs-login' );
}
if ( ! defined( 'BFS_LOGIN_URL' ) ) {
define( 'BFS_LOGIN_URL', get_stylesheet_directory_uri() . '/inc/blocks/bfs-login' );
define( 'BFS_LOGIN_URL', get_template_directory_uri() . '/inc/blocks/bfs-login' );
}

/**
Expand All @@ -40,4 +40,3 @@ function bfs_login_load_json( $paths ) {
return $paths;
}
add_filter( 'acf/settings/load_json', 'bfs_login_load_json' );

2 changes: 1 addition & 1 deletion inc/generateBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if ( ! defined( '{{blockVar}}_DIR' ) ) {
define( '{{blockVar}}_DIR', dirname(__DIR__, 1) . '/{{blockName}}' );
}
if ( ! defined( '{{blockVar}}_URL' ) ) {
define( '{{blockVar}}_URL', get_stylesheet_directory_uri() . '/inc/blocks/{{blockName}}' );
define( '{{blockVar}}_URL', get_template_directory_uri() . '/inc/blocks/{{blockName}}' );
}
/**
Expand Down
6 changes: 3 additions & 3 deletions sensei/archive-course.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php
$block_header = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/header.html") );
$block_content = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-templates/archive-course.html") );
$block_footer = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/footer.html") );
$block_header = do_blocks( file_get_contents( locate_template( 'block-template-parts/header.html' ) ) );
$block_content = do_blocks( file_get_contents( locate_template( 'block-templates/archive-course.html' ) ) );
$block_footer = do_blocks( file_get_contents( locate_template( 'block-template-parts/footer.html' ) ) );
?>
<?php wp_head(); ?>
</head>
Expand Down
4 changes: 2 additions & 2 deletions sensei/archive-message.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php
$block_header = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/header.html") );
$block_footer = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/footer.html") );
$block_header = do_blocks( file_get_contents( locate_template( 'block-template-parts/header.html' ) ) );
$block_footer = do_blocks( file_get_contents( locate_template( 'block-template-parts/footer.html' ) ) );
?>
<?php wp_head(); ?>
</head>
Expand Down
4 changes: 2 additions & 2 deletions sensei/learner-profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php
$block_header = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/header.html") );
$block_header = do_blocks( file_get_contents( locate_template( 'block-template-parts/header.html' ) ) );
$block_content = '';
$block_footer = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/footer.html") );
$block_footer = do_blocks( file_get_contents( locate_template( 'block-template-parts/footer.html' ) ) );
?>
<?php wp_head(); ?>
</head>
Expand Down
4 changes: 2 additions & 2 deletions sensei/single-message.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<?php
$block_header = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/header.html") );
$block_footer = do_blocks( file_get_contents(get_stylesheet_directory_uri() . "/block-template-parts/footer.html") );
$block_header = do_blocks( file_get_contents( locate_template( 'block-template-parts/header.html' ) ) );
$block_footer = do_blocks( file_get_contents( locate_template( 'block-template-parts/footer.html' ) ) );
?>
<?php wp_head(); ?>
</head>
Expand Down

0 comments on commit 7bd1e2a

Please sign in to comment.