hortcode_str ) ) { $shortcode_out = do_shortcode( $shortcode_str ); } if ( ! empty( $shortcode_out ) ) { if ( $this->block_attributes_is_editing_post( $block_attributes ) ) { $shortcode_out = $this->render_block_wrap( $shortcode_out ); } else { $shortcode_out = '
' . $shortcode_out . '
'; } } return $shortcode_out; } /** * Called from the LD function learndash_convert_block_markers_shortcode() when parsing the block content. * * @since 2.5.9 * * @param array $block_attributes The array of attributes parse from the block content. * @param string $shortcode_slug This will match the related LD shortcode ld_profile, ld_group_list, etc. * @param string $block_slug This is the block token being processed. Normally same as the shortcode but underscore replaced with dash. * @param string $content This is the original full content being parsed. * * @return array $block_attributes. */ public function learndash_block_markers_shortcode_atts_filter( $block_attributes = array(), $shortcode_slug = '', $block_slug = '', $content = '' ) { if ( $shortcode_slug === $this->shortcode_slug ) { if ( isset( $block_attributes['per_page'] ) ) { if ( ! isset( $block_attributes['num'] ) ) { $block_attributes['num'] = $block_attributes['per_page']; unset( $block_attributes['per_page'] ); } } if ( ( ! isset( $block_attributes['course_grid'] ) ) || ( true === $block_attributes['course_grid'] ) ) { $block_attributes['course_grid'] = 'true'; } if ( ( isset( $block_attributes['group_categoryselector'] ) ) && ( true === $block_attributes['group_categoryselector'] ) ) { $block_attributes['group_categoryselector'] = 'true'; } if ( ( isset( $block_attributes['categoryselector'] ) ) && ( true === $block_attributes['categoryselector'] ) ) { $block_attributes['categoryselector'] = 'true'; } /** * Not the best place to make this call this but we need to load the * Course Grid resources. */ if ( 'true' === $block_attributes['course_grid'] ) { learndash_enqueue_course_grid_scripts(); } if ( ( isset( $block_attributes['progress_bar'] ) ) && ( true === $block_attributes['progress_bar'] ) ) { $block_attributes['progress_bar'] = 'true'; } } return $block_attributes; } // End of functions. } } new LearnDash_Gutenberg_Block_Group_List();