Filters
php// Override the storage adapter (default: transients)
add_filter( 'omobile_storage_adapter', function( $adapter ) {
return new My_Redis_Adapter(); // must implement OMobile_Storage_Interface
});
// Modify config payload before it's returned
add_filter( 'omobile_config_payload', function( $payload, $install_id ) {
$payload['custom_key'] = 'custom_value';
return $payload;
}, 10, 2 );
// Control which capabilities can manage OMobile
add_filter( 'omobile_admin_cap', function() {
return 'manage_options'; // default is 'manage_omobile'
});
Actions
php// Fires after a crash is reported
add_action( 'omobile_crash_reported', function( $crash_id, $data ) {
// notify Slack, create GitHub issue, etc.
}, 10, 2 );
// Fires after a push is dispatched
add_action( 'omobile_push_dispatched', function( $queue_id, $result ) {}, 10, 2 );
// Fires after a flag is updated
add_action( 'omobile_flag_updated', function( $flag_key, $new_value ) {}, 10, 2 );