Hooks reference
Every action and filter the plugins provide, with their arguments.
Lifecycle
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_loaded (action) | $plugin | Requirements met and Free booted; extensions start here |
siteryn_pgl_activated · _deactivated (actions) | - | Activation / deactivation |
siteryn_pgl_upgrade (action) | $old_version, $new_version | Stored version differs from the running one (fresh installs too); on init |
siteryn_pgl_migrate_settings (action) | $schema_version, $stored | Before stored settings migrate to a newer schema |
Shortcode and query
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_shortcode_defaults | $defaults, $layout | Attribute defaults; add your own attributes here |
shortcode_atts_siteryn_product_grid · _list | $out, $pairs, $atts | WordPress core filter on the parsed attributes |
siteryn_pgl_shortcode_query_params | $query, $atts | Query parameters built from attributes |
siteryn_pgl_orderby_options | $options | orderby key => label; translate new keys in siteryn_pgl_query_args |
siteryn_pgl_max_limit | $max | Most products one grid may query (100) |
siteryn_pgl_query_args | $args, $params | WP_Query arguments |
siteryn_pgl_query_result | $result, $args | Result before it is cached and rendered |
siteryn_pgl_query_cache_enabled | $enabled, $args, $params | Whether results are cached (true) |
siteryn_pgl_query_cache_ttl | $seconds | Cache lifetime (one day, at least 60) |
add_filter( 'siteryn_pgl_max_limit', function () {
return 200;
} );
Rendering
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_layouts | $layouts | Layout registry: label, template, item_template, base, supports |
siteryn_pgl_render_args | $args | Display arguments before rendering |
siteryn_pgl_wrapper_attributes | $attributes, $args | Wrapper HTML attributes (escaped; on* dropped) |
siteryn_pgl_wrapper_style | $style, $args | Wrapper CSS custom properties (only --* with plain values kept) |
siteryn_pgl_item_classes | $classes, $product, $args | Item <li> classes |
siteryn_pgl_item_excerpt | $excerpt, $product, $words | Plain-text short description |
siteryn_pgl_output | $html, $args | Final HTML |
siteryn_pgl_load_styles | $enabled | Whether the stylesheet loads |
siteryn_pgl_shortcode_tags | $tags | Shortcodes that make the stylesheet load in the page head |
siteryn_pgl_enqueue_assets (action) | - | A grid is rendering; enqueue your own assets |
Card and template actions
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_before_products · _after_products | $args | Inside the wrapper, around the item list (Pro prints load more after) |
siteryn_pgl_before_item · _after_item | $product, $args | Inside each card <article> |
siteryn_pgl_item_media | $product, $args | Media area: image (10); Pro badges (5) |
siteryn_pgl_item_body | $product, $args | Title (10), rating (20), price (30), excerpt (40); Pro loop hook (35) |
siteryn_pgl_item_footer | $product, $args | Add to cart (10); Pro swatches (5), quick view (20), loop hook (30) |
siteryn_pgl_item_after_title · _after_price | $product, $args | Right after the title or price |
siteryn_pgl_before_template · _after_template | $name, $args | Around every template include |
siteryn_pgl_template_paths (filter) | $paths | Template folders searched after the theme |
siteryn_pgl_locate_template (filter) | $path, $name | The resolved template file |
add_action( 'siteryn_pgl_item_after_price', function ( $product ) {
if ( $product->is_on_sale() ) {
echo '<p class="my-note">Limited offer</p>';
}
} );
Settings screen
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_settings_sections | $tabs | Settings tabs: label, sublabel, description, icon, optional badge, render_callback, group |
siteryn_pgl_settings_fields | $fields | Field schema: section, group, type (checkbox, number, select, button_group, text), label, default, … |
siteryn_pgl_sanitize_settings | $output, $input | Sanitized settings before save |
siteryn_pgl_admin_tabs | $tabs | Every tab in order, including Shortcode Builder, System Status and Get Premium |
siteryn_pgl_settings_nav_groups | $groups | Left menu groups: settings, pro, system |
siteryn_pgl_settings_nav_group | $group, $tab | Which group a tab is listed under |
siteryn_pgl_settings_save_redirect | false, $option | Return [ 'tab' => …, 'message' => … ] to refuse an AJAX save and switch tab |
siteryn_pgl_ajax_option_groups | $groups | Option group => option name pairs the AJAX save accepts |
siteryn_pgl_status_cards | $cards | System Status summary cards (when Pro is active) |
siteryn_pgl_attribute_reference | $rows | Lines of the All attributes list |
siteryn_pgl_settings_sidebar (action) | $tab | Cards in a tab's sidebar |
siteryn_pgl_settings_main_after (action) | $tab | End of a tab's main panel |
siteryn_pgl_builder_fields (action) | - | Inside the shortcode builder; controls with data-siteryn-pgl-attr="name" are added to the shortcode, data-siteryn-pgl-tag replaces the tag |
siteryn_dashboard_plugins | $plugins | Shared by Siteryn plugins: cards on the Siteryn Welcome page |
siteryn_deactivation_feedback_endpoint | $url | Shared: where the optional deactivation survey is sent |
Pro hooks Pro
| Hook | Arguments | Use |
|---|---|---|
siteryn_pgl_pro_loaded (action) | $plugin | Pro booted on a compatible Free; Free then hides Get Premium |
siteryn_pgl_pro_features_loaded (action) | - | Pro features registered (licensed sites only) |
siteryn_pgl_pro_activated · _deactivated (actions) | - | Activation / deactivation |
siteryn_pgl_pro_upgrade (action) | $old, $new | Stored Pro version changed |
siteryn_pgl_pro_license_activated · _deactivated (actions) | - | License activated or deactivated on this site |
siteryn_pgl_pro_license_status_changed (action) | $new, $old | The license server reported a new status (renewal, refund, cancellation, expiry) |
siteryn_pgl_pro_swatches (action) | $product, $args | Card footer before add to cart, for swatch plugins |
siteryn_pgl_pro_quick_view_button (action) | $product, $args | Print your own quick view button instead of Pro's |
siteryn_pgl_pro_quick_view_enabled | false, $product | Return true when your plugin handles quick view |
siteryn_pgl_pro_badges | $badges, $product, $args | A product's badges: key, text, label |
siteryn_pgl_pro_tab_presets | $presets | Presets for [siteryn_product_grid_tabs]: label, atts |
siteryn_pgl_pro_settings_fields | $fields | Pro settings schema (same format as Free) |
siteryn_pgl_pro_rest_rate_limit | $limit | Load more requests per IP per 5 minutes (120) |
siteryn_pgl_pro_is_entitled | $entitled | Whether Pro features run; for tests and staging only |
add_filter( 'siteryn_pgl_pro_tab_presets', function ( $presets ) {
$presets['gifts'] = array( 'label' => 'Gift ideas', 'atts' => array( 'tag' => 'gift' ) );
return $presets;
} );
add_filter( 'siteryn_pgl_pro_badges', function ( $badges, $product ) {
if ( has_term( 'vegan', 'product_tag', $product->get_id() ) ) {
$badges[] = array( 'key' => 'vegan', 'text' => 'Vegan', 'label' => 'Vegan product' );
}
return $badges;
}, 10, 2 );