WordPress.org

Forums

Theme Check
[resolved] [Plugin: Theme-Check] function tc_add_headers() needs to filter, not replace. (4 posts)

  1. George Stephanis
    Code Monkey
    Posted 3 years ago #

    Proposed modification as follows ...

    function tc_add_headers( $extra_headers ) {
    -	$extra_headers = array( 'License', 'License URI', 'Template Version' );
    +	$extra_headers = array_merge( (array) $extra_headers, array( 'License', 'License URI', 'Template Version' ) );
    	return $extra_headers;
    }

    In short, this will actually filter the data, rather than deciding any thing already caught by a filter is irrelevant and overwriting it.

    http://wordpress.org/extend/plugins/theme-check/

  2. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 3 years ago #

    Looking at the code, I'm not sure what the point of that function is in the first place. That stuff isn't used anywhere and should probably just be removed.

  3. George Stephanis
    Code Monkey
    Posted 3 years ago #

    It was brought up in http://core.trac.wordpress.org/ticket/20897 for reference.

  4. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 3 years ago #

    Ahh, yes, I see. Makes sense.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags