LearnDash_Gutenberg_Block
Abstract Parent class to hold common functions used by specific LearnDash Blocks.
Description #
Source #
File: includes/gutenberg/lib/class-learndash-gutenberg-block.php
Changelog #
Version | Description |
---|---|
2.5.9 | Introduced. |
Methods #
- __construct — Constructor.
- block_attributes_get_editing_course_id — Utility function to determine the Edit Course Post ID.
- block_attributes_get_editing_post_data — Utility function to determine the Edit Post Data.
- block_attributes_get_editing_post_id — Utility function to determine the Edit Post ID.
- block_attributes_get_editing_post_type — Utility function to determine the Edit Post Type.
- block_attributes_get_post_id — Utility function to determine the Post ID from the block attributes.
- block_attributes_get_user_id — Utility function to determine the User ID from the block attributes.
- block_attributes_is_editing_post — Utility function to check if we are editing a post.
- build_block_shortcode — Build the block shortcode from attributes string.
- convert_block_markers_to_shortcode — Utility function to parse the WP Block content looking for specific token patterns.
- convert_block_markers_to_shortcode_content_filter — Called from the LD function convert_block_markers_to_shortcode() when parsing the block content.
- get_example_post_id — Get example post ID. This is used as part of WP 5.3 Gutenberg Block Example / Preview.
- get_example_user_id — Get example user ID. This is used as part of WP 5.3 Gutenberg Block Example / Preview.
- init — Initialize the hooks.
- learndash_block_markers_shortcode_atts_filter — Called from the LD function learndash_convert_block_markers_shortcode() when parsing the block content.
- prepare_course_list_atts_to_param — Common function used by the ld_course_list, ld_lesson_list, ld_topic_list, and ld_quiz_list called from the render_block short/block processing function.
- preprocess_block_attributes — Pre-Process the block attributes before render.
- register_blocks — Register Block for Gutenberg
- render_block — Render Block
- render_block_wrap — Add wrapper content around content to be returned to server.
- the_content_filter — Hook into 'the_content' WP filter and parse out our block. We want to convert the Gutenberg Block notation to a normal LD shortcode.