This commit is contained in:
2025-07-18 16:00:59 -07:00
parent 8d3a6b9c98
commit 9d25f4c8a5

View File

@@ -0,0 +1,32 @@
<?php
namespace Actions;
use ofc\RadAction;
class DontShowProductsOnShopLandingPageAction extends RadAction
{
/**
* @var string WordPress hook to attach to.
*/
protected string $hookName = 'init';
/**
* @var int Hook priority.
*/
protected int $priority = 10;
/**
* Your action callback.
*/
public function callback()
{
if (!is_shop()) {
return;
}
add_action('pre_get_posts', function ($query) {
$query->set('posts_per_page', 0);
});
}
}