-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from eoxia-amandine/rework_bfs_blocks
#49 Rework: ACF Blocks
- Loading branch information
Showing
48 changed files
with
973 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Blocks added to theme | ||
* | ||
* @package Beflex | ||
* @since 4.0.0 | ||
*/ | ||
|
||
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'; | ||
} | ||
|
||
/** | ||
* Create custom block category | ||
* @param $block_categories | ||
* @param $editor_context | ||
* @return mixed | ||
*/ | ||
function beflex_create_block_category( $block_categories, $editor_context ) { | ||
if ( ! empty( $editor_context->post ) ) { | ||
array_unshift( | ||
$block_categories, | ||
array( | ||
'slug' => 'beflex', | ||
'title' => __( 'Beflex', 'custom-plugin' ), | ||
'icon' => 'admin-appearance', | ||
) | ||
); | ||
} | ||
return $block_categories; | ||
} | ||
|
||
add_filter( 'block_categories_all', 'beflex_create_block_category', 10, 2 ); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
inc/blocks/bfs-course-completion/bfs-course-completion.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* Style CSS de bfs-course-lesson | ||
*/ | ||
.bfs-course-lesson { | ||
color: rgba(0, 0, 0, 0.6); | ||
font-size: 14px; | ||
} | ||
.bfs-course-lesson .bfs-course-lesson__icon { | ||
width: 16px; | ||
vertical-align: text-top; | ||
} | ||
.bfs-course-lesson span { | ||
vertical-align: text-bottom; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes
27 changes: 27 additions & 0 deletions
27
inc/blocks/bfs-course-lesson/assets/js/bfs-course-lesson.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function($){ | ||
/** | ||
* initializeBlock | ||
* | ||
* Adds custom JavaScript to the block HTML. | ||
* | ||
* @param object $block The block jQuery element. | ||
* @param object attributes The block attributes (only available when editing). | ||
* @return void | ||
*/ | ||
var initializeBlock = function( $block ) { | ||
} | ||
|
||
// Initialize each block on page load (front end). | ||
$(document).ready(function(){ | ||
$('.bfs-course-lesson').each(function(){ | ||
initializeBlock( $(this) ); | ||
}); | ||
}); | ||
|
||
// Initialize dynamic block preview (editor). | ||
if( window.acf ) { | ||
window.acf.addAction( 'render_block_preview/type=bfs-course-lesson', initializeBlock ); | ||
} | ||
|
||
})(jQuery); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"name": "beflex/course-lesson", | ||
"title": "BFS Course lessons", | ||
"description": "Display lessons associated to a course", | ||
"style": [ "block-bfs-course-lesson-style" ], | ||
"viewScript": [], | ||
"category": "beflex", | ||
"icon": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" role=\"img\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z\"></path></svg>", | ||
"apiVersion": 2, | ||
"textdomain": "beflex", | ||
"keywords": [ | ||
"beflex", | ||
"sensei", | ||
"bfs", | ||
"lesson", | ||
"count", | ||
"course-lesson" | ||
], | ||
"supports": { | ||
}, | ||
"acf": { | ||
"mode": "preview", | ||
"renderTemplate": "../../view.php" | ||
} | ||
} |
8 changes: 5 additions & 3 deletions
8
...bfs-course-lessons/assets/scss/style.scss → .../bfs-course-lesson/assets/scss/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
.bfs-course-lessons { | ||
/** | ||
* Style CSS de bfs-course-lesson | ||
*/ | ||
.bfs-course-lesson { | ||
color: rgba(0,0,0,0.6); | ||
font-size: 14px; | ||
|
||
.bfs-course-lessons__icon { | ||
.bfs-course-lesson__icon { | ||
width: 16px; | ||
vertical-align: text-top; | ||
} | ||
span { | ||
vertical-align: text-bottom; | ||
} | ||
} | ||
|
Oops, something went wrong.