From cbc0ae55d464e4cdfaa26c3ebdc90ff8497aea9d Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Thu, 10 May 2018 11:19:03 -0700 Subject: [PATCH] Soft-deprecate AMP_Base_Sanitizer::get_body_node() --- includes/sanitizers/class-amp-base-sanitizer.php | 5 ++--- readme.md | 7 ++++--- readme.txt | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/includes/sanitizers/class-amp-base-sanitizer.php b/includes/sanitizers/class-amp-base-sanitizer.php index 1f4bb08c4e9..32ce5a2d64c 100644 --- a/includes/sanitizers/class-amp-base-sanitizer.php +++ b/includes/sanitizers/class-amp-base-sanitizer.php @@ -159,11 +159,10 @@ public function get_stylesheets() { * Get HTML body as DOMElement from DOMDocument received by the constructor. * * @deprecated Just reference $root_element instead. - * @return DOMElement The body or html element. + * @return DOMElement The body element. */ protected function get_body_node() { - _deprecated_function( __METHOD__, 'AMP_Base_Sanitizer::$root_element', '0.7' ); - return $this->root_element; + return $this->dom->getElementsByTagName( 'body' )->item( 0 ); } /** diff --git a/readme.md b/readme.md index 0229b84a21d..fe52732b44e 100644 --- a/readme.md +++ b/readme.md @@ -63,10 +63,11 @@ Follow along with or [contribute](https://github.com/Automattic/amp-wp/blob/deve ## Changelog ## ### 0.7.1 (Unreleased) ### -- Limit showing AMP validation warnings to when `amp` theme support is present. See [#1132](https://github.com/Automattic/amp-wp/pull/1132). -- Supply the extracted dimensions to images determined to need them; fixes regression from 0.6 this is key for Gutenberg compat. See [#1117](https://github.com/Automattic/amp-wp/pull/1117). -- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). +- Limit showing AMP validation warnings to when `amp` theme support is present. See [#1132](https://github.com/Automattic/amp-wp/pull/1132). Props westonruter. +- Supply the extracted dimensions to images determined to need them; fixes regression from 0.6 this is key for Gutenberg compat. See [#1117](https://github.com/Automattic/amp-wp/pull/1117). Props westonruter. +- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). Props westonruter. - Force VideoPress to use html5 player for AMP. See [#1125](https://github.com/Automattic/amp-wp/pull/1125). Props yurynix. +- Soft-deprecate `AMP_Base_Sanitizer::get_body_node()` instead of hard-deprecating it (with triggered notice). See [#1141](https://github.com/Automattic/amp-wp/pull/1141). Props westonruter. See [0.7.1 milestone](https://github.com/Automattic/amp-wp/milestone/8?closed=1). diff --git a/readme.txt b/readme.txt index 5e424339403..a2b76e3d205 100644 --- a/readme.txt +++ b/readme.txt @@ -45,10 +45,11 @@ Follow along with or [contribute](https://github.com/Automattic/amp-wp/blob/deve == Changelog == = 0.7.1 (Unreleased) = -- Limit showing AMP validation warnings to when `amp` theme support is present. See [#1132](https://github.com/Automattic/amp-wp/pull/1132). -- Supply the extracted dimensions to images determined to need them; fixes regression from 0.6 this is key for Gutenberg compat. See [#1117](https://github.com/Automattic/amp-wp/pull/1117). -- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). +- Limit showing AMP validation warnings to when `amp` theme support is present. See [#1132](https://github.com/Automattic/amp-wp/pull/1132). Props westonruter. +- Supply the extracted dimensions to images determined to need them; fixes regression from 0.6 this is key for Gutenberg compat. See [#1117](https://github.com/Automattic/amp-wp/pull/1117). Props westonruter. +- Ensure before/after is amended to filtered comment_reply_link. See [#1118](https://github.com/Automattic/amp-wp/pull/1118). Props westonruter. - Force VideoPress to use html5 player for AMP. See [#1125](https://github.com/Automattic/amp-wp/pull/1125). Props yurynix. +- Soft-deprecate `AMP_Base_Sanitizer::get_body_node()` instead of hard-deprecating it (with triggered notice). See [#1141](https://github.com/Automattic/amp-wp/pull/1141). Props westonruter. See [0.7.1 milestone](https://github.com/Automattic/amp-wp/milestone/8?closed=1).