1 filter.admin.inc filter_admin_format_page($format = NULL)

Page callback: Displays the text format add/edit form.


object|null $format: (optional) An object representing a format, with the following properties:

  • format: A machine-readable name representing the ID of the text format to save. If this corresponds to an existing text format, that format will be updated; otherwise, a new format will be created.
  • name: The title of the text format.
  • cache: (optional) An integer indicating whether the text format is cacheable (1) or not (0). Defaults to 1.
  • status: (optional) An integer indicating whether the text format is enabled (1) or not (0). Defaults to 1.
  • weight: (optional) The weight of the text format, which controls its placement in text format lists. If omitted, the weight is set to 0. Defaults to NULL.

Return value

A form array.:

See also



core/modules/filter/filter.admin.inc, line 160
Admin page callbacks for the Filter module.


function filter_admin_format_page($format = NULL) {
  if (!isset($format->name)) {
    backdrop_set_title(t('Add text format'));
    $format = (object) array(
      'format' => NULL,
      'name' => '',
      'editor' => '',
      'editor_settings' => array(),
      'cache' => 1,
      'status' => 1,
      'is_new' => TRUE,
      'filters' => array(),
  return backdrop_get_form('filter_admin_format_form', $format);