Skip to content

Commit a2dc6ee

Browse files
Context: Make sure to default to the wp context when use inside the admin
1 parent eeba2f7 commit a2dc6ee

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

context.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@
2121

2222
$fields->enqueued_contexts []= $context;
2323
};
24+
25+
/**
26+
* By default, assume we want to use the wp context inside the
27+
* wordpress admin
28+
*/
29+
add_action( 'admin_init', function() use( $fields ) {
30+
$fields->set_context( 'wp' );
31+
}, 1 );

0 commit comments

Comments
 (0)