Uses
Uses | Description |
---|---|
wp-includes/formatting.php: esc_attr() | Escaping for HTML attributes. |
Get the data link attribute for a setting.
(string) (Optional)
Default value: 'default'
(string) Data link parameter, a data-customize-setting-link
attribute if the $setting_key
refers to a pre-registered setting, and a data-customize-setting-key-link
attribute if the setting is not yet registered.
File: wp-includes/class-wp-customize-control.php
public function get_link( $setting_key = 'default' ) { if ( isset( $this->settings[ $setting_key ] ) && $this->settings[ $setting_key ] instanceof WP_Customize_Setting ) { return 'data-customize-setting-link="' . esc_attr( $this->settings[ $setting_key ]->id ) . '"'; } else { return 'data-customize-setting-key-link="' . esc_attr( $setting_key ) . '"'; } }
Version | Description |
---|---|
4.9.0 | Return a data-customize-setting-key-link attribute if a setting is not registered for the supplied setting key. |
3.4.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_control/get_link