Menu Close

Blocksify Pro hooks reference

Blocksify Pro hooks let developers extend Loop Filter, dynamic data, and Search Kit behavior and control Slider registration without editing plugin files.

This reference covers Pro-owned PHP filters in Blocksify Pro 1.2.0. The free plugin’s PHP and JavaScript extension points are documented in Extending Blocksify: hooks overview and are not repeated here. Return the same data type that each filter receives.

Loop Filter

Start with the Loop Filter overview for the user-facing workflow. The facet displays and swatches guide explains the presentation choices exposed by the filters below.

Facets and index rows

HookRuns whenYou can change
blocksify_lf_facet_types( $types )Collecting facet-source descriptors.Register a source with support, exposure, normalization, and row callbacks.
blocksify_lf_facet_options( $options, $facet, $loop_context )Finishing one facet’s option rows.Relabel, reorder, inject, or decorate options.
blocksify_lf_filterable_families( $map )Mapping data kinds to facet families.Add or replace an options, range, daterange, or toggle mapping.
blocksify_lf_relationship_postmeta_providers( $providers )Checking relationship storage.Declare sources whose relationships can use meta queries.
blocksify_lf_clauses( $clauses, $state, $facet_configs, $uid )Finishing assembled facet clauses.Change clauses before they merge into loop arguments.
blocksify_lf_object_rows( $rows, $entity, $provider, $field_key, $kind, $post_id, $post_type )Indexing one field for one object.Amend or replace its index rows.
blocksify_lf_indexable_statuses( $statuses )Selecting objects for the index.Change indexed post statuses.
blocksify_pro_lf_allowed_statuses( $statuses )Validating a status facet.Change statuses a filtered query may return.
blocksify_pro_lf_rest_excluded_post_types( $excluded, $post_type, $args )Registering a post type.Exclude it from forced editor access.
blocksify_pro_lf_force_post_type_rest( $force, $post_type, $args ), blocksify_pro_lf_force_taxonomy_rest( $force, $taxonomy, $args )Registering content types or taxonomies.Override automatic editor access.

Change an option label.

add_filter(
    'blocksify_lf_facet_options',
    function ( $options, $facet, $loop_context ) {
        foreach ( $options as &$option ) {
            if ( 'instock' === $option['value'] ) {
                $option['label'] = 'Available now';
            }
        }
        return $options;
    },
    10,
    3
);
HookRuns whenYou can change
blocksify_lf_counts_cache( $counts_or_null, $digest, $ids_hash, $generation )Reading and writing grouped counts.Supply and persist a counts cache.
blocksify_lf_count_ids_cap( $cap )Before materializing the count target.Change the 20,000-ID safety cap; 0 disables it.
blocksify_pro_lf_sort_handlers( $handlers )Building sort presets.Register handlers with apply and optional query callbacks.
blocksify_pro_lf_sort_handler_id( $id, $option, $args )Dispatching an authored sort option.Route it to another handler.
blocksify_lf_swatch_resolvers( $resolvers )Collecting swatch sources.Register claims, resolve, and priority.
blocksify_pro_lf_search_cache( $persist, $ids )After resolving Loop Search Bar result IDs.Enable or disable persistent caching.
blocksify_lf_preserved_params( $params, $target )Building hidden fields for a no-script submit.Change unrelated query parameters that survive.
blocksify_lf_search_actions( $actions, $context )Rendering search-field action icons.Add an icon and its interaction attributes.

Add a sort option.

add_filter( 'blocksify_pro_lf_sort_handlers', function ( $handlers ) {
    $handlers['example/comments'] = array(
        'id'        => 'example/comments',
        'label'     => 'Most discussed',
        'group'     => 'Example',
        'direction' => 'DESC',
        'apply'     => function ( $args, $direction, $option, $context ) {
            $args['orderby'] = 'comment_count';
            $args['order']   = $direction;
            return $args;
        },
    );
    return $handlers;
} );

Register a swatch source.

add_filter( 'blocksify_lf_swatch_resolvers', function ( $resolvers ) {
    $resolvers['example'] = array(
        'priority' => 15,
        'claims'   => 'example_claims_swatches',
        'resolve'  => 'example_resolve_swatches',
    );
    return $resolvers;
} );

See Add a custom swatch source for the complete callback contract.

WooCommerce integration

HookRuns whenYou can change
blocksify_pro_lf_woo_active( $active ), blocksify_pro_lf_woo_swatches_active( $active ), blocksify_pro_lf_yay_swatches_loaded( $loaded )Checking integrations.Override detection for compatible or renamed builds.
blocksify_pro_lf_woo_result_ids( $ids, $field_key, $fv, $config )Resolving a WooCommerce facet.Replace its result IDs.
blocksify_pro_lf_woo_price_bounds( $bounds, $config )Preparing stored price limits.Convert displayed bounds.
blocksify_pro_lf_woo_price_band( $band, $config )Preparing a requested price range.Convert it back to stored values.

Dynamic data

See Dynamic data in the Content Loop for the editor workflow and supported output.

HookRuns whenYou can change
blocksify_pro_cl_acf_expose( $allowed, $binding, $context ), blocksify_pro_cl_pods_expose( $allowed, $binding, $context ), blocksify_pro_cl_meta_box_expose( $allowed, $binding, $context ), blocksify_pro_cl_toolset_expose( $allowed, $binding, $context )Checking a plugin-backed field for public output.Allow or deny that binding.
blocksify_pro_cl_raw_meta_expose( $allowed, $key, $binding, $context )Checking a raw meta key.Override the protected-key decision.

Search Kit

See the Search Kit overview for the visitor-facing search flow these filters extend.

HookRuns whenYou can change
blocksify_pro_search_tabs_post_types( $list )Building the searchable post-type list.Add, remove, or relabel tabs.
blocksify_pro_search_tabs_count_args( $args, $post_type, $term )Preparing one tab’s count query.Match custom visibility rules.
blocksify_pro_search_tabs_count_ttl( $ttl, $post_type, $term )Caching a tab count.Change the 120-second lifetime; 0 disables shared caching.

Slider

See Slider and Slide blocks for the editor and visitor-facing behavior behind this version gate.

HookRuns whenYou can change
blocksify_pro_slider_force_enable( $force )Checking Slider support with Blocksify 1.2.0 installed.Force-enable the Slider and Slide blocks before the normal Blocksify 1.2.1 minimum is met.

Conditions

Visibility conditions are evaluated without a Pro-owned filter in Blocksify Pro 1.2.0.

HookRuns whenYou can change
—No Pro-owned filter runs in this area in 1.2.0.Use the WordPress block-rendering API or the free Blocksify plugin hooks where applicable.

Interactions

HookRuns whenYou can change
—No Pro-owned PHP filter runs in this area in 1.2.0.Free’s interaction catalog and effect hooks remain the extension surface.

Dashboard

HookRuns whenYou can change
—No Pro-owned filter runs in this area in 1.2.0.Use the free dashboard hooks listed in the overview.

Was this helpful?

0

Updated