$this->step_instances[ $step_id ] = $step_instance; } } } /** * Returns the steps config from source * * @return array */ public static function get_step_ids(): array { return self::$step_ids; } /** * Using step data->id, instantiates and returns the step class or null if the class does not exist * * @param $step_data * * @return Step_Base|null */ private function get_step_instance( string $step_id ): ?Step_Base { $class_name = '\\Elementor\\Modules\\Checklist\\Steps\\' . $step_id; if ( ! class_exists( $class_name ) ) { return null; } /** @var Step_Base $step */ return new $class_name( $this->module, $this->module->get_wordpress_adapter(), $this->module->get_elementor_adapter() ); } private function filter_steps() { $step_ids = []; $filtered_steps = apply_filters( 'elementor/checklist/steps', $this->step_instances ); foreach ( $filtered_steps as $step_id => $step_instance ) { if ( ! $step_instance instanceof Step_Base ) { continue; } if ( ! $step_instance->is_visible() ) { continue; } $this->step_instances[ $step_id ] = $step_instance; $step_ids[] = $step_id; } self::$step_ids = $step_ids; } }