public function webShortcodeHandler( $atts, $content ) {

		global $id; // This is the Post ID, [@see WP_Query::setup_postdata, ...]

		$a = shortcode_atts(
			[
				'id' => '',
				'type' => '',
			], $atts
		);

		if ( ! empty( $content ) ) {
			// This is a tooltip
			if ( $a['id'] ) {
				if ( ! isset( $this->glossaryTerms[ $id ] ) ) {
					$this->glossaryTerms[ $id ] = [];
				}

				if ( ! isset( $this->glossaryTerms[ $id ][ $a['id'] ] ) ) {
					$this->glossaryTerms[ $id ][ $a['id'] ] = get_post_field( 'post_content', $a['id'] );
				}
				return $this->glossaryTooltip( $a['id'], $content );
			}
		} else {
			// This is a list of glossary terms
			return $this->glossaryTerms( $a['type'] );
		}

		return $content;
	}
public function webShortcodeHandler( $atts, $content ) {

		global $id; // This is the Post ID, [@see WP_Query::setup_postdata, ...]

		$a = shortcode_atts(
			[
				'id' => '',
				'type' => '',
			], $atts
		);

		if ( ! empty( $content ) ) {
			// This is a tooltip
			if ( $a['id'] ) {
				if ( ! isset( $this->glossaryTerms[ $id ] ) ) {
					$this->glossaryTerms[ $id ] = [];
				}

				if ( ! isset( $this->glossaryTerms[ $id ][ $a['id'] ] ) ) {
					$this->glossaryTerms[ $id ][ $a['id'] ] = get_post_field( 'post_content', $a['id'] );
				}
				return $this->glossaryTooltip( $a['id'], $content );
			}
		} else {
			// This is a list of glossary terms
			return $this->glossaryTerms( $a['type'] );
		}

		return $content;
	}
public function webShortcodeHandler ( $ atts , $ content ) { global $ id ; // This is the Post ID, [@see WP_Query::setup_postdata, ...] $ a = shortcode_atts ( [ 'id' => '' , 'type' => '' , ] , $ atts ) ; if ( ! empty ( $ content ) ) { // This is a tooltip if ( $ a [ 'id' ] ) { if ( ! isset ( $ this -> glossaryTerms [ $ id ] ) ) { $ this -> glossaryTerms [ $ id ] = [ ] ; } if ( ! isset ( $ this -> glossaryTerms [ $ id ] [ $ a [ 'id' ] ] ) ) { $ this -> glossaryTerms [ $ id ] [ $ a [ 'id' ] ] = get_post_field ( 'post_content' , $ a [ 'id' ] ) ; } return $ this -> glossaryTooltip ( $ a [ 'id' ] , $ content ) ; } } else { // This is a list of glossary terms return $ this -> glossaryTerms ( $ a [ 'type' ] ) ; } return $ content ; }
Webbook shortcode
Gets the tooltip if the param contains the post id,
or a list of terms if it's just the short-code

@since 5.5.0

@param array $atts
@param string $content

@return string
Webbook shortcode Gets the tooltip if the param contains the post id or a list of terms if it s just the short - code