-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
~ Create: archive course, single course blocks Gutenberg.
- Loading branch information
Showing
28 changed files
with
188 additions
and
137 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const save = (props) => null; | ||
export const save = ( props ) => null; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
assets/src/apps/js/blocks/item-curriculum-course/block.json
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 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"apiVersion": 2, | ||
"name": "learnpress/item-curriculum-course", | ||
"title": "Item curriculum Course", | ||
"category": "learnpress-category", | ||
"description": "Renders template Single Item Curriculum Course PHP templates.", | ||
"textdomain": "learnpress", | ||
"keywords": [ "item curriculum course", "learnpress" ], | ||
"usesContext": [], | ||
"supports": { | ||
|
||
} | ||
} |
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 @@ | ||
import { page } from '@wordpress/icons'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
import { Placeholder } from '@wordpress/components'; | ||
|
||
export const edit = ( props ) => { | ||
const blockProps = useBlockProps(); | ||
|
||
return ( | ||
<div { ...blockProps }> | ||
<Placeholder | ||
icon={ page } | ||
label={ __( 'Item Curriculum Course', 'learnpress' ) } | ||
> | ||
<div> | ||
{ | ||
__( | ||
'This is an editor placeholder for the Item Curriculum Course page. Content will render content of single item curriculum course. Should be not remove it', | ||
'learnpress' | ||
) | ||
} | ||
</div> | ||
</Placeholder> | ||
</div> | ||
); | ||
}; |
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,13 @@ | ||
/** | ||
* Register block single course. | ||
*/ | ||
import { edit } from './edit'; | ||
import { save } from './save'; | ||
import block from './block.json'; | ||
import { registerBlockType } from '@wordpress/blocks'; | ||
|
||
registerBlockType( block.name, { | ||
...block, | ||
edit, | ||
save, | ||
} ); |
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 @@ | ||
export const save = ( props ) => null; |
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 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"apiVersion": 2, | ||
"name": "learnpress/single-course", | ||
"title": "Single Course", | ||
"category": "learnpress-category", | ||
"description": "Renders template Single Course PHP templates.", | ||
"textdomain": "learnpress", | ||
"keywords": [ "single course", "learnpress" ], | ||
"usesContext": [], | ||
"supports": { | ||
|
||
} | ||
} |
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 @@ | ||
import { page } from '@wordpress/icons'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { useBlockProps } from '@wordpress/block-editor'; | ||
import { Placeholder } from '@wordpress/components'; | ||
|
||
export const edit = ( props ) => { | ||
const blockProps = useBlockProps(); | ||
|
||
return ( | ||
<div { ...blockProps }> | ||
<Placeholder | ||
icon={ page } | ||
label={ __( 'Single Course', 'learnpress' ) } | ||
> | ||
<div> | ||
{ | ||
__( | ||
'This is an editor placeholder for the Single Course page. Content will render content of single course. Should be not remove it', | ||
'learnpress' | ||
) | ||
} | ||
</div> | ||
</Placeholder> | ||
</div> | ||
); | ||
}; |
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,13 @@ | ||
/** | ||
* Register block single course. | ||
*/ | ||
import { edit } from './edit'; | ||
import { save } from './save'; | ||
import metadata from './block.json'; | ||
import { registerBlockType } from '@wordpress/blocks'; | ||
|
||
registerBlockType( 'learnpress/single-course', { | ||
...metadata, | ||
edit, | ||
save, | ||
} ); |
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 @@ | ||
export const save = ( props ) => null; |
This file was deleted.
Oops, something went wrong.
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
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
31 changes: 31 additions & 0 deletions
31
inc/block-template/class-block-template-item-curriculum-course.php
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,31 @@ | ||
<?php | ||
|
||
/** | ||
* Class Block_Template_Single_Course | ||
* | ||
* Handle register, render block template | ||
*/ | ||
class Block_Template_Item_Curriculum_Course extends Abstract_Block_Template { | ||
public $slug = 'item-curriculum-course'; | ||
public $name = 'learnpress/item-curriculum-course'; | ||
public $title = 'Item curriculum Course (LearnPress)'; | ||
public $description = 'Item Curriculum Course Block Template'; | ||
public $path_html_block_template_file = 'html/item-curriculum-course.html'; | ||
public $path_template_render_default = 'content-single-item.php'; | ||
public $source_js = LP_PLUGIN_URL . 'assets/js/dist/blocks/item-curriculum-course.js'; | ||
|
||
public function __construct() { | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Render content of block tag | ||
* | ||
* @param array $attributes | Attributes of block tag. | ||
* | ||
* @return false|string | ||
*/ | ||
public function render_content_block_template( array $attributes ) { | ||
return parent::render_content_block_template( $attributes ); | ||
} | ||
} |
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
Oops, something went wrong.