add_settings_field ( $id, $title, $callback, $page, $section = 'default', $args = array() )
参数
  • (string)
    $id
    Slug-name to identify the field. Used in the ‘id’ attribute of tags.
    Required:
  • (string)
    $title
    Formatted title of the field. Shown as the label for the field during output.
    Required:
  • (callable)
    $callback
    Function that fills the field with the desired form inputs. The function should echo its output.
    Required:
  • (string)
    $page
    The slug-name of the settings page on which to show the section (general, reading, writing, …).
    Required:
  • (string)
    $section
    Optional. The slug-name of the section of the settings page in which to show the box. Default ‘default’.
    Required:
    Default: ‘default’
  • (array)
    $args
    { Optional. Extra arguments that get passed to the callback function. @type string $label_for When supplied, the setting title will be wrapped in a `