WordPress at a glance
функция не описана

WP_Customize_Widgets::parse_widget_setting_id() public WP 3.9.0

Converts a widget setting ID (option path) to its id_base and number components.

It's a method of the class: WP_Customize_Widgets{}

Хуков нет.

Возвращает

Array/WP_Error. Array containing a widget's id_base and number components, or a WP_Error object.

Использование

$WP_Customize_Widgets = new WP_Customize_Widgets();
$WP_Customize_Widgets->parse_widget_setting_id( $setting_id );
$setting_id(string) (required)
Widget setting ID.

Changelog

Since 3.9.0 Introduced.

Код WP_Customize_Widgets::parse_widget_setting_id() WP 5.5.1

<?php
public function parse_widget_setting_id( $setting_id ) {
	if ( ! preg_match( '/^(widget_(.+?))(?:\[(\d+)\])?$/', $setting_id, $matches ) ) {
		return new WP_Error( 'widget_setting_invalid_id' );
	}

	$id_base = $matches[2];
	$number  = isset( $matches[3] ) ? intval( $matches[3] ) : null;

	return compact( 'id_base', 'number' );
}