WP_Widget::get_field_id

SummerySummery

Constructs id attributes for use in WP_Widget::form() fields.

Syntax

WP_Widget::get_field_id( string $field_name )

DescriptionDescription

This function should be used in form() methods to create id attributes for fields to be saved by WP_Widget::update().

ParametersParameters

$field_name

(string) (Required) Field name.

ReturnReturn

(string) ID attribute for $field_name.

SourceSource

File: wp-includes/class-wp-widget.php


			

ChangelogChangelog

Changelog
Version Description
4.4.0 Array format field IDs are now accepted.
2.8.0 Introduced.
Scroll to Top