Last active
August 29, 2015 14:16
-
-
Save DrewAPicture/9071609686a0218f29a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filter whether to skip parsing duplicate hooks. | |
* | |
* "Duplicate hooks" are characterized in WordPress core by a preceding DocBlock comment | |
* including the phrases "This action is documented in" or "This filter is documented in". | |
* | |
* Passing a truthy value will skip the parsing of duplicate hooks. | |
* | |
* @param bool $skip Whether to skip parsing duplicate hooks. Default false. | |
*/ | |
$skip_duplicates = apply_filters( 'wp_parser_skip_duplicate_hooks', false ); | |
if ( false !== $skip_duplicates ) { | |
if ( 0 === strpos( $data['doc']['description'], 'This action is documented in' ) ) { | |
return false; | |
} | |
if ( 0 === strpos( $data['doc']['description'], 'This filter is documented in' ) ) { | |
return false; | |
} | |
if ( '' === $data['doc']['description'] && '' === $data['doc']['long_description'] ) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment