From 65c1fcc3c8cd726bd88e3b6f5725364c5812560d Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 19 Mar 2021 19:35:43 -0700 Subject: [PATCH] Regnerate docs --- docs/class/AMP_DOM_Utils.md | 20 +- docs/docs.json | 441 ++++++++++-------- docs/function/amp_add_paired_endpoint.md | 2 +- docs/function/amp_generate_script_hash.md | 2 +- docs/function/amp_has_paired_endpoint.md | 2 +- docs/function/amp_is_dev_mode.md | 2 +- docs/function/amp_remove_paired_endpoint.md | 2 +- docs/hook/amp_analytics_entries.md | 2 +- docs/hook/amp_content_embed_handlers.md | 2 +- docs/hook/amp_content_sanitizers.md | 2 +- docs/hook/amp_dev_mode_element_xpaths.md | 2 +- docs/hook/amp_dev_mode_enabled.md | 2 +- docs/hook/amp_enable_optimizer.md | 2 +- docs/hook/amp_enable_ssr.md | 2 +- docs/hook/amp_optimizer_config.md | 2 +- ...mp_parsed_css_transient_caching_allowed.md | 2 +- docs/hook/amp_post_template_metadata.md | 2 +- docs/hook/amp_print_analytics.md | 2 +- docs/hook/amp_schemaorg_metadata.md | 2 +- docs/hook/amp_site_icon_url.md | 2 +- docs/hook/amp_supportable_templates.md | 2 +- docs/hook/amp_to_amp_excluded_urls.md | 2 +- docs/hook/amp_to_amp_linking_enabled.md | 2 +- docs/hook/amp_validation_error.md | 2 +- .../amp_validation_error_default_sanitized.md | 2 +- docs/method/AMP_DOM_Utils/add_amp_action.md | 2 +- .../AMP_DOM_Utils/add_attributes_to_node.md | 2 +- docs/method/AMP_DOM_Utils/copy_attributes.md | 2 +- docs/method/AMP_DOM_Utils/create_node.md | 2 +- .../get_amp_bind_placeholder_prefix.md | 2 +- .../AMP_DOM_Utils/get_content_from_dom.md | 2 +- .../get_content_from_dom_node.md | 2 +- docs/method/AMP_DOM_Utils/get_dom.md | 8 +- .../AMP_DOM_Utils/get_dom_from_content.md | 6 +- docs/method/AMP_DOM_Utils/get_element_id.md | 4 +- .../get_node_attributes_as_assoc_array.md | 2 +- docs/method/AMP_DOM_Utils/has_class.md | 2 +- docs/method/AMP_DOM_Utils/is_node_empty.md | 2 +- .../AMP_DOM_Utils/is_valid_head_node.md | 2 +- .../method/AMP_DOM_Utils/merge_amp_actions.md | 2 +- 40 files changed, 298 insertions(+), 251 deletions(-) diff --git a/docs/class/AMP_DOM_Utils.md b/docs/class/AMP_DOM_Utils.md index 4aecce2f2f4..c7849c34a1d 100644 --- a/docs/class/AMP_DOM_Utils.md +++ b/docs/class/AMP_DOM_Utils.md @@ -23,7 +23,7 @@ Functionality to simplify working with Dom\Documents and DOMElements. * [`copy_attributes`](../method/AMP_DOM_Utils/copy_attributes.md) - Copy one or more attributes from one element to the other. ### Source -:link: [includes/utils/class-amp-dom-utils.php:18](/includes/utils/class-amp-dom-utils.php#L18-L499) +:link: [includes/utils/class-amp-dom-utils.php:20](/includes/utils/class-amp-dom-utils.php#L20-L511)
Show Code @@ -79,7 +79,14 @@ class AMP_DOM_Utils { */ public static function get_dom( $document, $encoding = null ) { _deprecated_function( __METHOD__, '1.5.0', 'AmpProject\Dom\Document::fromHtml()' ); - return Document::fromHtml( $document, $encoding ); + + $options = Options::DEFAULTS; + + if ( null !== $encoding ) { + $options[ Document\Option::ENCODING ] = $encoding; + } + + return Document::fromHtml( $document, $options ); } /** @@ -186,7 +193,10 @@ class AMP_DOM_Utils { */ $document = "{$content}"; - return Document::fromHtml( $document, $encoding ); + $options = Options::DEFAULTS; + $options[ Document\Option::ENCODING ] = $encoding; + + return Document::fromHtml( $document, $options ); } /** @@ -389,8 +399,8 @@ class AMP_DOM_Utils { * * @deprecated Use AmpProject\Dom\Document::getElementId() instead. * - * @param DOMElement $element Element to get the ID for. - * @param string $prefix Optional. Defaults to 'amp-wp-id'. + * @param DOMElement|Element $element Element to get the ID for. + * @param string $prefix Optional. Defaults to 'amp-wp-id'. * @return string ID to use. */ public static function get_element_id( $element, $prefix = 'amp-wp-id' ) { diff --git a/docs/docs.json b/docs/docs.json index 94671c16edc..59d8712764a 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1600,8 +1600,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 1279, - "end_line": 1302, + "line": 1290, + "end_line": 1313, "arguments": [], "doc": { "description": "Determine whether AMP dev mode is enabled.", @@ -1623,8 +1623,8 @@ "hooks": [ { "name": "amp_dev_mode_enabled", - "line": 1291, - "end_line": 1301, + "line": 1302, + "end_line": 1312, "type": "filter", "arguments": [ "is_admin_bar_showing() && is_user_logged_in() || is_customize_preview()" @@ -1653,23 +1653,23 @@ "functions": [ { "name": "apply_filters", - "line": 1291, - "end_line": 1301 + "line": 1302, + "end_line": 1312 }, { "name": "is_admin_bar_showing", - "line": 1297, - "end_line": 1297 + "line": 1308, + "end_line": 1308 }, { "name": "is_user_logged_in", - "line": 1297, - "end_line": 1297 + "line": 1308, + "end_line": 1308 }, { "name": "is_customize_preview", - "line": 1299, - "end_line": 1299 + "line": 1310, + "end_line": 1310 } ] } @@ -1686,8 +1686,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 1815, - "end_line": 1826, + "line": 1826, + "end_line": 1837, "arguments": [ { "name": "$script", @@ -1751,18 +1751,18 @@ "functions": [ { "name": "hash", - "line": 1816, - "end_line": 1816 + "line": 1827, + "end_line": 1827 }, { "name": "str_replace", - "line": 1820, - "end_line": 1824 + "line": 1831, + "end_line": 1835 }, { "name": "base64_encode", - "line": 1823, - "end_line": 1823 + "line": 1834, + "end_line": 1834 } ] } @@ -1779,8 +1779,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 1836, - "end_line": 1838, + "line": 1847, + "end_line": 1849, "arguments": [ { "name": "$url", @@ -1820,15 +1820,15 @@ "name": "add_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 1837, - "end_line": 1837 + "line": 1848, + "end_line": 1848 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 1837, - "end_line": 1837 + "line": 1848, + "end_line": 1848 } ] } @@ -1845,8 +1845,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 1848, - "end_line": 1850, + "line": 1859, + "end_line": 1861, "arguments": [ { "name": "$url", @@ -1886,15 +1886,15 @@ "name": "has_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 1849, - "end_line": 1849 + "line": 1860, + "end_line": 1860 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 1849, - "end_line": 1849 + "line": 1860, + "end_line": 1860 } ] } @@ -1911,8 +1911,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 1860, - "end_line": 1862, + "line": 1871, + "end_line": 1873, "arguments": [ { "name": "$url", @@ -1952,15 +1952,15 @@ "name": "remove_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 1861, - "end_line": 1861 + "line": 1872, + "end_line": 1872 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 1861, - "end_line": 1861 + "line": 1872, + "end_line": 1872 } ] } @@ -2087,8 +2087,8 @@ }, "6": { "name": "amp_analytics_entries", - "line": 1117, - "end_line": 1117, + "line": 1128, + "end_line": 1128, "type": "filter", "arguments": [ "$analytics_entries" @@ -2114,8 +2114,8 @@ }, "7": { "name": "amp_print_analytics", - "line": 1162, - "end_line": 1162, + "line": 1173, + "end_line": 1173, "type": "action", "arguments": [ "$analytics_entries" @@ -2141,8 +2141,8 @@ }, "8": { "name": "amp_content_embed_handlers", - "line": 1239, - "end_line": 1265, + "line": 1250, + "end_line": 1276, "type": "filter", "arguments": [ "array('AMP_Core_Block_Handler' => array(), 'AMP_Twitter_Embed_Handler' => array(), 'AMP_YouTube_Embed_Handler' => array(), 'AMP_Crowdsignal_Embed_Handler' => array(), 'AMP_DailyMotion_Embed_Handler' => array(), 'AMP_Vimeo_Embed_Handler' => array(), 'AMP_SoundCloud_Embed_Handler' => array(), 'AMP_Instagram_Embed_Handler' => array(), 'AMP_Issuu_Embed_Handler' => array(), 'AMP_Meetup_Embed_Handler' => array(), 'AMP_Facebook_Embed_Handler' => array(), 'AMP_Pinterest_Embed_Handler' => array(), 'AMP_Playlist_Embed_Handler' => array(), 'AMP_Reddit_Embed_Handler' => array(), 'AMP_TikTok_Embed_Handler' => array(), 'AMP_Tumblr_Embed_Handler' => array(), 'AMP_Gallery_Embed_Handler' => array(), 'AMP_Gfycat_Embed_Handler' => array(), 'AMP_Imgur_Embed_Handler' => array(), 'AMP_Scribd_Embed_Handler' => array(), 'AMP_WordPress_TV_Embed_Handler' => array())", @@ -2182,8 +2182,8 @@ }, "9": { "name": "amp_dev_mode_enabled", - "line": 1291, - "end_line": 1301, + "line": 1302, + "end_line": 1312, "type": "filter", "arguments": [ "is_admin_bar_showing() && is_user_logged_in() || is_customize_preview()" @@ -2209,8 +2209,8 @@ }, "10": { "name": "amp_to_amp_linking_enabled", - "line": 1343, - "end_line": 1346, + "line": 1354, + "end_line": 1357, "type": "filter", "arguments": [ "\\AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === \\AMP_Options_Manager::get_option(\\AmpProject\\AmpWP\\Option::THEME_SUPPORT)" @@ -2236,8 +2236,8 @@ }, "11": { "name": "amp_to_amp_excluded_urls", - "line": 1410, - "end_line": 1410, + "line": 1421, + "end_line": 1421, "type": "filter", "arguments": [ "array()" @@ -2263,8 +2263,8 @@ }, "12": { "name": "amp_content_sanitizers", - "line": 1427, - "end_line": 1427, + "line": 1438, + "end_line": 1438, "type": "filter", "arguments": [ "$sanitizers", @@ -2304,8 +2304,8 @@ }, "13": { "name": "amp_dev_mode_element_xpaths", - "line": 1440, - "end_line": 1440, + "line": 1451, + "end_line": 1451, "type": "filter", "arguments": [ "array()" @@ -2331,8 +2331,8 @@ }, "14": { "name": "amp_parsed_css_transient_caching_allowed", - "line": 1480, - "end_line": 1480, + "line": 1491, + "end_line": 1491, "type": "filter", "arguments": [ "true" @@ -2358,8 +2358,8 @@ }, "15": { "name": "amp_site_icon_url", - "line": 1608, - "end_line": 1608, + "line": 1619, + "end_line": 1619, "type": "filter", "arguments": [ "$logo_image_url" @@ -2385,8 +2385,8 @@ }, "16": { "name": "amp_post_template_metadata", - "line": 1681, - "end_line": 1681, + "line": 1692, + "end_line": 1692, "type": "filter", "arguments": [ "$metadata", @@ -2421,8 +2421,8 @@ }, "17": { "name": "amp_schemaorg_metadata", - "line": 1695, - "end_line": 1695, + "line": 1706, + "end_line": 1706, "type": "filter", "arguments": [ "$metadata" @@ -2635,8 +2635,8 @@ "hooks": { "1": { "name": "amp_supportable_templates", - "line": 788, - "end_line": 788, + "line": 789, + "end_line": 789, "type": "filter", "arguments": [ "$templates" @@ -2662,8 +2662,8 @@ }, "9": { "name": "amp_enable_optimizer", - "line": 1988, - "end_line": 1988, + "line": 1989, + "end_line": 1989, "type": "filter", "arguments": [ "$enable_optimizer" @@ -2689,8 +2689,8 @@ }, "13": { "name": "amp_enable_ssr", - "line": 2107, - "end_line": 2107, + "line": 2108, + "end_line": 2108, "type": "filter", "arguments": [ "$enable_ssr" @@ -2716,8 +2716,8 @@ }, "14": { "name": "amp_optimizer_config", - "line": 2133, - "end_line": 2144, + "line": 2132, + "end_line": 2143, "type": "filter", "arguments": [ "array_merge(array(\\AmpProject\\Optimizer\\Configuration::KEY_TRANSFORMERS => $transformers, \\AmpProject\\Optimizer\\Transformer\\PreloadHeroImage::class => array(\\AmpProject\\Optimizer\\Configuration\\PreloadHeroImageConfiguration::INLINE_STYLE_BACKUP_ATTRIBUTE => 'data-amp-original-style')), $args)" @@ -6186,8 +6186,8 @@ { "name": "AMP_DOM_Utils", "namespace": "global", - "line": 18, - "end_line": 499, + "line": 20, + "end_line": 511, "final": false, "abstract": false, "extends": "", @@ -6198,11 +6198,13 @@ "name": "get_dom", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 66, - "end_line": 69, + "line": 68, + "end_line": 78, "final": false, "abstract": false, "static": true, @@ -6271,8 +6273,8 @@ "functions": [ { "name": "_deprecated_function", - "line": 67, - "end_line": 67, + "line": 69, + "end_line": 69, "deprecation_version": "1.5.0" } ], @@ -6281,8 +6283,8 @@ "name": "fromHtml", "class": "\\AmpProject\\Dom\\Document", "static": true, - "line": 68, - "end_line": 68 + "line": 77, + "end_line": 77 } ] } @@ -6291,11 +6293,13 @@ "name": "is_valid_head_node", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 82, - "end_line": 85, + "line": 91, + "end_line": 94, "final": false, "abstract": false, "static": true, @@ -6351,8 +6355,8 @@ "functions": [ { "name": "_deprecated_function", - "line": 83, - "end_line": 83, + "line": 92, + "end_line": 92, "deprecation_version": "1.5.0" } ], @@ -6361,15 +6365,15 @@ "name": "isValidHeadNode", "class": "\\AmpProject\\Dom\\Document::fromNode($node)", "static": false, - "line": 84, - "end_line": 84 + "line": 93, + "end_line": 93 }, { "name": "fromNode", "class": "\\AmpProject\\Dom\\Document", "static": true, - "line": 84, - "end_line": 84 + "line": 93, + "end_line": 93 } ] } @@ -6378,11 +6382,13 @@ "name": "get_amp_bind_placeholder_prefix", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 102, - "end_line": 105, + "line": 111, + "end_line": 114, "final": false, "abstract": false, "static": true, @@ -6433,8 +6439,8 @@ "functions": [ { "name": "_deprecated_function", - "line": 103, - "end_line": 103, + "line": 112, + "end_line": 112, "deprecation_version": "1.2.1" } ] @@ -6444,11 +6450,13 @@ "name": "get_dom_from_content", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 162, - "end_line": 176, + "line": 171, + "end_line": 188, "final": false, "abstract": false, "static": true, @@ -6508,8 +6516,8 @@ "functions": [ { "name": "get_bloginfo", - "line": 165, - "end_line": 165 + "line": 174, + "end_line": 174 } ], "methods": [ @@ -6517,8 +6525,8 @@ "name": "fromHtml", "class": "\\AmpProject\\Dom\\Document", "static": true, - "line": 175, - "end_line": 175 + "line": 187, + "end_line": 187 } ] } @@ -6527,11 +6535,13 @@ "name": "get_content_from_dom", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 187, - "end_line": 193, + "line": 199, + "end_line": 205, "final": false, "abstract": false, "static": true, @@ -6577,8 +6587,8 @@ "functions": [ { "name": "preg_replace", - "line": 188, - "end_line": 192 + "line": 200, + "end_line": 204 } ], "methods": [ @@ -6586,8 +6596,8 @@ "name": "saveHTML", "class": "$dom", "static": false, - "line": 191, - "end_line": 191 + "line": 203, + "end_line": 203 } ] } @@ -6596,11 +6606,13 @@ "name": "get_content_from_dom_node", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 208, - "end_line": 211, + "line": 220, + "end_line": 223, "final": false, "abstract": false, "static": true, @@ -6673,8 +6685,8 @@ "functions": [ { "name": "_deprecated_function", - "line": 209, - "end_line": 209, + "line": 221, + "end_line": 221, "deprecation_version": "1.5.0" } ], @@ -6683,8 +6695,8 @@ "name": "saveHTML", "class": "$dom", "static": false, - "line": 210, - "end_line": 210 + "line": 222, + "end_line": 222 } ] } @@ -6693,11 +6705,13 @@ "name": "create_node", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 224, - "end_line": 229, + "line": 236, + "end_line": 241, "final": false, "abstract": false, "static": true, @@ -6767,15 +6781,15 @@ "name": "createElement", "class": "$dom", "static": false, - "line": 225, - "end_line": 225 + "line": 237, + "end_line": 237 }, { "name": "add_attributes_to_node", "class": "\\AMP_DOM_Utils", "static": true, - "line": 226, - "end_line": 226 + "line": 238, + "end_line": 238 } ] } @@ -6784,11 +6798,13 @@ "name": "get_node_attributes_as_assoc_array", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 241, - "end_line": 252, + "line": 253, + "end_line": 264, "final": false, "abstract": false, "static": true, @@ -6831,8 +6847,8 @@ "name": "hasAttributes", "class": "$node", "static": false, - "line": 243, - "end_line": 243 + "line": 255, + "end_line": 255 } ] } @@ -6841,11 +6857,13 @@ "name": "add_attributes_to_node", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 262, - "end_line": 275, + "line": 274, + "end_line": 287, "final": false, "abstract": false, "static": true, @@ -6894,8 +6912,8 @@ "name": "setAttribute", "class": "$node", "static": false, - "line": 265, - "end_line": 265 + "line": 277, + "end_line": 277 } ] } @@ -6904,11 +6922,13 @@ "name": "is_node_empty", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 287, - "end_line": 289, + "line": 299, + "end_line": 301, "final": false, "abstract": false, "static": true, @@ -6951,8 +6971,8 @@ "name": "hasChildNodes", "class": "$node", "static": false, - "line": 288, - "end_line": 288 + "line": 300, + "end_line": 300 } ] } @@ -6961,11 +6981,13 @@ "name": "has_class", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 358, - "end_line": 366, + "line": 370, + "end_line": 378, "final": false, "abstract": false, "static": true, @@ -7021,27 +7043,27 @@ "name": "hasAttribute", "class": "$element", "static": false, - "line": 359, - "end_line": 359 + "line": 371, + "end_line": 371 }, { "name": "getAttribute", "class": "$element", "static": false, - "line": 363, - "end_line": 363 + "line": 375, + "end_line": 375 } ], "functions": [ { "name": "in_array", - "line": 365, - "end_line": 365 + "line": 377, + "end_line": 377 }, { "name": "preg_split", - "line": 365, - "end_line": 365 + "line": 377, + "end_line": 377 } ] } @@ -7050,11 +7072,13 @@ "name": "get_element_id", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 382, - "end_line": 390, + "line": 394, + "end_line": 402, "final": false, "abstract": false, "static": true, @@ -7093,7 +7117,8 @@ "name": "param", "content": "Element to get the ID for.", "types": [ - "\\DOMElement" + "\\DOMElement", + "\\AmpProject\\Dom\\Element" ], "variable": "$element" }, @@ -7118,8 +7143,8 @@ "functions": [ { "name": "_deprecated_function", - "line": 383, - "end_line": 387, + "line": 395, + "end_line": 399, "deprecation_version": "1.5.1" } ], @@ -7128,15 +7153,15 @@ "name": "getElementId", "class": "\\AmpProject\\Dom\\Document::fromNode($element)", "static": false, - "line": 389, - "end_line": 389 + "line": 401, + "end_line": 401 }, { "name": "fromNode", "class": "\\AmpProject\\Dom\\Document", "static": true, - "line": 389, - "end_line": 389 + "line": 401, + "end_line": 401 } ] } @@ -7145,11 +7170,13 @@ "name": "add_amp_action", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 404, - "end_line": 420, + "line": 416, + "end_line": 432, "final": false, "abstract": false, "static": true, @@ -7211,36 +7238,36 @@ "name": "hasAttribute", "class": "$element", "static": false, - "line": 407, - "end_line": 407 + "line": 419, + "end_line": 419 }, { "name": "setAttribute", "class": "$element", "static": false, - "line": 409, - "end_line": 409 + "line": 421, + "end_line": 421 }, { "name": "setAttribute", "class": "$element", "static": false, - "line": 413, - "end_line": 419 + "line": 425, + "end_line": 431 }, { "name": "merge_amp_actions", "class": "\\AMP_DOM_Utils", "static": true, - "line": 415, - "end_line": 418 + "line": 427, + "end_line": 430 }, { "name": "getAttribute", "class": "$element", "static": false, - "line": 416, - "end_line": 416 + "line": 428, + "end_line": 428 } ] } @@ -7249,11 +7276,13 @@ "name": "merge_amp_actions", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 431, - "end_line": 469, + "line": 443, + "end_line": 481, "final": false, "abstract": false, "static": true, @@ -7307,43 +7336,43 @@ "functions": [ { "name": "preg_match_all", - "line": 435, - "end_line": 435 + "line": 447, + "end_line": 447 }, { "name": "array_walk", - "line": 449, - "end_line": 462 + "line": 461, + "end_line": 474 }, { "name": "preg_match_all", - "line": 453, - "end_line": 453 + "line": 465, + "end_line": 465 }, { "name": "array_merge", - "line": 460, - "end_line": 460 + "line": 472, + "end_line": 472 }, { "name": "implode", - "line": 464, - "end_line": 464 + "line": 476, + "end_line": 476 }, { "name": "array_unique", - "line": 464, - "end_line": 464 + "line": 476, + "end_line": 476 }, { "name": "array_filter", - "line": 464, - "end_line": 464 + "line": 476, + "end_line": 476 }, { "name": "implode", - "line": 468, - "end_line": 468 + "line": 480, + "end_line": 480 } ] } @@ -7352,11 +7381,13 @@ "name": "copy_attributes", "namespace": "", "aliases": { + "Options": "\\AmpProject\\AmpWP\\Dom\\Options", "Document": "\\AmpProject\\Dom\\Document", + "Element": "\\AmpProject\\Dom\\Element", "Tag": "\\AmpProject\\Tag" }, - "line": 479, - "end_line": 498, + "line": 491, + "end_line": 510, "final": false, "abstract": false, "static": true, @@ -7428,57 +7459,57 @@ "name": "hasAttribute", "class": "$from", "static": false, - "line": 481, - "end_line": 481 + "line": 493, + "end_line": 493 }, { "name": "getAttribute", "class": "$from", "static": false, - "line": 482, - "end_line": 482 + "line": 494, + "end_line": 494 }, { "name": "hasAttribute", "class": "$to", "static": false, - "line": 483, - "end_line": 483 + "line": 495, + "end_line": 495 }, { "name": "merge_amp_actions", "class": "\\AMP_DOM_Utils", "static": true, - "line": 486, - "end_line": 486 + "line": 498, + "end_line": 498 }, { "name": "getAttribute", "class": "$to", "static": false, - "line": 486, - "end_line": 486 + "line": 498, + "end_line": 498 }, { "name": "getAttribute", "class": "$to", "static": false, - "line": 489, - "end_line": 489 + "line": 501, + "end_line": 501 }, { "name": "getAttribute", "class": "$to", "static": false, - "line": 492, - "end_line": 492 + "line": 504, + "end_line": 504 }, { "name": "setAttribute", "class": "$to", "static": false, - "line": 495, - "end_line": 495 + "line": 507, + "end_line": 507 } ] } @@ -7770,7 +7801,7 @@ "includes": [ { "name": "", - "line": 2318, + "line": 2160, "type": "Require" } ], @@ -7778,8 +7809,8 @@ "hooks": [ { "name": "amp_validation_error_default_sanitized", - "line": 297, - "end_line": 297, + "line": 296, + "end_line": 296, "type": "filter", "arguments": [ "$accepted", @@ -7820,8 +7851,8 @@ }, { "name": "amp_validation_error", - "line": 706, - "end_line": 706, + "line": 636, + "end_line": 636, "type": "filter", "arguments": [ "$error", @@ -8106,7 +8137,7 @@ } ] }, - "161": { + "162": { "file": { "description": "Class MobileRedirection.", "long_description": "", @@ -8258,7 +8289,7 @@ } } }, - "165": { + "166": { "file": { "description": "Class PairedRouting.", "long_description": "", @@ -8298,7 +8329,7 @@ } ] }, - "166": { + "167": { "file": { "description": "Class PairedUrl.", "long_description": "", @@ -8765,7 +8796,7 @@ ], "hooks": [] }, - "167": { + "168": { "file": { "description": "Class LegacyReaderUrlStructure.", "long_description": "", @@ -8864,7 +8895,7 @@ } ] }, - "171": { + "172": { "file": { "description": "Abstract class PairedUrlStructure.", "long_description": "", @@ -9091,7 +9122,7 @@ ], "hooks": [] }, - "185": { + "186": { "file": { "description": "Provides settings to be used in site scanning.", "long_description": "", @@ -9139,7 +9170,7 @@ } ] }, - "186": { + "187": { "file": { "description": "WP cron process to validate URLs in the background.", "long_description": "", diff --git a/docs/function/amp_add_paired_endpoint.md b/docs/function/amp_add_paired_endpoint.md index ae202f26fdc..680d9334e95 100644 --- a/docs/function/amp_add_paired_endpoint.md +++ b/docs/function/amp_add_paired_endpoint.md @@ -16,7 +16,7 @@ Turn a given URL into a paired AMP URL. ### Source -:link: [includes/amp-helper-functions.php:1836](/includes/amp-helper-functions.php#L1836-L1838) +:link: [includes/amp-helper-functions.php:1847](/includes/amp-helper-functions.php#L1847-L1849)
Show Code diff --git a/docs/function/amp_generate_script_hash.md b/docs/function/amp_generate_script_hash.md index 22a0d9d876e..3ae5c3af3fb 100644 --- a/docs/function/amp_generate_script_hash.md +++ b/docs/function/amp_generate_script_hash.md @@ -18,7 +18,7 @@ The sha384 hash used by amp-script is represented not as hexadecimal but as base ### Source -:link: [includes/amp-helper-functions.php:1815](/includes/amp-helper-functions.php#L1815-L1826) +:link: [includes/amp-helper-functions.php:1826](/includes/amp-helper-functions.php#L1826-L1837)
Show Code diff --git a/docs/function/amp_has_paired_endpoint.md b/docs/function/amp_has_paired_endpoint.md index fbf4f392357..16976dd5fe2 100644 --- a/docs/function/amp_has_paired_endpoint.md +++ b/docs/function/amp_has_paired_endpoint.md @@ -16,7 +16,7 @@ Determine a given URL is for a paired AMP request. ### Source -:link: [includes/amp-helper-functions.php:1848](/includes/amp-helper-functions.php#L1848-L1850) +:link: [includes/amp-helper-functions.php:1859](/includes/amp-helper-functions.php#L1859-L1861)
Show Code diff --git a/docs/function/amp_is_dev_mode.md b/docs/function/amp_is_dev_mode.md index 43583bf3cc0..27ac67dd803 100644 --- a/docs/function/amp_is_dev_mode.md +++ b/docs/function/amp_is_dev_mode.md @@ -14,7 +14,7 @@ When enabled, the `` element will get the data-ampdevmode attribute and th ### Source -:link: [includes/amp-helper-functions.php:1279](/includes/amp-helper-functions.php#L1279-L1302) +:link: [includes/amp-helper-functions.php:1290](/includes/amp-helper-functions.php#L1290-L1313)
Show Code diff --git a/docs/function/amp_remove_paired_endpoint.md b/docs/function/amp_remove_paired_endpoint.md index 691bdb33887..b64a14adbc6 100644 --- a/docs/function/amp_remove_paired_endpoint.md +++ b/docs/function/amp_remove_paired_endpoint.md @@ -16,7 +16,7 @@ Remove the paired AMP endpoint from a given URL. ### Source -:link: [includes/amp-helper-functions.php:1860](/includes/amp-helper-functions.php#L1860-L1862) +:link: [includes/amp-helper-functions.php:1871](/includes/amp-helper-functions.php#L1871-L1873)
Show Code diff --git a/docs/hook/amp_analytics_entries.md b/docs/hook/amp_analytics_entries.md index f96ab06375d..99663d47a3a 100644 --- a/docs/hook/amp_analytics_entries.md +++ b/docs/hook/amp_analytics_entries.md @@ -14,7 +14,7 @@ This filter allows you to easily insert any amp-analytics tags without needing m ### Source -:link: [includes/amp-helper-functions.php:1117](/includes/amp-helper-functions.php#L1117) +:link: [includes/amp-helper-functions.php:1128](/includes/amp-helper-functions.php#L1128)
Show Code diff --git a/docs/hook/amp_content_embed_handlers.md b/docs/hook/amp_content_embed_handlers.md index 2c7a0dc1da1..4effab862ba 100644 --- a/docs/hook/amp_content_embed_handlers.md +++ b/docs/hook/amp_content_embed_handlers.md @@ -13,7 +13,7 @@ Filters the content embed handlers. ### Source -:link: [includes/amp-helper-functions.php:1239](/includes/amp-helper-functions.php#L1239-L1265) +:link: [includes/amp-helper-functions.php:1250](/includes/amp-helper-functions.php#L1250-L1276)
Show Code diff --git a/docs/hook/amp_content_sanitizers.md b/docs/hook/amp_content_sanitizers.md index f48f36bcda9..ca80d7a9104 100644 --- a/docs/hook/amp_content_sanitizers.md +++ b/docs/hook/amp_content_sanitizers.md @@ -13,7 +13,7 @@ Filters the content sanitizers. ### Source -:link: [includes/amp-helper-functions.php:1427](/includes/amp-helper-functions.php#L1427) +:link: [includes/amp-helper-functions.php:1438](/includes/amp-helper-functions.php#L1438)
Show Code diff --git a/docs/hook/amp_dev_mode_element_xpaths.md b/docs/hook/amp_dev_mode_element_xpaths.md index dfee3c41a9c..c4249e76d65 100644 --- a/docs/hook/amp_dev_mode_element_xpaths.md +++ b/docs/hook/amp_dev_mode_element_xpaths.md @@ -14,7 +14,7 @@ By supplying XPath queries to this filter, the data-ampdevmode attribute will au ### Source -:link: [includes/amp-helper-functions.php:1440](/includes/amp-helper-functions.php#L1440) +:link: [includes/amp-helper-functions.php:1451](/includes/amp-helper-functions.php#L1451)
Show Code diff --git a/docs/hook/amp_dev_mode_enabled.md b/docs/hook/amp_dev_mode_enabled.md index 3be4afc8159..7adb9c34ca5 100644 --- a/docs/hook/amp_dev_mode_enabled.md +++ b/docs/hook/amp_dev_mode_enabled.md @@ -14,7 +14,7 @@ When enabled, the data-ampdevmode attribute will be added to the document elemen ### Source -:link: [includes/amp-helper-functions.php:1291](/includes/amp-helper-functions.php#L1291-L1301) +:link: [includes/amp-helper-functions.php:1302](/includes/amp-helper-functions.php#L1302-L1312)
Show Code diff --git a/docs/hook/amp_enable_optimizer.md b/docs/hook/amp_enable_optimizer.md index b3a9ba0d61f..2b4f24dbd9a 100644 --- a/docs/hook/amp_enable_optimizer.md +++ b/docs/hook/amp_enable_optimizer.md @@ -12,7 +12,7 @@ Filter whether the generated HTML output should be run through the AMP Optimizer ### Source -:link: [includes/class-amp-theme-support.php:1988](/includes/class-amp-theme-support.php#L1988) +:link: [includes/class-amp-theme-support.php:1989](/includes/class-amp-theme-support.php#L1989)
Show Code diff --git a/docs/hook/amp_enable_ssr.md b/docs/hook/amp_enable_ssr.md index 17625b9aca2..1b12e628544 100644 --- a/docs/hook/amp_enable_ssr.md +++ b/docs/hook/amp_enable_ssr.md @@ -12,7 +12,7 @@ Filter whether the AMP Optimizer should use server-side rendering or not. ### Source -:link: [includes/class-amp-theme-support.php:2107](/includes/class-amp-theme-support.php#L2107) +:link: [includes/class-amp-theme-support.php:2108](/includes/class-amp-theme-support.php#L2108)
Show Code diff --git a/docs/hook/amp_optimizer_config.md b/docs/hook/amp_optimizer_config.md index b202c236f11..fdd4c6c4319 100644 --- a/docs/hook/amp_optimizer_config.md +++ b/docs/hook/amp_optimizer_config.md @@ -12,7 +12,7 @@ Filter the configuration to be used for the AMP Optimizer. ### Source -:link: [includes/class-amp-theme-support.php:2133](/includes/class-amp-theme-support.php#L2133-L2144) +:link: [includes/class-amp-theme-support.php:2132](/includes/class-amp-theme-support.php#L2132-L2143)
Show Code diff --git a/docs/hook/amp_parsed_css_transient_caching_allowed.md b/docs/hook/amp_parsed_css_transient_caching_allowed.md index 9de820a73df..a67ca0474c3 100644 --- a/docs/hook/amp_parsed_css_transient_caching_allowed.md +++ b/docs/hook/amp_parsed_css_transient_caching_allowed.md @@ -14,7 +14,7 @@ When this is filtered to be false, parsed CSS will not be stored in transients. ### Source -:link: [includes/amp-helper-functions.php:1480](/includes/amp-helper-functions.php#L1480) +:link: [includes/amp-helper-functions.php:1491](/includes/amp-helper-functions.php#L1491)
Show Code diff --git a/docs/hook/amp_post_template_metadata.md b/docs/hook/amp_post_template_metadata.md index cd083487211..932c26121ab 100644 --- a/docs/hook/amp_post_template_metadata.md +++ b/docs/hook/amp_post_template_metadata.md @@ -15,7 +15,7 @@ The 'post_template' in the filter name here is due to this filter orig ### Source -:link: [includes/amp-helper-functions.php:1681](/includes/amp-helper-functions.php#L1681) +:link: [includes/amp-helper-functions.php:1692](/includes/amp-helper-functions.php#L1692)
Show Code diff --git a/docs/hook/amp_print_analytics.md b/docs/hook/amp_print_analytics.md index 1bbfc5da7eb..d861462eb91 100644 --- a/docs/hook/amp_print_analytics.md +++ b/docs/hook/amp_print_analytics.md @@ -14,7 +14,7 @@ This is useful for printing additional `amp-analytics` tags to the page without ### Source -:link: [includes/amp-helper-functions.php:1162](/includes/amp-helper-functions.php#L1162) +:link: [includes/amp-helper-functions.php:1173](/includes/amp-helper-functions.php#L1173)
Show Code diff --git a/docs/hook/amp_schemaorg_metadata.md b/docs/hook/amp_schemaorg_metadata.md index b877da20324..c46730e5e4f 100644 --- a/docs/hook/amp_schemaorg_metadata.md +++ b/docs/hook/amp_schemaorg_metadata.md @@ -14,7 +14,7 @@ Check the the main query for the context for which metadata should be added. ### Source -:link: [includes/amp-helper-functions.php:1695](/includes/amp-helper-functions.php#L1695) +:link: [includes/amp-helper-functions.php:1706](/includes/amp-helper-functions.php#L1706)
Show Code diff --git a/docs/hook/amp_site_icon_url.md b/docs/hook/amp_site_icon_url.md index 790f08d441a..888eee9f8cf 100644 --- a/docs/hook/amp_site_icon_url.md +++ b/docs/hook/amp_site_icon_url.md @@ -14,7 +14,7 @@ Previously, this only filtered the Site Icon, as that was the only possible sche ### Source -:link: [includes/amp-helper-functions.php:1608](/includes/amp-helper-functions.php#L1608) +:link: [includes/amp-helper-functions.php:1619](/includes/amp-helper-functions.php#L1619)
Show Code diff --git a/docs/hook/amp_supportable_templates.md b/docs/hook/amp_supportable_templates.md index 3b6d529cbc9..c5d01e3458b 100644 --- a/docs/hook/amp_supportable_templates.md +++ b/docs/hook/amp_supportable_templates.md @@ -14,7 +14,7 @@ Each array item should have a key that corresponds to a template conditional fun ### Source -:link: [includes/class-amp-theme-support.php:788](/includes/class-amp-theme-support.php#L788) +:link: [includes/class-amp-theme-support.php:789](/includes/class-amp-theme-support.php#L789)
Show Code diff --git a/docs/hook/amp_to_amp_excluded_urls.md b/docs/hook/amp_to_amp_excluded_urls.md index 37c62aecb63..b37d19d8fcf 100644 --- a/docs/hook/amp_to_amp_excluded_urls.md +++ b/docs/hook/amp_to_amp_excluded_urls.md @@ -14,7 +14,7 @@ This only applies when the amp_to_amp_linking_enabled filter returns true, which ### Source -:link: [includes/amp-helper-functions.php:1410](/includes/amp-helper-functions.php#L1410) +:link: [includes/amp-helper-functions.php:1421](/includes/amp-helper-functions.php#L1421)
Show Code diff --git a/docs/hook/amp_to_amp_linking_enabled.md b/docs/hook/amp_to_amp_linking_enabled.md index fb06aeea367..17c89c31675 100644 --- a/docs/hook/amp_to_amp_linking_enabled.md +++ b/docs/hook/amp_to_amp_linking_enabled.md @@ -12,7 +12,7 @@ Filters whether AMP-to-AMP linking should be enabled. ### Source -:link: [includes/amp-helper-functions.php:1343](/includes/amp-helper-functions.php#L1343-L1346) +:link: [includes/amp-helper-functions.php:1354](/includes/amp-helper-functions.php#L1354-L1357)
Show Code diff --git a/docs/hook/amp_validation_error.md b/docs/hook/amp_validation_error.md index ddbefdced8c..bf81342061c 100644 --- a/docs/hook/amp_validation_error.md +++ b/docs/hook/amp_validation_error.md @@ -15,7 +15,7 @@ This allows plugins to add amend additional properties which can help with more ### Source -:link: [includes/validation/class-amp-validation-manager.php:706](/includes/validation/class-amp-validation-manager.php#L706) +:link: [includes/validation/class-amp-validation-manager.php:636](/includes/validation/class-amp-validation-manager.php#L636)
Show Code diff --git a/docs/hook/amp_validation_error_default_sanitized.md b/docs/hook/amp_validation_error_default_sanitized.md index 6ce0e4da317..edb6e641faf 100644 --- a/docs/hook/amp_validation_error_default_sanitized.md +++ b/docs/hook/amp_validation_error_default_sanitized.md @@ -15,7 +15,7 @@ This only applies to validation errors that have not been encountered before. To ### Source -:link: [includes/validation/class-amp-validation-manager.php:297](/includes/validation/class-amp-validation-manager.php#L297) +:link: [includes/validation/class-amp-validation-manager.php:296](/includes/validation/class-amp-validation-manager.php#L296)
Show Code diff --git a/docs/method/AMP_DOM_Utils/add_amp_action.md b/docs/method/AMP_DOM_Utils/add_amp_action.md index e19950765cb..ea391c950bd 100644 --- a/docs/method/AMP_DOM_Utils/add_amp_action.md +++ b/docs/method/AMP_DOM_Utils/add_amp_action.md @@ -16,7 +16,7 @@ If the element already contains one or more events or actions, the method will a ### Source -:link: [includes/utils/class-amp-dom-utils.php:404](/includes/utils/class-amp-dom-utils.php#L404-L420) +:link: [includes/utils/class-amp-dom-utils.php:416](/includes/utils/class-amp-dom-utils.php#L416-L432)
Show Code diff --git a/docs/method/AMP_DOM_Utils/add_attributes_to_node.md b/docs/method/AMP_DOM_Utils/add_attributes_to_node.md index dc53eee4948..b2516344917 100644 --- a/docs/method/AMP_DOM_Utils/add_attributes_to_node.md +++ b/docs/method/AMP_DOM_Utils/add_attributes_to_node.md @@ -13,7 +13,7 @@ Add one or more HTML element attributes to a node's DOMElement. ### Source -:link: [includes/utils/class-amp-dom-utils.php:262](/includes/utils/class-amp-dom-utils.php#L262-L275) +:link: [includes/utils/class-amp-dom-utils.php:274](/includes/utils/class-amp-dom-utils.php#L274-L287)
Show Code diff --git a/docs/method/AMP_DOM_Utils/copy_attributes.md b/docs/method/AMP_DOM_Utils/copy_attributes.md index bc061ffdecb..1e0b87e934e 100644 --- a/docs/method/AMP_DOM_Utils/copy_attributes.md +++ b/docs/method/AMP_DOM_Utils/copy_attributes.md @@ -15,7 +15,7 @@ Copy one or more attributes from one element to the other. ### Source -:link: [includes/utils/class-amp-dom-utils.php:479](/includes/utils/class-amp-dom-utils.php#L479-L498) +:link: [includes/utils/class-amp-dom-utils.php:491](/includes/utils/class-amp-dom-utils.php#L491-L510)
Show Code diff --git a/docs/method/AMP_DOM_Utils/create_node.md b/docs/method/AMP_DOM_Utils/create_node.md index f2aca3e8980..7609295c491 100644 --- a/docs/method/AMP_DOM_Utils/create_node.md +++ b/docs/method/AMP_DOM_Utils/create_node.md @@ -18,7 +18,7 @@ Create a new node w/attributes (a DOMElement) and add to the passed Dom\Document ### Source -:link: [includes/utils/class-amp-dom-utils.php:224](/includes/utils/class-amp-dom-utils.php#L224-L229) +:link: [includes/utils/class-amp-dom-utils.php:236](/includes/utils/class-amp-dom-utils.php#L236-L241)
Show Code diff --git a/docs/method/AMP_DOM_Utils/get_amp_bind_placeholder_prefix.md b/docs/method/AMP_DOM_Utils/get_amp_bind_placeholder_prefix.md index 06392180b8a..971c167f7b0 100644 --- a/docs/method/AMP_DOM_Utils/get_amp_bind_placeholder_prefix.md +++ b/docs/method/AMP_DOM_Utils/get_amp_bind_placeholder_prefix.md @@ -16,7 +16,7 @@ This contains a random string to prevent HTML content containing this data- attr ### Source -:link: [includes/utils/class-amp-dom-utils.php:102](/includes/utils/class-amp-dom-utils.php#L102-L105) +:link: [includes/utils/class-amp-dom-utils.php:111](/includes/utils/class-amp-dom-utils.php#L111-L114)
Show Code diff --git a/docs/method/AMP_DOM_Utils/get_content_from_dom.md b/docs/method/AMP_DOM_Utils/get_content_from_dom.md index e969884f03d..1e3a4f1274b 100644 --- a/docs/method/AMP_DOM_Utils/get_content_from_dom.md +++ b/docs/method/AMP_DOM_Utils/get_content_from_dom.md @@ -16,7 +16,7 @@ Return valid HTML *body* content extracted from the Dom\Document passed as a par ### Source -:link: [includes/utils/class-amp-dom-utils.php:187](/includes/utils/class-amp-dom-utils.php#L187-L193) +:link: [includes/utils/class-amp-dom-utils.php:199](/includes/utils/class-amp-dom-utils.php#L199-L205)
Show Code diff --git a/docs/method/AMP_DOM_Utils/get_content_from_dom_node.md b/docs/method/AMP_DOM_Utils/get_content_from_dom_node.md index bb5466181a8..beb0a0ae894 100644 --- a/docs/method/AMP_DOM_Utils/get_content_from_dom_node.md +++ b/docs/method/AMP_DOM_Utils/get_content_from_dom_node.md @@ -19,7 +19,7 @@ Return valid HTML content extracted from the DOMNode passed as a parameter. ### Source -:link: [includes/utils/class-amp-dom-utils.php:208](/includes/utils/class-amp-dom-utils.php#L208-L211) +:link: [includes/utils/class-amp-dom-utils.php:220](/includes/utils/class-amp-dom-utils.php#L220-L223)
Show Code diff --git a/docs/method/AMP_DOM_Utils/get_dom.md b/docs/method/AMP_DOM_Utils/get_dom.md index c64b25e95c6..fa44c1c84aa 100644 --- a/docs/method/AMP_DOM_Utils/get_dom.md +++ b/docs/method/AMP_DOM_Utils/get_dom.md @@ -19,7 +19,7 @@ Return a valid Dom\Document representing HTML document passed as a parameter. ### Source -:link: [includes/utils/class-amp-dom-utils.php:66](/includes/utils/class-amp-dom-utils.php#L66-L69) +:link: [includes/utils/class-amp-dom-utils.php:68](/includes/utils/class-amp-dom-utils.php#L68-L78)
Show Code @@ -27,7 +27,11 @@ Return a valid Dom\Document representing HTML document passed as a parameter. ```php public static function get_dom( $document, $encoding = null ) { _deprecated_function( __METHOD__, '1.5.0', 'AmpProject\Dom\Document::fromHtml()' ); - return Document::fromHtml( $document, $encoding ); + $options = Options::DEFAULTS; + if ( null !== $encoding ) { + $options[ Document\Option::ENCODING ] = $encoding; + } + return Document::fromHtml( $document, $options ); } ``` diff --git a/docs/method/AMP_DOM_Utils/get_dom_from_content.md b/docs/method/AMP_DOM_Utils/get_dom_from_content.md index f1515cb5d8c..7abd80a3528 100644 --- a/docs/method/AMP_DOM_Utils/get_dom_from_content.md +++ b/docs/method/AMP_DOM_Utils/get_dom_from_content.md @@ -17,7 +17,7 @@ Return a valid Dom\Document representing arbitrary HTML content passed as a para ### Source -:link: [includes/utils/class-amp-dom-utils.php:162](/includes/utils/class-amp-dom-utils.php#L162-L176) +:link: [includes/utils/class-amp-dom-utils.php:171](/includes/utils/class-amp-dom-utils.php#L171-L188)
Show Code @@ -34,7 +34,9 @@ public static function get_dom_from_content( $content, $encoding = null ) { * We can later use this to extract our nodes. */ $document = "{$content}"; - return Document::fromHtml( $document, $encoding ); + $options = Options::DEFAULTS; + $options[ Document\Option::ENCODING ] = $encoding; + return Document::fromHtml( $document, $options ); } ``` diff --git a/docs/method/AMP_DOM_Utils/get_element_id.md b/docs/method/AMP_DOM_Utils/get_element_id.md index fae9899a42c..b1dfe9b9c61 100644 --- a/docs/method/AMP_DOM_Utils/get_element_id.md +++ b/docs/method/AMP_DOM_Utils/get_element_id.md @@ -12,7 +12,7 @@ If the element does not have an ID, create one first. ### Arguments -* `\DOMElement $element` - Element to get the ID for. +* `\DOMElement|\AmpProject\Dom\Element $element` - Element to get the ID for. * `string $prefix` - Optional. Defaults to 'amp-wp-id'. ### Return value @@ -21,7 +21,7 @@ If the element does not have an ID, create one first. ### Source -:link: [includes/utils/class-amp-dom-utils.php:382](/includes/utils/class-amp-dom-utils.php#L382-L390) +:link: [includes/utils/class-amp-dom-utils.php:394](/includes/utils/class-amp-dom-utils.php#L394-L402)
Show Code diff --git a/docs/method/AMP_DOM_Utils/get_node_attributes_as_assoc_array.md b/docs/method/AMP_DOM_Utils/get_node_attributes_as_assoc_array.md index 72cbede3d93..89b2e91d22b 100644 --- a/docs/method/AMP_DOM_Utils/get_node_attributes_as_assoc_array.md +++ b/docs/method/AMP_DOM_Utils/get_node_attributes_as_assoc_array.md @@ -16,7 +16,7 @@ Extract a DOMElement node's HTML element attributes and return as an array. ### Source -:link: [includes/utils/class-amp-dom-utils.php:241](/includes/utils/class-amp-dom-utils.php#L241-L252) +:link: [includes/utils/class-amp-dom-utils.php:253](/includes/utils/class-amp-dom-utils.php#L253-L264)
Show Code diff --git a/docs/method/AMP_DOM_Utils/has_class.md b/docs/method/AMP_DOM_Utils/has_class.md index 4c6bbc7beb1..d6bff12de1c 100644 --- a/docs/method/AMP_DOM_Utils/has_class.md +++ b/docs/method/AMP_DOM_Utils/has_class.md @@ -17,7 +17,7 @@ Check whether a given element has a specific class. ### Source -:link: [includes/utils/class-amp-dom-utils.php:358](/includes/utils/class-amp-dom-utils.php#L358-L366) +:link: [includes/utils/class-amp-dom-utils.php:370](/includes/utils/class-amp-dom-utils.php#L370-L378)
Show Code diff --git a/docs/method/AMP_DOM_Utils/is_node_empty.md b/docs/method/AMP_DOM_Utils/is_node_empty.md index 5214975eb45..5e6cf693759 100644 --- a/docs/method/AMP_DOM_Utils/is_node_empty.md +++ b/docs/method/AMP_DOM_Utils/is_node_empty.md @@ -18,7 +18,7 @@ Determines if a DOMElement's node is empty or not. ### Source -:link: [includes/utils/class-amp-dom-utils.php:287](/includes/utils/class-amp-dom-utils.php#L287-L289) +:link: [includes/utils/class-amp-dom-utils.php:299](/includes/utils/class-amp-dom-utils.php#L299-L301)
Show Code diff --git a/docs/method/AMP_DOM_Utils/is_valid_head_node.md b/docs/method/AMP_DOM_Utils/is_valid_head_node.md index 80a69b98978..e6830026da7 100644 --- a/docs/method/AMP_DOM_Utils/is_valid_head_node.md +++ b/docs/method/AMP_DOM_Utils/is_valid_head_node.md @@ -18,7 +18,7 @@ Determine whether a node can be in the head. ### Source -:link: [includes/utils/class-amp-dom-utils.php:82](/includes/utils/class-amp-dom-utils.php#L82-L85) +:link: [includes/utils/class-amp-dom-utils.php:91](/includes/utils/class-amp-dom-utils.php#L91-L94)
Show Code diff --git a/docs/method/AMP_DOM_Utils/merge_amp_actions.md b/docs/method/AMP_DOM_Utils/merge_amp_actions.md index d987a68054e..e54396479ef 100644 --- a/docs/method/AMP_DOM_Utils/merge_amp_actions.md +++ b/docs/method/AMP_DOM_Utils/merge_amp_actions.md @@ -17,7 +17,7 @@ Merge two sets of AMP events & actions. ### Source -:link: [includes/utils/class-amp-dom-utils.php:431](/includes/utils/class-amp-dom-utils.php#L431-L469) +:link: [includes/utils/class-amp-dom-utils.php:443](/includes/utils/class-amp-dom-utils.php#L443-L481)
Show Code