', '

' ), array( '
', '
' ), $data['upgrade_notice'] ); echo '
' . wp_kses_post( wpautop( $msg ) ) . '
'; } } /** * @since 1.6.0 * Javascript code for changelog in plugins page */ function wt_crp_plugin_screen_update_notice_js() { global $pagenow; if ( 'plugins.php' !== $pagenow ) { return; } ?>

' . sprintf( __( 'Related Products requires WooCommerce to be active. You can download WooCommerce %s.', 'wt-woocommerce-related-products' ), '' . __( 'here', 'wt-woocommerce-related-products' ) . '' ) . '

'; } /** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 1.0.0 */ function run_custom_related_products() { $plugin = new Custom_Related_Products(); $plugin->run(); } run_custom_related_products(); // Hook to add wrapper only for the related products shortcode function wrap_related_products_shortcode_output($output, $tag) { if ('wt-related-products' === $tag) { $output = '
' . $output . '
'; } return $output; } // Ensure the function runs after all plugins are loaded and WooCommerce is available function wt_related_products_plugin_init() { if (class_exists('WooCommerce')) { add_filter('do_shortcode_tag', 'wrap_related_products_shortcode_output', 10, 2); } } add_action('plugins_loaded', 'wt_related_products_plugin_init');