1, 'tab_links' => false, 'tab_align' => 'left', 'validate_steps' => false, 'total_steps' => count( $block['innerBlocks'] ) ]; } return $block_content; } public function render($attr, $content, $block) { if ( empty( $block->inner_blocks ) ) { return '
' . esc_html__( 'Please add some steps to this block.', 'frontend-admin' ) . '
'; } $active_step = 0; $tab_links = isset( $attr['tab_links'] ) ? boolval( $attr['tab_links'] ) : false; $tab_align = isset( $attr['tabs_align'] ) ? $attr['tabs_align'] : 'left'; $validate_steps = ! empty( $attr['validate_steps'] ); global $fea_steps_context; $steps_total = count( $block->inner_blocks ); $fea_steps_context = [ 'active_step' => $active_step, 'tab_links' => $tab_links, 'tab_align' => $tab_align, 'validate_steps' => $validate_steps, 'total_steps' => $steps_total, ]; $tabs = ''; $steps = ''; if( ! empty( $attr['steps_counter_display'] ) ){ $the_step = '' . $active_step . ''; if ( isset( $attr['counter_text'] ) ) { $counter_text = str_replace( '{current_step}', $the_step, esc_html( $attr['counter_text'] ) ); $counter_text = str_replace( '{total_steps}', $steps_total, $counter_text ); } else { $counter_text = esc_html( $attr['counter_prefix'] ) . $the_step . esc_html( $attr['counter_suffix'] ); } $counter = sprintf( '