Hooks Reference

  • JNext lesson
  • KPrevious lesson
  • FSearch lessons
  • EscClear search

Actions Used

WordPress Core Actions

plugins_loaded
Handler: acf_blocks_init()
Checks ACF availability and loads the plugin’s include files.

init (priority 5)
Handler: acf_blocks_register_styles()
Pre-registers all block stylesheets with wp_register_style() for conditional loading.

after_setup_theme (priority 999)
Handler: acf_blocks_add_editor_styles()
Adds all block CSS files as editor styles via add_editor_style().

enqueue_block_editor_assets
Handler: acf_blocks_enqueue_editor_assets()
Enqueues the block transforms JavaScript in the editor.

enqueue_block_assets (priority 999999)
Handler: acf_blocks_enqueue_editor_styles()
Enqueues all block stylesheets in the editor (admin only). Uses a very high priority to ensure styles load after theme styles.

admin_enqueue_scripts
Handler: acf_url_preview_admin_scripts()
Enqueues the URL Preview admin JavaScript on post/page edit screens.

wp_enqueue_scripts
Handler: acf_star_rating_register_assets()
Registers the star rating frontend script.

the_content (priority 10)
Handler: acf_toc_add_heading_ids()
Adds id attributes to headings that lack them (only when a TOC block is present in the post).

wp_head (priority 99)
Handler: acf_toc_add_scroll_margin_style()
Outputs scroll-margin-top: 80px CSS for headings with IDs (only on singular pages with a TOC block).

wp_footer (priority 100)
Handler: md_output_stored_block_css()
Outputs collected inline CSS from Section Block instances.

admin_menu (priority 99)
Handler: ACF_Blocks_License_Manager::add_submenu_page()
Adds the license management page under Settings.

admin_init
Handler: ACF_Blocks_License_Manager::handle_license_actions()
Processes license activation/deactivation form submissions.

admin_notices
Handler: ACF_Blocks_License_Manager::admin_notices()
Shows expired license notice on the Plugins screen.

ACF Actions

acf/init (priority 5)
Handler: acf_blocks_load_blocks()
Scans the blocks directory and registers all blocks, field groups, and extra files.

AJAX Actions

wp_ajax_acf_star_rating_submit and wp_ajax_nopriv_acf_star_rating_submit
Handler: acf_star_rating_handle_submission()
Processes star rating submissions from visitors.

wp_ajax_acf_url_preview_fetch
Handler: acf_url_preview_fetch_handler()
Fetches URL metadata for the URL Preview block.

wp_ajax_acf_url_preview_import_image
Handler: acf_url_preview_import_image_handler()
Imports an external image to the media library.

Cron Actions

acf_blocks_verify_license (weekly)
Handler: ACF_Blocks_License_Manager::verify_remote_license()
Checks license validity against the remote server.

Filters Used

WordPress Core Filters

block_categories_all (priority 10)
Handler: acf_blocks_register_category()
Inserts the “ACF Blocks” category at the top of the block inserter.

block_editor_settings_all (priority 999999)
Handler: acf_blocks_inject_editor_styles()
Injects all block CSS as inline styles into the editor settings.

render_block_data
Handler: acf_blocks_reconstruct_nested_repeaters()
Converts flat repeater keys to nested row-N format for the block editor (admin and REST requests only).

wp_insert_post_data (priority 10)
Handler: acf_blocks_localize_external_images()
Downloads external images in ACF block data and rewrites URLs before save.

pre_set_site_transient_update_plugins
Handler: ACF_Blocks_License_Manager::check_for_update()
Checks for plugin updates when WordPress refreshes the update transient.

plugins_api (priority 10)
Handler: ACF_Blocks_License_Manager::plugin_info()
Provides plugin information for the update details modal.

delete_site_transient_update_plugins
Handler: ACF_Blocks_License_Manager::clear_update_transient()
Clears the cached update info when the update transient is deleted.

plugin_action_links_{basename}
Handler: ACF_Blocks_License_Manager::plugin_action_links()
Adds a “License” link to the plugin’s action links on the Plugins screen.

ACF Filters

acf/fields/relationship/query (priority 10)
Handler: acf_blocks_optimize_post_display_query()
Optimizes the relationship field query for the Post Display block.

acf/fields/relationship/query (priority 5)
Handler: acf_blocks_optimize_post_display_result()
Optimizes relationship field results for the Post Display block.

Custom Filters (Public API)

acf_blocks_is_local_image_url

Allows site owners to declare additional hostnames as “local” for the image localizer. When this filter returns true, images from that host will not be downloaded.

add_filter( 'acf_blocks_is_local_image_url', function( $is_local, $url_host, $site_bare ) {
    if ( $url_host === 'my-cdn.example.com' ) {
        return true;
    }
    return $is_local;
}, 10, 3 );

Parameters:

  • $is_local (bool) – Current local status (false when this runs).
  • $url_host (string) – The hostname of the image URL.
  • $site_bare (string) – Your site’s hostname without www..