Actions and Filters
WooCommerce Lead Time comes with some filters which allow you to customize the plugin's behavior.
Please note that these code snippets are aimed at developers. If you feel comfortable using them, our article on how to use code snippets can serve as a helpful guide. If you don't know how to use them, then you should ask your developer. If you don't have one, then you can use our plugin customization service.
Filters
wclt_disable_default_output
Use this to disable the default output of the lead time on the single product page.
add_filter( 'wclt_disable_default_output', '__return_true' );
wclt_theme_compatibility_stock_escape
Use the filter to disable the escaping and sanitization of the stock status html. While this may be required for the majority of themes, some themes & plugins may need to add custom functionality with markup that is stripped out by wp_kses_post.
add_filter( 'wclt_theme_compatibility_stock_escape', '__return_false' );
wclt_lead_time_availability_output
Use this filter the change the actual HTML content shown in the availability section.
add_filter( 'wclt_lead_time_availability_output', function( $html_output, $lead_time ){
// Change the html content
return $html_output;
}, 10, 2 );
wclt_lead_time_stock_output
Use this filter the change the actual HTML content shown in the stock section.
add_filter( 'wclt_lead_time_stock_output', function( $html_output, $lead_time ){
// Change the html content
return $html_output;
}, 10, 2 );
wclt_lead_time_output
Use this filter the change the lead time shown for the products.
add_filter( 'wclt_lead_time_output', function( $lead_time ){
// Do something with the lead time
return $lead_time;
} );
wclt_lead_time_prefix_output
Use this filter the change the prefix shown for the lead time.
add_filter( 'wclt_lead_time_prefix_output', function( $prefix ){
// Do something with the prefix
return $prefix;
});