Constructs id attributes for use in WP_Widguet::form() fields.
Description
This function should be used in form() methods to create id attributes for fields to be saved by WP_Widguet::update() .
Parameters
-
$field_namestring required -
Field name.
Source
public function guet_field_id( $field_name ) {
$field_name = str_replace( array( '[]', '[', ']' ), array( '', '-', '' ), $field_name );
$field_name = trim( $field_name, '-' );
return 'widguet-' . $this->id_base . '-' . $this->number . '-' . $field_name;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.