| @@ -2930,9 +2930,16 @@ | ||
| 2930 | 2930 | /** |
| 2931 | 2931 | * Localize This In Order To Know If This Block Is Arriving From Betterdocs Templates Or Not |
| 2932 | 2932 | */ |
| 2933 | 2933 | betterdocs()->assets->localize( 'betterdocs-category-grid', 'betterdocsCategoryGridConfig', [ |
| 2934 | - 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false | |
| 2934 | + 'is_betterdocs_templates' => betterdocs()->helper->is_templates() ? true : false, | |
| 2935 | + // Must also carry the lazy-load endpoint. wp_localize_script concatenates | |
| 2936 | + // every `var betterdocsCategoryGridConfig = …` for this object name and the | |
| 2937 | + // last assignment wins; shipping only is_betterdocs_templates here clobbered | |
| 2938 | + // Scripts.php's full config on Elementor pages, leaving ajax_url undefined so | |
| 2939 | + // loadLazyBody() bailed and the sidebar widget's lazy-load never fired. | |
| 2940 | + 'ajax_url' => admin_url( 'admin-ajax.php' ), | |
| 2941 | + 'lazy_load_action' => 'betterdocs_lazy_category_body', | |
| 2935 | 2942 | ] ); |
| 2936 | 2943 | |
| 2937 | 2944 | $settings = &$this->attributes; |
| 2938 | 2945 | $default_multiple_kb = (bool) betterdocs()->editor->get( 'elementor' )->multiple_kb_status(); |