get_settings_for_display(); $repeater_name = $settings['arfe_repeater_field']; $repeater = get_field($repeater_name); return new ARFE_Repeater_Query($repeater); } public function before_render() { add_action('elementor/frontend/the_content', [$this, 'test_content'], 1, 1); parent::before_render(); } public function test_content($content) { return $content; } // elementor-widget-loop-carousel Must be part of the class name so all the styling settings will be attached to it. protected function get_html_wrapper_class() { return 'elementor-widget-' . $this->get_name() . ' elementor-widget-loop-carousel'; } public function after_render() { parent::after_render(); remove_filter('elementor/frontend/the_content', [$this, 'test_content']); // $swiper_settings = $this->get_swiper_settings(); // Output initialization script ?> repeater = is_array($repeater) ? array_values($repeater) : []; $this->count = count($this->repeater); $this->found_posts = $this->count; $this->post_count = $this->count; } public function have_posts() { return $this->index < $this->count; } public function the_post() { $this->in_the_loop = true; $this->index++; // Register the action when the_post is called at skin-base.php line 926 add_action('elementor/frontend/the_content', [$this, 'modify_the_content'], 10, 1); } public function modify_the_content($content) { $current_row = $this->get_current_row(); // Process the row to translate values if the function exists if (function_exists('arfe_process_repeater_row')) { $current_row = arfe_process_repeater_row($current_row); } $content = apply_filters('arfe_repeater_row_content', $content, $current_row); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- legacy public hook name kept for backward compatibility. // Remove the action after modifying the content remove_action('elementor/frontend/the_content', [$this, 'modify_the_content'], 10); return $content; } public function rewind_posts() { $this->index = 0; $this->in_the_loop = false; } public function get_current_row() { return $this->repeater[$this->index - 1] ?? null; } }