LLMS_Blocks_Lesson_Navigation_Block

Course syllabus block class.


Source Source

File: libraries/lifterlms-blocks/includes/blocks/class-llms-blocks-lesson-navigation-block.php

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class LLMS_Blocks_Lesson_Navigation_Block extends LLMS_Blocks_Abstract_Block {
 
    /**
     * Block ID.
     *
     * @var string
     */
    protected $id = 'lesson-navigation';
 
    /**
     * Is block dynamic (rendered in PHP).
     *
     * @var bool
     */
    protected $is_dynamic = true;
 
    /**
     * Add actions attached to the render function action.
     *
     * @param   array  $attributes Optional. Block attributes. Default empty array.
     * @param   string $content    Optional. Block content. Default empty string.
     * @return  void
     * @since   1.0.0
     * @version 1.1.0
     */
    public function add_hooks( $attributes = array(), $content = '' ) {
 
        add_action( $this->get_render_hook(), 'lifterlms_template_lesson_navigation', 10 );
 
    }
 
    /**
     * Retrieve custom block attributes.
     * Necessary to override when creating ServerSideRender blocks.
     *
     * @return  array
     * @since   1.0.0
     * @version 1.0.0
     */
    public function get_attributes() {
        return array_merge(
            parent::get_attributes(),
            array(
                'post_id' => array(
                    'type'    => 'int',
                    'default' => 0,
                ),
            )
        );
    }
 
}


Top ↑

Methods Methods


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.