add_hooks(); if ( $page_builder_config_import->has_settings() ) { $strategy = new WPML_PB_Shortcode_Strategy( new WPML_Page_Builder_Settings() ); $strategy->add_shortcodes( $page_builder_config_import->get_settings() ); $page_builder_strategies[] = $strategy; } $required = apply_filters( 'wpml_page_builder_support_required', array() ); foreach ( $required as $plugin ) { $page_builder_strategies[] = new WPML_PB_API_Hooks_Strategy( $plugin ); } if ( $page_builder_strategies ) { if ( $pb_integration ) { $factory = $pb_integration->get_factory(); } else { $factory = new WPML_PB_Factory( $wpdb, $sitepress ); $pb_integration = new WPML_PB_Integration( $sitepress, $factory ); } $pb_integration->add_hooks(); foreach ( $page_builder_strategies as $strategy ) { $strategy->set_factory( $factory ); $pb_integration->add_strategy( $strategy ); } } } }