Custom Fonts icon
Performance & Caching

Custom Fonts hooks reference

  • By Brainstorm Force
  • v2.1.18 New
  • Updated

Custom Fonts 2.1.18 has 7 actions and 17 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.

How to use these hooks

Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.

functions.phpyour child theme
// Run your own code when Custom Fonts fires an action
add_action( 'astra_notice_after_markup', function() {
	// Your code runs here.
}, 10, 1 );

// Change a value Custom Fonts is about to use
add_filter( 'bsf_custom_font_google_fonts_php_file', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.

All hooks

  • admin/dashboard/includes/class-bcf-custom-font-families.php line 108
    /**
     * Deprecating the Filter to change the Google Fonts JSON file path.
     */
    apply_filters( 'bsf_custom_font_google_fonts_php_file', BSF_CUSTOM_FONTS_DIR . 'assets/fonts/google-fonts.php' );
  • includes/class-bcf-filesystem.php line 51
    /**
     * Context for filesystem, default false.
     */
    apply_filters( 'request_filesystem_credentials_context', false );
  • admin/bsf-analytics/class-bsf-analytics.php line 157 · used in 2 places
    apply_filters( "{$key}_tracking_enabled", $is_enabled );
  • admin/dashboard/includes/class-bcf-custom-font-families.php line 98 · used in 2 places
    apply_filters( 'bsf_custom_font_google_fonts', self::$google_fonts );
  • admin/dashboard/includes/class-bsf-custom-fonts-menu.php line 88 · used in 2 places
    apply_filters( 'bsf_custom_fonts_menu_title', _x( 'Custom Fonts', 'Menu title', 'custom-fonts' ) );
  • admin/bsf-analytics/class-bsf-analytics.php line 174
    apply_filters( "{$source}_white_label_options", array() );
  • lib/notices/class-astra-notices.php line 290
    do_action( 'astra_notice_after_markup' );
  • lib/notices/class-astra-notices.php line 288
    do_action( "astra_notice_after_markup_{$notice['id']}" );
  • lib/notices/class-astra-notices.php line 275
    do_action( 'astra_notice_before_markup' );
  • lib/notices/class-astra-notices.php line 277
    do_action( "astra_notice_before_markup_{$notice['id']}" );
  • lib/notices/class-astra-notices.php line 282
    do_action( "astra_notice_inside_markup_{$notice['id']}" );
  • lib/notices/class-astra-notices.php line 114
    apply_filters( 'astra_notices_user_cap_check', current_user_can( $capability ) );
  • includes/class-bcf-google-fonts-compatibility.php line 147
    apply_filters( 'bcf_fonts_base_path', $this->get_filesystem()->wp_content_dir() );
  • includes/class-bcf-google-fonts-compatibility.php line 161
    apply_filters( 'bcf_fonts_base_url', content_url() );
  • classes/class-bsf-custom-fonts-render.php line 405
    apply_filters( 'bcf_preloading_fonts_format', 'woff2' );
  • admin/bsf-analytics/class-bsf-analytics-stats.php line 57
    apply_filters( 'bsf_core_stats', $this->get_default_stats() );
  • admin/dashboard/includes/class-bsf-custom-fonts-menu.php line 522
    apply_filters( 'bsf_custom_fonts_dashboard_admin_localize', $localize );
  • includes/class-custom-fonts-api-init.php line 151
    apply_filters( 'bsf_custom_fonts_rest_data', array( 'fonts' => $bsf_fonts_data, 'found_posts' => $query_posts->found_posts, 'active_fonts_count' => isset( $bsf_custom_font_posts->publish ) ? intval( $bsf_custom_font_posts->publish ) : 0, 'trash_fonts_count' => isset( $bsf_custom_font_posts->trash ) ? intval( $bsf_custom_font_posts->trash ) : 0, 'draft_fonts_count' => isset( $bsf_custom_font_posts->draft ) ? intval( $bsf_custom_font_posts-... );
  • includes/class-bsf-custom-fonts-taxonomy.php line 112
    apply_filters( 'bsf_taxonomy_args_custom_fonts', $args );
  • includes/class-bsf-custom-fonts-taxonomy.php line 111
    apply_filters( 'bsf_taxonomy_objects_custom_fonts', array() );
  • includes/rest-api/class-cf-bsf-analytics-compatibility.php line 41
    apply_filters( 'bsf_tracking_enabled', $is_tracking_enabled );
  • includes/rest-api/class-cf-bsf-analytics-compatibility.php line 62
    apply_filters( 'bsf_white_label_options', array() );
  • includes/plugin-update/class-custom-fonts-update.php line 84
    do_action( 'custom_fonts_update_after' );
  • includes/plugin-update/class-custom-fonts-update.php line 62
    do_action( 'custom_fonts_update_before' );

Generated from Custom Fonts's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.

Can't find the right hook?

We can build the customisation for you. Describe what you need: