function tooltipContent( $content ) {

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

		if ( ! empty( $this->glossaryTerms ) && isset( $this->glossaryTerms[ $id ] ) ) {
			$glossary_terms = $this->glossaryTerms[ $id ];
		} else {
			return $content;
		}

		$content .= '<div class="glossary">';

		foreach ( $glossary_terms as $glossary_term_id => $glossary_term ) {
			$identifier = "$id-$glossary_term_id";
			$content .= '<div class="glossary__tooltip" id="' . $identifier . '" hidden>' . wpautop( $glossary_term ) . '</div>';
		}

		$content .= '</div>';

		return $content;
	}
function tooltipContent( $content ) {

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

		if ( ! empty( $this->glossaryTerms ) && isset( $this->glossaryTerms[ $id ] ) ) {
			$glossary_terms = $this->glossaryTerms[ $id ];
		} else {
			return $content;
		}

		$content .= '<div class="glossary">';

		foreach ( $glossary_terms as $glossary_term_id => $glossary_term ) {
			$identifier = "$id-$glossary_term_id";
			$content .= '<div class="glossary__tooltip" id="' . $identifier . '" hidden>' . wpautop( $glossary_term ) . '</div>';
		}

		$content .= '</div>';

		return $content;
	}
function tooltipContent ( $ content ) { global $ id ; // This is the Post ID, [@see WP_Query::setup_postdata, ...] if ( ! empty ( $ this -> glossaryTerms ) && isset ( $ this -> glossaryTerms [ $ id ] ) ) { $ glossary_terms = $ this -> glossaryTerms [ $ id ] ; } else { return $ content ; } $ content .= '<div class="glossary">' ; foreach ( $ glossary_terms as $ glossary_term_id => $ glossary_term ) { $ identifier = "$id-$glossary_term_id" ; $ content .= '<div class="glossary__tooltip" id="' . $ identifier . '" hidden>' . wpautop ( $ glossary_term ) . '</div>' ; } $ content .= '</div>' ; return $ content ; }
Post-process glossary shortcode, creating content for tooltips

@param $content

@return string
Post - process glossary shortcode creating content for tooltips