Tribe__Customizer::get_section_link( string $section, string $link_text = '' )
Gets the HTML link to a section in the TEC Customizer.
Contents
Parameters
- $section
-
(string) (Required) The section "slug" to link to.
- $link_text
-
(string) (Optional) The text for the link.
Default value: ''
Return
(string) The HTML anchor element, linking to the TEC Customizer section. An empty string is returned if missing a parameter.
Source
File: src/Tribe/Customizer.php
public function get_section_link( $section, $link_text = '' ) {
if ( empty( $section ) || empty( $link_text ) || ! is_string($link_text ) ) {
return '';
}
$panel_url = $this->get_section_url( $section );
if ( empty( $panel_url ) ) {
return '';
}
return sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( $panel_url ),
esc_html( $link_text )
);
}
Changelog
| Version | Description |
|---|---|
| 4.14.0 | Introduced. |