In the following code, the implementation of hook_admin_paths_alter() is shown to exclude or add the paths that we consider necessary or unnecessary to show with the administrative theme.
In this snippet we will mark the obligatory fields present as non-obligatory, and it will be under the condition that the user actually has the role of administrator.
This snippet disables the rich text in Drupal 7 for all the fields of type text or large text. Additionally, it disables the CKEditor toolbar like the selection of the text format
Here is a code fragment in Drupal 7 that implements a callback with the aim of facilitating two actions according to the action that you want to carry out.