Change proposal
-
Hey, first of all thanks very much for your work. Excellent plug-in, my client loves it!
Please allow me to propose a small (non-breaking) addition to the plug-in logic. A requirement came up for me to always show a placeholder for certain products. For the sake of clean code, I thought the best way to do this would be to add a little filter at index.php:181:
if ( ! empty( $thumb_ids ) && ! apply_filters("woosq_always_placeholder", false) ) {
instead of just
if ( ! empty( $thumb_ids ) {
This gives us a way to alter the behavior in another plug-in or the theme functions.php:
add_filter( "woosq_always_placeholder", function(){ return true; }, 10);
… or, thanks to PHP 7.4 arrow functions:
add_filter( "woosq_always_placeholder", fn() => true ), 10);
I hope you will find this useful and consider including the code in future updates.
Thanks!
- The topic ‘Change proposal’ is closed to new replies.