Add comment to ParserOutput::setIndexPolicy()
Change-Id: I01d03aa6204a13a92bb8bc00364c822c27aa60b9
This commit is contained in:
parent
746a0751d8
commit
ace0e6fc81
1 changed files with 13 additions and 0 deletions
|
|
@ -971,6 +971,19 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
|
|||
return $oldValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the index policy of the robots meta tag.
|
||||
*
|
||||
* Note that calling this method does not guarantee
|
||||
* that {@link self::getIndexPolicy()} will return the given policy –
|
||||
* if different calls set the index policy to 'index' and 'noindex',
|
||||
* then 'noindex' always wins (T16899), even if the 'index' call happened later.
|
||||
* If this is not what you want,
|
||||
* you can reset {@link ParserOutputFlags::NO_INDEX_POLICY} with {@link self::setOutputFlag()}.
|
||||
*
|
||||
* @param string $policy 'index' or 'noindex'.
|
||||
* @return string The previous policy.
|
||||
*/
|
||||
public function setIndexPolicy( $policy ): string {
|
||||
$old = $this->getIndexPolicy();
|
||||
if ( $policy === 'noindex' ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue