Skip to content

Commit 2322ce2

Browse files
jeffpaulhuzaifaalmesbahmindctrldkotter
authored
Merge pull request #69 from huzaifaalmesbah/docs/improve-feature-filter-documentation
Docs: Enhance feature enable/disable filter documentation with implementation details Co-authored-by: huzaifaalmesbah <huzaifaalmesbah@git.wordpress.org> Co-authored-by: mindctrl <mindctrl@git.wordpress.org> Co-authored-by: dkotter <dkotter@git.wordpress.org>
2 parents 8ef3ac8 + 128aebe commit 2322ce2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/DEVELOPER_GUIDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,14 @@ add_filter( 'ai_experiments_default_experiment_classes', function( $experiment_c
296296
Experiments can be disabled using the `ai_experiment_{$experiment_id}_enabled` filter:
297297

298298
```php
299-
add_filter( 'ai_experiments_experiment_example-experiment_enabled', '__return_false' );
299+
// Disable a specific experiment by its ID
300+
add_filter( 'ai_experiment_example-experiment_enabled', '__return_false' );
301+
302+
// Or with a custom callback
303+
add_filter( 'ai_experiment_example-experiment_enabled', function( $enabled ) {
304+
// Your custom logic here
305+
return false;
306+
} );
300307
```
301308

302309
### Disabling All Experiments

0 commit comments

Comments
 (0)