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.
// 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
-
/** * 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' ); -
/** * Context for filesystem, default false. */ apply_filters( 'request_filesystem_credentials_context', false ); -
{$key}_tracking_enabled
filterapply_filters( "{$key}_tracking_enabled", $is_enabled ); -
bsf_custom_font_google_fonts
filterapply_filters( 'bsf_custom_font_google_fonts', self::$google_fonts ); -
apply_filters( "{$source}_white_label_options", array() ); -
astra_notice_after_markup
actiondo_action( 'astra_notice_after_markup' ); -
do_action( "astra_notice_after_markup_{$notice['id']}" ); -
astra_notice_before_markup
actiondo_action( 'astra_notice_before_markup' ); -
do_action( "astra_notice_before_markup_{$notice['id']}" ); -
do_action( "astra_notice_inside_markup_{$notice['id']}" ); -
astra_notices_user_cap_check
filterapply_filters( 'astra_notices_user_cap_check', current_user_can( $capability ) ); -
bcf_fonts_base_path
filterapply_filters( 'bcf_fonts_base_path', $this->get_filesystem()->wp_content_dir() ); -
bcf_fonts_base_url
filterapply_filters( 'bcf_fonts_base_url', content_url() ); -
bcf_preloading_fonts_format
filterapply_filters( 'bcf_preloading_fonts_format', 'woff2' ); -
bsf_core_stats
filterapply_filters( 'bsf_core_stats', $this->get_default_stats() ); -
apply_filters( 'bsf_custom_fonts_dashboard_admin_localize', $localize ); -
bsf_custom_fonts_rest_data
filterapply_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-... ); -
apply_filters( 'bsf_taxonomy_args_custom_fonts', $args ); -
apply_filters( 'bsf_taxonomy_objects_custom_fonts', array() ); -
bsf_tracking_enabled
filterapply_filters( 'bsf_tracking_enabled', $is_tracking_enabled ); -
bsf_white_label_options
filterapply_filters( 'bsf_white_label_options', array() ); -
custom_fonts_update_after
actiondo_action( 'custom_fonts_update_after' ); -
custom_fonts_update_before
actiondo_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: