Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions fieldmanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,23 @@ function fm_calculate_context() {

if ( empty( $calculated_context ) ) {
$calculated_context = array( null, null );

/**
* Filter the calculated context to allow for custom contexts and overrides to be used.
*
* @since 1.0.0
*
* @param array $calculated_context {
* Array of context information.
*
* @type string|null A Fieldmanager context of "post", "quickedit", "term",
* "submenu", or "user", or null if one isn't found.
* @type string|null A "type" dependent on the context. For "post" and
* "quickedit", the post type. For "term", the taxonomy.
* For "submenu", the group name. For all others, null.
* }
*/
$calculated_context = apply_filters( 'fm_calculated_context', $calculated_context );
}

return $calculated_context;
Expand Down