Get a list of hooked functions/methods

@link http://www.wprecipes.com/list-all-hooked-wordpress-functions

@param  bool   $tag  The name of the hook.
@param  bool   $echo If true than print it.

@return string       A list of hooked functions/methods.
429189
public function get_hooked_list( $tag = false, $echo = true ) {

		global $wp_filter;

		$output = '';

		if ( $tag ) {
			$hook[ $tag ] = $wp_filter[ $tag ]->callbacks;

			if ( ! is_array( $hook[ $tag ] ) ) {
				$hook[ $tag ] = array();
				trigger_error( "Nothing found for '$tag' hook", E_USER_WARNING );
				return;
			}
		} else {
			$hook = $wp_filter;
			ksort( $hook );
		}

		$output .= '<pre>';
		foreach ( $hook as $tag => $priorities ) {
			if ( ! is_array( $priorities ) ) {
				continue;
			}
			$output .= "\n&gt;&gt;&gt;&gt;&gt;\t<strong>$tag</strong>\n";
			ksort( $priorities );

			foreach ( $priorities as $priority => $functions ) {

				$output .= $priority;
				foreach ( $functions as $name => $properties ) {
					$output .= "\t$name";

					if ( is_array( $properties['function'] ) ) {

						if ( is_object( $properties['function'][0] ) ) {
							$output .= "\t\t" . get_class( $properties['function'][0] ) . " (Object)\n";
						}

					} elseif ( is_object( $properties['function'] ) && $properties['function'] instanceof \Closure ) {

						/**
						 * @link http://stackoverflow.com/questions/38241093/how-to-get-array-from-a-closure-object-in-php
						 */
						$reflection = new \ReflectionFunction( $properties['function'] );
						$reflection->getClosureScopeClass();

						$output .= "\t\t" . get_class( $reflection->getClosureThis() ) . " (Closure)\n";
					} else {
						$output .= "\t\t (Function)\n";
					}

					$output .= "\n";
				}
			}
		}
		$output .= '</pre>';

		if ( ! $echo ) {
			return $output;
		}

		echo $output;
	}
632483
def t_OPEN_TAG(t):
    '
    if '=' in t.value: t.type = 'OPEN_TAG_WITH_ECHO'
    t.lexer.lineno += t.value.count("\n")
    t.lexer.begin('php')
    return t
853009
public function getTag($tag)
    {
        if (!isset($this->tags[ $tag ])) {
            throw new \OutOfBoundsException("Tag {$tag} does not exist.");
        }

        return $this->tags[ $tag ];
    }
1253598
public function getShortcodeCallback($tag)
    {
        return isset($this->shortcodes[$tag]) ? $this->shortcodes[$tag] : null;
    }
458389
public function show(string $tag)
    {
        $tags = Tag::latest('count')
            ->where('name', 'like', '%'.$tag.'%')
            ->limit(10)
            ->get()
            ->map(function ($item) {
                return [
                    'id'    => $item['name'],
                    'text'  => $item['name'],
                    'count' => $item['count'],
                ];
            })
            ->toArray();

        return response()->json($tags);
    }
750135
public function getReleaseByTagName(string $tag): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/tags/:tag',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $tag));
    }
292923
public function getMethodAnnotationsForMatchingTag($tag, $methodName = null) {
        if ($methodName) {
            return isset($this->methodAnnotations[$methodName][$tag]) ? $this->methodAnnotations[$methodName][$tag] : array();
        } else {
            $matchingAnnotations = array();
            foreach ($this->getMethodAnnotations() as $method => $methodAnnotations) {
                if (isset($methodAnnotations[$tag])) {
                    $matchingAnnotations[$method] = $methodAnnotations[$tag];
                }
            }

            return $matchingAnnotations;
        }
    }
523075
protected function tag_links($tag) {
        if ($links = $tag->get_links()) {
            $content = '<ul class="inline-list"><li>' . implode('</li> <li>', $links) . '</li></ul>';
            return html_writer::div($content, 'tag-management-box');
        }
        return '';
    }
231332
private function _echo() {
    $node = new EchoStatementNode();
    $this->mustMatch(T_ECHO, $node);
    $expressions = new CommaListNode();
    do {
      $expressions->addChild($this->expr());
    } while ($this->tryMatch(',', $expressions));
    $node->addChild($expressions, 'expressions');
    $this->endStatement($node);
    return $node;
  }
861902
public function taggedWith($tag)
    {
        $results = [];

        if (isset($this->tags[$tag]))
        {
            foreach ($this->tags[$tag] as $view)
            {
                $results[] = $view;
            }

        }

        return $results;
    }
1019236
public function getTagKeyword($tag)
    {
        if (!$tag instanceof Tag) {
            try {
                $tag = $this->tagsService->loadTag($tag);
            } catch (NotFoundException $e) {
                return '';
            }
        }

        return $this->translationHelper->getTranslatedByMethod($tag, 'getKeyword');
    }
1184961
public function canonicalTag(string $tag): string
    {
        $tag = strtoupper($tag);

        $tag = self::TAG_NAMES[$tag] ?? self::TAG_SYNONYMS[$tag] ?? $tag;

        return $tag;
    }
110782
public function getTagItems(string $tag): array
    {
        $tagName = $this->getTagKey($tag);
        $keys    = $this->handler->sMembers($tagName);

        return array_map(function ($key) {
            return $this->getCacheKey($key);
        }, $keys);
    }
585203
private function convertToTagDoc(TagDoc $tag)
    {
        $tagDoc = [
            'name' => $tag->getName(),
        ];
        if (null !== $tag->getDescription()) {
            $tagDoc['description'] = $tag->getDescription();
        }

        return $tagDoc;
    }
1219066
public function tell(string $string, $echo = true)
    {
        $full_string = $string . $this->eol_string;
        if ($echo) {
            echo $full_string;
            return;
        }
        return $full_string;
    }
180652
public function getCmd($tag)
    {
        return isset($this->_commands[$tag])
            ? $this->_commands[$tag]
            : null;
    }
1254235
public function getAllMethods($tags = '*'): array
    {
        $a = [];
        /** @var ReflectionMethod $m */
        foreach ($this->class->getMethods() as $m) {
            $comment = $m->getDocComment();
            $a = array_merge($a, [$m->name => $this->parse($comment, $tags)]);
        }
        return $a;
    }