Developer Docs

This part of the documentation contains a list of all available Action and Filter hooks in OMGF and OMGF Pro. Sorted alphabetically.

omgf_pro_modify_source_url

Allows you to modify the source URL used in (inline) CSS stylesheets to your liking.

For example, if you’d like to use relative URLs:

add_filter('omgf_pro_modify_source_url', 'daan_dev_modify_source_url', 11);

function daan_dev_modify_source_url($url) {
    return str_replace(get_home_url(), '', wp_upload_dir()['baseurl'] . '/omgf');
}Code language: PHP (php)

omgf_pro_optimize_dynamic_css_handles

Some themes use a dynamic CSS generator to apply theme options to their stylesheets. This filter allows you to add your theme’s dynamic CSS handle, so it’ll be recognized as a stylesheet by OMGF Pro. For example:

add_filter('omgf_pro_optimize_dynamic_css_handles', 'daan_dev_add_css_handle');

function daan_dev_add_css_handle($handles) {
    return array_merge(['banana'], $handles);
}Code language: PHP (php)

Handles that’re included by default are:

  • action
  • load
  • custom-css

omgf_pro_webfont_loader_search_replace_regex_async


omgf_pro_webfont_loader_search_replace_regex


omgf_settings

Using this filter allows you to override settings values, before they’re being output to the plugin.

omgf_setting_${name} (option_name)

Using this filter allows you to force a value for any option_name .