Flexa Media Folders 1.4.6 has 7 actions and 21 filters, read directly from its source code on Nov 19, 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 Flexa Media Folders fires an action
add_action( 'flexa_mf/deactivated', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Flexa Media Folders is about to use
add_filter( 'flexa_mf/admin/screen_context', function( $value, $hook_suffix ) {
// Change $value here.
return $value;
}, 10, 2 );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
-
/** * Fires while the plugin is being deactivated on this site. Add-ons should * unschedule their own cron events here - deactivation leaves no scheduled * work of its own behind. */ do_action( 'flexa_mf/deactivated' ); -
/** * Let an extension claim an admin screen the plugin ignores. */ apply_filters( 'flexa_mf/admin/screen_context', null, $hook_suffix ); -
/** * The capability that exempts a user from the post-listing author scope. * Defaults to the post type's own `edit_others_posts`. Return an empty string * to drop the narrowing for this post type entirely. */ apply_filters( 'flexa_mf/capabilities/list_others_objects', $cap, $post_type ); -
/** * How long a resolved Uncategorized count may be reused. Returning 0 disables * the cache, which makes every tree request pay for the scan again: useful * when debugging a count that looks wrong. */ apply_filters( 'flexa_mf/counts/uncategorized_ttl', 12 * HOUR_IN_SECONDS ); -
/** * Short-circuit the per-folder count aggregation. The default query below * JOINs the attachment relation table, which returns nothing for a folder type * that stores its membership somewhere else. Return a non-null array<int,int> * (folder_id => count) to bypass the default query entirely; return null to * run it (the attachment path). */ apply_filters( 'flexa_mf/folder/counts_by_folder', null, $type, $owner_id ); -
/** * Filter the special-bucket tallies (All / Uncategorized) for the folder tree. * The default values count attachments. */ apply_filters( 'flexa_mf/folder/specials', $specials, $type, $with_counts, $owner_id ); -
/** * Filters the gallery's inline CSS. Returning '' prints nothing, which is the * clean way for a theme to take the styling over entirely. */ apply_filters( 'flexa_mf/gallery/inline_css', self::css() ); -
/** * The author scope a post-type folder tree's counts run under. Return null to * leave the tallies site-wide, or an id to force a different author. */ apply_filters( 'flexa_mf/listing/object_author_scope', $author, $post_type ); -
/** * Fires after every service has been wired up. Add-ons and theme integrations * should hook this rather than `plugins_loaded` directly so they see a fully * booted plugin. */ do_action( 'flexa_mf/loaded', $this ); -
/** * Filter the folder types a POST /folders request may create. */ apply_filters( 'flexa_mf/rest/creatable_folder_types', $types ); -
/** * Filter the folder list before the tree/flat payload is assembled. An * access-control addon hooks this to drop folders the current user may not * *view*, so hidden folders never reach the sidebar. The default is the * unfiltered list. */ apply_filters( 'flexa_mf/rest/folders', $folders, $type, $owner_id ); -
/** * Reconfigure the sanitizer before it runs, for example to allow extra tags or * attributes. Listeners receive and must return the Sanitizer instance, * widening its allow-list through the setter methods. */ apply_filters( 'flexa_mf/svg/sanitizer', $sanitizer ); -
/** * Allow a trusted site to skip sanitization on the automatic upload path. The * default is true, so an install with no add-on always sanitizes. A caller * that passes `$force = true` overrides trusted mode, because asking to * re-sanitize is an unambiguous intent to clean. */ apply_filters( 'flexa_mf/svg/should_sanitize', true, $context ); -
apply_filters( 'flexa_mf/media/visible_folder_ids', null ); -
apply_filters( 'flexa_mf/capabilities/access_folder', self::can_manage_folders(), $folder_id, $action ); -
apply_filters( 'flexa_mf/capabilities/edit', self::EDIT ); -
apply_filters( 'flexa_mf/capabilities/manage', self::MANAGE ); -
apply_filters( 'flexa_mf/capabilities/per_user_scope', false ); -
apply_filters( 'flexa_mf/capabilities/settings', self::SETTINGS ); -
do_action( 'flexa_mf/data_reset' ); -
apply_filters( 'flexa_mf/deactivation_survey/config', [ 'product' => self::PRODUCT, 'tier' => self::TIER, 'version' => FLEXA_MF_VERSION, 'plugin_file' => FLEXA_MF_BASENAME, 'api_url' => self::API_URL, 'support_url' => self::SUPPORT_URL, ] ); -
apply_filters( 'flexa_mf/deactivation_survey/enabled', true ); -
apply_filters( 'flexa_mf/folder/display_name', $this->name, $this->id ); -
do_action( 'flexa_mf/folder/seen', $this->id, $this->name ); -
do_action( 'flexa_mf/import/completed', $source->key, $result ); -
do_action( 'flexa_mf/rest/register_routes' ); -
do_action( 'wpml_register_single_string', self::STRING_CONTEXT, $key, $name ); -
apply_filters( 'wpml_translate_single_string', $name, self::STRING_CONTEXT, $key );
Generated from Flexa Media Folders's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: