From 4e54b03dce6f360845bfde5dbd19f85cccab7287 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 14 Jun 2022 12:31:47 -0700 Subject: [PATCH] Regenerate docs --- docs/class/AMP_Base_Sanitizer.md | 4 +- docs/docs.json | 341 +++++++++--------- docs/function/amp_add_paired_endpoint.md | 2 +- docs/function/amp_generate_script_hash.md | 8 +- docs/function/amp_has_paired_endpoint.md | 2 +- docs/function/amp_is_native_img_used.md | 6 +- docs/function/amp_remove_paired_endpoint.md | 2 +- docs/hook/amp_auto_lightbox_disabled.md | 2 +- docs/hook/amp_comment_posted_message.md | 2 +- docs/hook/amp_content_sanitizers.md | 2 +- ...css_transient_monitoring_sampling_range.md | 2 +- .../amp_css_transient_monitoring_threshold.md | 2 +- docs/hook/amp_dev_mode_element_xpaths.md | 2 +- docs/hook/amp_native_img_used.md | 4 +- ...page_cache_good_response_time_threshold.md | 2 +- ...mp_parsed_css_transient_caching_allowed.md | 2 +- docs/hook/amp_post_template_metadata.md | 2 +- docs/hook/amp_schemaorg_metadata.md | 2 +- docs/hook/amp_site_icon_url.md | 2 +- docs/hook/amp_skip_post.md | 2 +- docs/hook/amp_to_amp_excluded_urls.md | 2 +- .../amp_to_amp_linking_element_excluded.md | 2 +- docs/hook/amp_to_amp_linking_enabled.md | 2 +- docs/hook/amp_validation_error.md | 2 +- .../prepare_validation_error.md | 2 +- .../AMP_Base_Sanitizer/sanitize_dimension.md | 2 +- 26 files changed, 210 insertions(+), 195 deletions(-) diff --git a/docs/class/AMP_Base_Sanitizer.md b/docs/class/AMP_Base_Sanitizer.md index 120a38a0ebb..a3ba3f36d8f 100644 --- a/docs/class/AMP_Base_Sanitizer.md +++ b/docs/class/AMP_Base_Sanitizer.md @@ -322,7 +322,7 @@ abstract class AMP_Base_Sanitizer { public function sanitize_dimension( $value, $dimension ) { // Allows 0 to be used as valid dimension. - if ( null === $value ) { + if ( empty( $value ) && '0' !== (string) $value ) { return ''; } @@ -755,7 +755,7 @@ abstract class AMP_Base_Sanitizer { ], $text_content ); - } elseif ( $is_inline_style ) { + } else { // Include stylesheet text except for amp-custom and amp-keyframes since it is large and since it should // already be detailed in the stylesheets metabox. $error['text'] = $text_content; diff --git a/docs/docs.json b/docs/docs.json index ed482fb6f69..27939de5015 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -11,7 +11,7 @@ ] }, "path": "back-compat\/back-compat.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "functions": [ { "name": "amp_backcompat_use_v03_templates", @@ -76,7 +76,7 @@ ] }, "path": "includes\/admin\/class-amp-post-meta-box.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -164,7 +164,7 @@ ] }, "path": "includes\/admin\/class-amp-template-customizer.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -333,7 +333,7 @@ ] }, "path": "includes\/admin\/functions.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "functions": [], "hooks": [ { @@ -386,7 +386,7 @@ ] }, "path": "includes\/amp-frontend-actions.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "uses": { "functions": [ { @@ -472,7 +472,7 @@ ] }, "path": "includes\/amp-helper-functions.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "constants": [ { "name": "AMP_QUERY_VAR", @@ -1781,7 +1781,7 @@ "Services": "\\AmpProject\\AmpWP\\Services" }, "line": 1460, - "end_line": 1473, + "end_line": 1475, "arguments": [], "doc": { "description": "Determine whether native `img` should be used instead of converting to `amp-img`.", @@ -1803,11 +1803,11 @@ "hooks": [ { "name": "amp_native_img_used", - "line": 1472, - "end_line": 1472, + "line": 1474, + "end_line": 1474, "type": "filter", "arguments": [ - "true" + "$use_native_img_tag" ], "doc": { "description": "Filters whether to use the native `img` element rather than convert to `amp-img`.", @@ -1835,11 +1835,20 @@ } ], "uses": { + "methods": [ + { + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 1461, + "end_line": 1461 + } + ], "functions": [ { "name": "apply_filters", - "line": 1472, - "end_line": 1472 + "line": 1474, + "end_line": 1474 } ] } @@ -1857,8 +1866,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 2070, - "end_line": 2081, + "line": 2076, + "end_line": 2091, "arguments": [ { "name": "$script", @@ -1922,18 +1931,18 @@ "functions": [ { "name": "hash", - "line": 2071, - "end_line": 2071 + "line": 2078, + "end_line": 2078 }, { "name": "str_replace", - "line": 2075, - "end_line": 2079 + "line": 2085, + "end_line": 2089 }, { "name": "base64_encode", - "line": 2078, - "end_line": 2078 + "line": 2088, + "end_line": 2088 } ] } @@ -1951,8 +1960,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 2091, - "end_line": 2103, + "line": 2101, + "end_line": 2113, "arguments": [ { "name": "$url", @@ -1992,54 +2001,54 @@ "name": "add_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 2093, - "end_line": 2093 + "line": 2103, + "end_line": 2103 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 2093, - "end_line": 2093 + "line": 2103, + "end_line": 2103 }, { "name": "getMessage", "class": "$e", "static": false, - "line": 2100, - "end_line": 2100 + "line": 2110, + "end_line": 2110 } ], "functions": [ { "name": "amp_is_enabled", - "line": 2095, - "end_line": 2095 + "line": 2105, + "end_line": 2105 }, { "name": "__", - "line": 2096, - "end_line": 2096 + "line": 2106, + "end_line": 2106 }, { "name": "__", - "line": 2098, - "end_line": 2098 + "line": 2108, + "end_line": 2108 }, { "name": "_doing_it_wrong", - "line": 2100, - "end_line": 2100 + "line": 2110, + "end_line": 2110 }, { "name": "esc_html", - "line": 2100, - "end_line": 2100 + "line": 2110, + "end_line": 2110 }, { "name": "esc_html", - "line": 2100, - "end_line": 2100 + "line": 2110, + "end_line": 2110 } ] } @@ -2057,8 +2066,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 2113, - "end_line": 2125, + "line": 2123, + "end_line": 2135, "arguments": [ { "name": "$url", @@ -2098,54 +2107,54 @@ "name": "has_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 2115, - "end_line": 2115 + "line": 2125, + "end_line": 2125 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 2115, - "end_line": 2115 + "line": 2125, + "end_line": 2125 }, { "name": "getMessage", "class": "$e", "static": false, - "line": 2122, - "end_line": 2122 + "line": 2132, + "end_line": 2132 } ], "functions": [ { "name": "amp_is_enabled", - "line": 2117, - "end_line": 2117 + "line": 2127, + "end_line": 2127 }, { "name": "__", - "line": 2118, - "end_line": 2118 + "line": 2128, + "end_line": 2128 }, { "name": "__", - "line": 2120, - "end_line": 2120 + "line": 2130, + "end_line": 2130 }, { "name": "_doing_it_wrong", - "line": 2122, - "end_line": 2122 + "line": 2132, + "end_line": 2132 }, { "name": "esc_html", - "line": 2122, - "end_line": 2122 + "line": 2132, + "end_line": 2132 }, { "name": "esc_html", - "line": 2122, - "end_line": 2122 + "line": 2132, + "end_line": 2132 } ] } @@ -2163,8 +2172,8 @@ "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 2135, - "end_line": 2147, + "line": 2145, + "end_line": 2157, "arguments": [ { "name": "$url", @@ -2204,54 +2213,54 @@ "name": "remove_endpoint", "class": "\\AmpProject\\AmpWP\\Services::get('paired_routing')", "static": false, - "line": 2137, - "end_line": 2137 + "line": 2147, + "end_line": 2147 }, { "name": "get", "class": "\\AmpProject\\AmpWP\\Services", "static": true, - "line": 2137, - "end_line": 2137 + "line": 2147, + "end_line": 2147 }, { "name": "getMessage", "class": "$e", "static": false, - "line": 2144, - "end_line": 2144 + "line": 2154, + "end_line": 2154 } ], "functions": [ { "name": "amp_is_enabled", - "line": 2139, - "end_line": 2139 + "line": 2149, + "end_line": 2149 }, { "name": "__", - "line": 2140, - "end_line": 2140 + "line": 2150, + "end_line": 2150 }, { "name": "__", - "line": 2142, - "end_line": 2142 + "line": 2152, + "end_line": 2152 }, { "name": "_doing_it_wrong", - "line": 2144, - "end_line": 2144 + "line": 2154, + "end_line": 2154 }, { "name": "esc_html", - "line": 2144, - "end_line": 2144 + "line": 2154, + "end_line": 2154 }, { "name": "esc_html", - "line": 2144, - "end_line": 2144 + "line": 2154, + "end_line": 2154 } ] } @@ -2540,11 +2549,11 @@ }, "11": { "name": "amp_native_img_used", - "line": 1472, - "end_line": 1472, + "line": 1474, + "end_line": 1474, "type": "filter", "arguments": [ - "true" + "$use_native_img_tag" ], "doc": { "description": "Filters whether to use the native `img` element rather than convert to `amp-img`.", @@ -2572,8 +2581,8 @@ }, "12": { "name": "amp_to_amp_linking_enabled", - "line": 1514, - "end_line": 1517, + "line": 1516, + "end_line": 1519, "type": "filter", "arguments": [ "\\AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === \\AMP_Options_Manager::get_option(\\AmpProject\\AmpWP\\Option::THEME_SUPPORT)" @@ -2599,8 +2608,8 @@ }, "13": { "name": "amp_to_amp_excluded_urls", - "line": 1604, - "end_line": 1604, + "line": 1609, + "end_line": 1609, "type": "filter", "arguments": [ "array()" @@ -2626,8 +2635,8 @@ }, "14": { "name": "amp_auto_lightbox_disabled", - "line": 1622, - "end_line": 1622, + "line": 1627, + "end_line": 1627, "type": "filter", "arguments": [ "true" @@ -2658,8 +2667,8 @@ }, "15": { "name": "amp_content_sanitizers", - "line": 1637, - "end_line": 1637, + "line": 1642, + "end_line": 1642, "type": "filter", "arguments": [ "$sanitizers", @@ -2699,8 +2708,8 @@ }, "16": { "name": "amp_dev_mode_element_xpaths", - "line": 1650, - "end_line": 1650, + "line": 1655, + "end_line": 1655, "type": "filter", "arguments": [ "array()" @@ -2726,8 +2735,8 @@ }, "17": { "name": "amp_parsed_css_transient_caching_allowed", - "line": 1703, - "end_line": 1703, + "line": 1708, + "end_line": 1708, "type": "filter", "arguments": [ "true" @@ -2753,8 +2762,8 @@ }, "18": { "name": "amp_site_icon_url", - "line": 1852, - "end_line": 1852, + "line": 1858, + "end_line": 1858, "type": "filter", "arguments": [ "$logo_image_url" @@ -2780,8 +2789,8 @@ }, "19": { "name": "amp_post_template_metadata", - "line": 1933, - "end_line": 1933, + "line": 1939, + "end_line": 1939, "type": "filter", "arguments": [ "$metadata", @@ -2816,8 +2825,8 @@ }, "20": { "name": "amp_schemaorg_metadata", - "line": 1947, - "end_line": 1947, + "line": 1953, + "end_line": 1953, "type": "filter", "arguments": [ "$metadata" @@ -2855,7 +2864,7 @@ ] }, "path": "includes\/amp-post-template-functions.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "functions": [], "hooks": [ { @@ -2912,13 +2921,13 @@ ] }, "path": "includes\/class-amp-http.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { "name": "amp_comment_posted_message", - "line": 493, - "end_line": 493, + "line": 502, + "end_line": 502, "type": "filter", "arguments": [ "$message", @@ -2953,7 +2962,7 @@ ] }, "path": "includes\/class-amp-post-type-support.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -3078,7 +3087,7 @@ ] }, "path": "includes\/class-amp-theme-support.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": { "1": { @@ -3149,7 +3158,7 @@ ] }, "path": "includes\/deprecated.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -3630,7 +3639,7 @@ ] }, "path": "includes\/embeds\/class-amp-base-embed-handler.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "AMP_Base_Embed_Handler", @@ -4411,7 +4420,7 @@ ] }, "path": "includes\/embeds\/class-amp-wordpress-embed-handler.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "AMP_WordPress_Embed_Handler", @@ -4668,7 +4677,7 @@ ] }, "path": "includes\/sanitizers\/class-amp-base-sanitizer.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "AMP_Base_Sanitizer", @@ -6964,13 +6973,13 @@ ] }, "path": "includes\/sanitizers\/class-amp-link-sanitizer.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { "name": "amp_to_amp_linking_element_excluded", - "line": 216, - "end_line": 216, + "line": 221, + "end_line": 221, "type": "filter", "arguments": [ "$excluded", @@ -7019,7 +7028,7 @@ } ] }, - "85": { + "86": { "file": { "description": "Class AMP_Customizer_Design_Settings", "long_description": "", @@ -7031,7 +7040,7 @@ ] }, "path": "includes\/settings\/class-amp-customizer-design-settings.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -7075,7 +7084,7 @@ } ] }, - "86": { + "87": { "file": { "description": "Class AMP_Customizer_Settings", "long_description": "", @@ -7087,7 +7096,7 @@ ] }, "path": "includes\/settings\/class-amp-customizer-settings.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -7119,7 +7128,7 @@ } ] }, - "91": { + "92": { "file": { "description": "AMP_Post_Template class.", "long_description": "", @@ -7131,7 +7140,7 @@ ] }, "path": "includes\/templates\/class-amp-post-template.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -7333,7 +7342,7 @@ } } }, - "94": { + "95": { "file": { "description": "Class AMP_DOM_Utils.", "long_description": "", @@ -7345,7 +7354,7 @@ ] }, "path": "includes\/utils\/class-amp-dom-utils.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "AMP_DOM_Utils", @@ -8625,7 +8634,7 @@ ], "hooks": [] }, - "96": { + "97": { "file": { "description": "Class AMP_Image_Dimension_Extractor", "long_description": "", @@ -8637,7 +8646,7 @@ ] }, "path": "includes\/utils\/class-amp-image-dimension-extractor.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -8745,7 +8754,7 @@ } ] }, - "100": { + "101": { "file": { "description": "Class AMP_Validation_Error_Taxonomy", "long_description": "", @@ -8757,7 +8766,7 @@ ] }, "path": "includes\/validation\/class-amp-validation-error-taxonomy.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -8881,7 +8890,7 @@ } ] }, - "101": { + "102": { "file": { "description": "Class AMP_Validation_Manager", "long_description": "", @@ -8893,11 +8902,11 @@ ] }, "path": "includes\/validation\/class-amp-validation-manager.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", - "line": 2613, + "line": 2615, "type": "Require" } ], @@ -8947,8 +8956,8 @@ }, { "name": "amp_validation_error", - "line": 827, - "end_line": 827, + "line": 829, + "end_line": 829, "type": "filter", "arguments": [ "$error", @@ -8983,7 +8992,7 @@ } ] }, - "107": { + "108": { "file": { "description": "Add new tab (AMP) in theme install screen in WordPress admin.", "long_description": "", @@ -8995,7 +9004,7 @@ ] }, "path": "src\/Admin\/AmpThemes.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -9048,7 +9057,7 @@ } ] }, - "112": { + "113": { "file": { "description": "Class OptionsMenu", "long_description": "", @@ -9060,7 +9069,7 @@ ] }, "path": "src\/Admin\/OptionsMenu.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -9109,7 +9118,7 @@ } ] }, - "118": { + "119": { "file": { "description": "Fetches and formats data for AMP reader themes.", "long_description": "", @@ -9125,7 +9134,7 @@ ] }, "path": "src\/Admin\/ReaderThemes.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "includes": [ { "name": "", @@ -9134,17 +9143,17 @@ }, { "name": "", - "line": 388, + "line": 389, "type": "Require Once" }, { "name": "", - "line": 392, + "line": 393, "type": "Require Once" }, { "name": "", - "line": 396, + "line": 397, "type": "Require Once" } ], @@ -9175,7 +9184,7 @@ } ] }, - "120": { + "121": { "file": { "description": "Class SiteHealth.", "long_description": "", @@ -9187,13 +9196,13 @@ ] }, "path": "src\/Admin\/SiteHealth.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { "name": "amp_page_cache_good_response_time_threshold", - "line": 347, - "end_line": 347, + "line": 352, + "end_line": 352, "type": "filter", "arguments": [ "600" @@ -9219,7 +9228,7 @@ } ] }, - "130": { + "131": { "file": { "description": "Class MonitorCssTransientCaching.", "long_description": "", @@ -9231,13 +9240,13 @@ ] }, "path": "src\/BackgroundTask\/MonitorCssTransientCaching.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { "name": "amp_css_transient_monitoring_threshold", - "line": 351, - "end_line": 351, + "line": 352, + "end_line": 352, "type": "filter", "arguments": [ "self::DEFAULT_THRESHOLD" @@ -9263,8 +9272,8 @@ }, { "name": "amp_css_transient_monitoring_sampling_range", - "line": 372, - "end_line": 372, + "line": 373, + "end_line": 373, "type": "filter", "arguments": [ "self::DEFAULT_SAMPLING_RANGE" @@ -9290,7 +9299,7 @@ } ] }, - "134": { + "135": { "file": { "description": "Class ValidationDataGarbageCollection.", "long_description": "", @@ -9302,7 +9311,7 @@ ] }, "path": "src\/BackgroundTask\/ValidationDataGarbageCollection.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -9389,7 +9398,7 @@ } ] }, - "151": { + "152": { "file": { "description": "Class UserAccess.", "long_description": "", @@ -9405,7 +9414,7 @@ ] }, "path": "src\/DevTools\/UserAccess.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -9446,7 +9455,7 @@ } ] }, - "187": { + "188": { "file": { "description": "Class MobileRedirection.", "long_description": "", @@ -9458,7 +9467,7 @@ ] }, "path": "src\/MobileRedirection.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": { "0": { @@ -9598,7 +9607,7 @@ } } }, - "189": { + "190": { "file": { "description": "Class AmpWPConfiguration.", "long_description": "", @@ -9610,7 +9619,7 @@ ] }, "path": "src\/Optimizer\/AmpWPConfiguration.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -9669,7 +9678,7 @@ } ] }, - "197": { + "198": { "file": { "description": "Class PairedRouting.", "long_description": "", @@ -9681,7 +9690,7 @@ ] }, "path": "src\/PairedRouting.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -9709,7 +9718,7 @@ } ] }, - "198": { + "199": { "file": { "description": "Class PairedUrl.", "long_description": "", @@ -9721,7 +9730,7 @@ ] }, "path": "src\/PairedUrl.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "PairedUrl", @@ -10181,7 +10190,7 @@ ], "hooks": [] }, - "199": { + "200": { "file": { "description": "Class LegacyReaderUrlStructure.", "long_description": "", @@ -10193,7 +10202,7 @@ ] }, "path": "src\/PairedUrlStructure\/LegacyReaderUrlStructure.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [], "hooks": [ { @@ -10280,7 +10289,7 @@ } ] }, - "203": { + "204": { "file": { "description": "Abstract class PairedUrlStructure.", "long_description": "", @@ -10292,7 +10301,7 @@ ] }, "path": "src\/PairedUrlStructure.php", - "root": "\/app\/public\/content\/plugins\/amp", + "root": "\/var\/www\/html\/wp-content\/plugins\/amp", "classes": [ { "name": "PairedUrlStructure", diff --git a/docs/function/amp_add_paired_endpoint.md b/docs/function/amp_add_paired_endpoint.md index 85903187134..3b105bc4d33 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:2091](/includes/amp-helper-functions.php#L2091-L2103) +:link: [includes/amp-helper-functions.php:2101](/includes/amp-helper-functions.php#L2101-L2113)
Show Code diff --git a/docs/function/amp_generate_script_hash.md b/docs/function/amp_generate_script_hash.md index d3c12db801f..44a7b25f1ff 100644 --- a/docs/function/amp_generate_script_hash.md +++ b/docs/function/amp_generate_script_hash.md @@ -18,14 +18,18 @@ The sha384 hash used by amp-script is represented not as hexadecimal but as base ### Source -:link: [includes/amp-helper-functions.php:2070](/includes/amp-helper-functions.php#L2070-L2081) +:link: [includes/amp-helper-functions.php:2076](/includes/amp-helper-functions.php#L2076-L2091)
Show Code ```php function amp_generate_script_hash( $script ) { - $sha384 = hash( 'sha384', $script, true ); + try { + $sha384 = hash( 'sha384', $script, true ); + } catch ( ValueError $e ) { + $sha384 = false; + } if ( false === $sha384 ) { return null; } diff --git a/docs/function/amp_has_paired_endpoint.md b/docs/function/amp_has_paired_endpoint.md index 3dcb1705291..42e01f940a5 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:2113](/includes/amp-helper-functions.php#L2113-L2125) +:link: [includes/amp-helper-functions.php:2123](/includes/amp-helper-functions.php#L2123-L2135)
Show Code diff --git a/docs/function/amp_is_native_img_used.md b/docs/function/amp_is_native_img_used.md index e91de7273b2..dd50a3b8254 100644 --- a/docs/function/amp_is_native_img_used.md +++ b/docs/function/amp_is_native_img_used.md @@ -12,13 +12,15 @@ Determine whether native `img` should be used instead of converting to `amp-img` ### Source -:link: [includes/amp-helper-functions.php:1460](/includes/amp-helper-functions.php#L1460-L1473) +:link: [includes/amp-helper-functions.php:1460](/includes/amp-helper-functions.php#L1460-L1475)
Show Code ```php function amp_is_native_img_used() { + $use_native_img_tag = AMP_Options_Manager::get_option( Option::USE_NATIVE_IMG_TAG ); + /** * Filters whether to use the native `img` element rather than convert to `amp-img`. * @@ -30,7 +32,7 @@ function amp_is_native_img_used() { * * @param bool $use_native Whether to use `img`. */ - return (bool) apply_filters( 'amp_native_img_used', true ); + return (bool) apply_filters( 'amp_native_img_used', $use_native_img_tag ); } ``` diff --git a/docs/function/amp_remove_paired_endpoint.md b/docs/function/amp_remove_paired_endpoint.md index 417722290e3..910a9056fc3 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:2135](/includes/amp-helper-functions.php#L2135-L2147) +:link: [includes/amp-helper-functions.php:2145](/includes/amp-helper-functions.php#L2145-L2157)
Show Code diff --git a/docs/hook/amp_auto_lightbox_disabled.md b/docs/hook/amp_auto_lightbox_disabled.md index 4900ced2ed7..56ad4bcd003 100644 --- a/docs/hook/amp_auto_lightbox_disabled.md +++ b/docs/hook/amp_auto_lightbox_disabled.md @@ -14,7 +14,7 @@ When disabled, the data-amp-auto-lightbox-disable attribute is added to the body ### Source -:link: [includes/amp-helper-functions.php:1622](/includes/amp-helper-functions.php#L1622) +:link: [includes/amp-helper-functions.php:1627](/includes/amp-helper-functions.php#L1627)
Show Code diff --git a/docs/hook/amp_comment_posted_message.md b/docs/hook/amp_comment_posted_message.md index 8d659ed1299..b5efcbf5a32 100644 --- a/docs/hook/amp_comment_posted_message.md +++ b/docs/hook/amp_comment_posted_message.md @@ -8,7 +8,7 @@ Filters the message when comment submitted success message when ### Source -:link: [includes/class-amp-http.php:493](/includes/class-amp-http.php#L493) +:link: [includes/class-amp-http.php:502](/includes/class-amp-http.php#L502)
Show Code diff --git a/docs/hook/amp_content_sanitizers.md b/docs/hook/amp_content_sanitizers.md index 96c53a6a9aa..065f7fa5157 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:1637](/includes/amp-helper-functions.php#L1637) +:link: [includes/amp-helper-functions.php:1642](/includes/amp-helper-functions.php#L1642)
Show Code diff --git a/docs/hook/amp_css_transient_monitoring_sampling_range.md b/docs/hook/amp_css_transient_monitoring_sampling_range.md index de15f0d720e..3a5f1cd67d7 100644 --- a/docs/hook/amp_css_transient_monitoring_sampling_range.md +++ b/docs/hook/amp_css_transient_monitoring_sampling_range.md @@ -12,7 +12,7 @@ Filters the sampling range to use for monitoring the transient caching of styles ### Source -:link: [src/BackgroundTask/MonitorCssTransientCaching.php:372](/src/BackgroundTask/MonitorCssTransientCaching.php#L372) +:link: [src/BackgroundTask/MonitorCssTransientCaching.php:373](/src/BackgroundTask/MonitorCssTransientCaching.php#L373)
Show Code diff --git a/docs/hook/amp_css_transient_monitoring_threshold.md b/docs/hook/amp_css_transient_monitoring_threshold.md index 6b87a004ac0..4d1d24834e9 100644 --- a/docs/hook/amp_css_transient_monitoring_threshold.md +++ b/docs/hook/amp_css_transient_monitoring_threshold.md @@ -12,7 +12,7 @@ Filters the threshold to use for disabling transient caching of stylesheets. ### Source -:link: [src/BackgroundTask/MonitorCssTransientCaching.php:351](/src/BackgroundTask/MonitorCssTransientCaching.php#L351) +:link: [src/BackgroundTask/MonitorCssTransientCaching.php:352](/src/BackgroundTask/MonitorCssTransientCaching.php#L352)
Show Code diff --git a/docs/hook/amp_dev_mode_element_xpaths.md b/docs/hook/amp_dev_mode_element_xpaths.md index 85794304daa..9c41ea02a28 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:1650](/includes/amp-helper-functions.php#L1650) +:link: [includes/amp-helper-functions.php:1655](/includes/amp-helper-functions.php#L1655)
Show Code diff --git a/docs/hook/amp_native_img_used.md b/docs/hook/amp_native_img_used.md index 03abf90f253..62b50602973 100644 --- a/docs/hook/amp_native_img_used.md +++ b/docs/hook/amp_native_img_used.md @@ -14,13 +14,13 @@ This filter is a feature flag to opt-in to discontinue using `amp-img` (and `amp ### Source -:link: [includes/amp-helper-functions.php:1472](/includes/amp-helper-functions.php#L1472) +:link: [includes/amp-helper-functions.php:1474](/includes/amp-helper-functions.php#L1474)
Show Code ```php -return (bool) apply_filters( 'amp_native_img_used', true ); +return (bool) apply_filters( 'amp_native_img_used', $use_native_img_tag ); ```
diff --git a/docs/hook/amp_page_cache_good_response_time_threshold.md b/docs/hook/amp_page_cache_good_response_time_threshold.md index b93fcefa4d6..5f5c25172c8 100644 --- a/docs/hook/amp_page_cache_good_response_time_threshold.md +++ b/docs/hook/amp_page_cache_good_response_time_threshold.md @@ -12,7 +12,7 @@ Filters the threshold below which a response time is considered good. ### Source -:link: [src/Admin/SiteHealth.php:347](/src/Admin/SiteHealth.php#L347) +:link: [src/Admin/SiteHealth.php:352](/src/Admin/SiteHealth.php#L352)
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 bbd44be44b8..88d1f2fe776 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:1703](/includes/amp-helper-functions.php#L1703) +:link: [includes/amp-helper-functions.php:1708](/includes/amp-helper-functions.php#L1708)
Show Code diff --git a/docs/hook/amp_post_template_metadata.md b/docs/hook/amp_post_template_metadata.md index bb680f233f2..f88906940c8 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:1933](/includes/amp-helper-functions.php#L1933) +:link: [includes/amp-helper-functions.php:1939](/includes/amp-helper-functions.php#L1939)
Show Code diff --git a/docs/hook/amp_schemaorg_metadata.md b/docs/hook/amp_schemaorg_metadata.md index cacb9b78a0e..c8d7f3177b8 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:1947](/includes/amp-helper-functions.php#L1947) +:link: [includes/amp-helper-functions.php:1953](/includes/amp-helper-functions.php#L1953)
Show Code diff --git a/docs/hook/amp_site_icon_url.md b/docs/hook/amp_site_icon_url.md index 49ec5d8974f..4e13b792a38 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:1852](/includes/amp-helper-functions.php#L1852) +:link: [includes/amp-helper-functions.php:1858](/includes/amp-helper-functions.php#L1858)
Show Code diff --git a/docs/hook/amp_skip_post.md b/docs/hook/amp_skip_post.md index 46e2543bea9..7e869067b06 100644 --- a/docs/hook/amp_skip_post.md +++ b/docs/hook/amp_skip_post.md @@ -20,7 +20,7 @@ Filters whether to skip the post from AMP. Show Code ```php -if ( isset( $post->ID ) && true === apply_filters( 'amp_skip_post', false, $post->ID, $post ) ) { +if ( ! empty( $post->ID ) && true === apply_filters( 'amp_skip_post', false, $post->ID, $post ) ) { ```
diff --git a/docs/hook/amp_to_amp_excluded_urls.md b/docs/hook/amp_to_amp_excluded_urls.md index effbe2a6c22..74095940c4b 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:1604](/includes/amp-helper-functions.php#L1604) +:link: [includes/amp-helper-functions.php:1609](/includes/amp-helper-functions.php#L1609)
Show Code diff --git a/docs/hook/amp_to_amp_linking_element_excluded.md b/docs/hook/amp_to_amp_linking_element_excluded.md index f36dae4d389..4149c13f98f 100644 --- a/docs/hook/amp_to_amp_linking_element_excluded.md +++ b/docs/hook/amp_to_amp_linking_element_excluded.md @@ -17,7 +17,7 @@ The element may be either a link (`a` or `area`) or a `form`. ### Source -:link: [includes/sanitizers/class-amp-link-sanitizer.php:216](/includes/sanitizers/class-amp-link-sanitizer.php#L216) +:link: [includes/sanitizers/class-amp-link-sanitizer.php:221](/includes/sanitizers/class-amp-link-sanitizer.php#L221)
Show Code diff --git a/docs/hook/amp_to_amp_linking_enabled.md b/docs/hook/amp_to_amp_linking_enabled.md index d58fa6dd22a..86d52fa4070 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:1514](/includes/amp-helper-functions.php#L1514-L1517) +:link: [includes/amp-helper-functions.php:1516](/includes/amp-helper-functions.php#L1516-L1519)
Show Code diff --git a/docs/hook/amp_validation_error.md b/docs/hook/amp_validation_error.md index 4509fac19aa..6aa43d2a8ba 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:827](/includes/validation/class-amp-validation-manager.php#L827) +:link: [includes/validation/class-amp-validation-manager.php:829](/includes/validation/class-amp-validation-manager.php#L829)
Show Code diff --git a/docs/method/AMP_Base_Sanitizer/prepare_validation_error.md b/docs/method/AMP_Base_Sanitizer/prepare_validation_error.md index 16d78c71716..c9537b15208 100644 --- a/docs/method/AMP_Base_Sanitizer/prepare_validation_error.md +++ b/docs/method/AMP_Base_Sanitizer/prepare_validation_error.md @@ -71,7 +71,7 @@ public function prepare_validation_error( array $error = [], array $data = [] ) ], $text_content ); - } elseif ( $is_inline_style ) { + } else { // Include stylesheet text except for amp-custom and amp-keyframes since it is large and since it should // already be detailed in the stylesheets metabox. $error['text'] = $text_content; diff --git a/docs/method/AMP_Base_Sanitizer/sanitize_dimension.md b/docs/method/AMP_Base_Sanitizer/sanitize_dimension.md index bb9684d4f58..b32ebbfa1f4 100644 --- a/docs/method/AMP_Base_Sanitizer/sanitize_dimension.md +++ b/docs/method/AMP_Base_Sanitizer/sanitize_dimension.md @@ -25,7 +25,7 @@ Sanitizes a CSS dimension specifier while being sensitive to dimension context. ```php public function sanitize_dimension( $value, $dimension ) { // Allows 0 to be used as valid dimension. - if ( null === $value ) { + if ( empty( $value ) && '0' !== (string) $value ) { return ''; } // Accepts both integers and floats & prevents negative values.