id = $id; $this->help_button_text = $help_button_text; $this->help_content = $help_content; $this->wrapper = $wrapper; } /** * Returns the html for the Help Button. * * @return string */ public function get_button_html() { if ( ! $this->id || ! $this->help_button_text ) { return ''; } return sprintf( ' ', esc_attr( $this->id ), $this->help_button_text ); } /** * Returns the html for the Help Panel. * * @return string */ public function get_panel_html() { if ( ! $this->id || ! $this->help_button_text || ! $this->help_content ) { return ''; } $wrapper_start = $wrapper_end = ''; if ( 'has-wrapper' === $this->wrapper ) { $wrapper_start = '
'; $wrapper_end = '
'; } return sprintf( '%1$s

%3$s

%4$s', $wrapper_start, esc_attr( $this->id ), $this->help_content, $wrapper_end ); } }