if ( $doc->
load( $filename ) === false
) { return false;
} $xpath =
new DOMXPath( $doc );
$rules =
$xpath->
query( '/configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'wordpress\')] | /configuration/system.webServer/rewrite/rules/rule[starts-with(@name,\'WordPress\')]'
);
if ( $rules->length > 0
) { $child =
$rules->
item( 0
);
$parent =
$child->parentNode;
$parent->
removeChild( $child );
$doc->formatOutput = true;
saveDomDocument( $doc,
$filename );
} return true;
}/**
* Adds WordPress rewrite rule to the IIS 7+ configuration file.
*
* @since 2.8.0
*
* @param string $filename The file path to the configuration file.
* @param string $rewrite_rule The XML fragment with URL Rewrite rule.
* @return bool
*/