From 7fcdabd53ae0ae7d86a5a93b446dd4bfb5fa4046 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 14 Oct 2020 12:18:25 -0700 Subject: [PATCH] Update docs for 2.0.5 --- docs/docs.json | 9072 +++++++---------- .../amp_post_template_customizer_settings.md | 2 +- docs/hook/amp_post_template_file.md | 2 +- ..._post_template_include_{$template_type}.md | 2 +- 4 files changed, 3507 insertions(+), 5571 deletions(-) diff --git a/docs/docs.json b/docs/docs.json index 7fd4fa6d1ba..d728aaee7de 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -1,5 +1,172 @@ { - "91": { + "3": { + "file": { + "description": "Class AMP_Customizer_Design_Settings", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/settings\/class-amp-customizer-design-settings.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 229, + "type": "Require" + } + ], + "classes": [], + "hooks": [ + { + "name": "amp_customizer_is_enabled", + "line": 58, + "end_line": 58, + "type": "filter", + "arguments": [ + "true" + ], + "doc": { + "description": "Filter whether to enable the AMP default template design settings.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "0.4" + }, + { + "name": "since", + "content": "0.6", + "description": "This filter now controls whether or not the default settings, controls, and sections are registered for the Customizer. The AMP panel will be registered regardless." + }, + { + "name": "param", + "content": "Whether to enable the AMP default template design settings. Default true.", + "types": [ + "bool" + ], + "variable": "$enable" + } + ] + } + } + ] + }, + "4": { + "file": { + "description": "Class AMP_Customizer_Settings", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/settings\/class-amp-customizer-settings.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], + "hooks": [ + { + "name": "amp_customizer_get_settings", + "line": 43, + "end_line": 43, + "type": "filter", + "arguments": [ + "$settings" + ], + "doc": { + "description": "Filters the AMP Customizer settings.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "0.6" + }, + { + "name": "param", + "content": "Associative array of $setting => $value pairs.", + "types": [ + "array" + ], + "variable": "$settings" + } + ] + } + } + ] + }, + "9": { + "file": { + "description": "Class AMP_Links_Sanitizer.", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/sanitizers\/class-amp-link-sanitizer.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], + "hooks": [ + { + "name": "amp_to_amp_linking_element_excluded", + "line": 182, + "end_line": 182, + "type": "filter", + "arguments": [ + "$excluded", + "$url", + "$rel", + "$element" + ], + "doc": { + "description": "Filters whether AMP-to-AMP is excluded for an element.", + "long_description": "The element may be either a link (`a` or `area`) or a `form`.", + "tags": [ + { + "name": "param", + "content": "Excluded. Default value is whether element already has a `noamphtml` link relation or the URL is among `excluded_urls`.", + "types": [ + "bool" + ], + "variable": "$excluded" + }, + { + "name": "param", + "content": "URL considered for exclusion.", + "types": [ + "string" + ], + "variable": "$url" + }, + { + "name": "param", + "content": "Link relations.", + "types": [ + "string[]" + ], + "variable": "$rel" + }, + { + "name": "param", + "content": "The element considered for excluding from AMP-to-AMP linking. May be instance of `a`, `area`, or `form`.", + "types": [ + "\\DOMElement" + ], + "variable": "$element" + } + ] + } + } + ] + }, + "29": { "file": { "description": "Class AMP_Base_Sanitizer", "long_description": "", @@ -17,7 +184,7 @@ "name": "AMP_Base_Sanitizer", "namespace": "global", "line": 16, - "end_line": 796, + "end_line": 802, "final": false, "abstract": true, "extends": "", @@ -168,8 +335,8 @@ } } ], - "methods": [ - { + "methods": { + "0": { "name": "__construct", "namespace": "", "aliases": { @@ -230,7 +397,7 @@ ] } }, - { + "1": { "name": "add_buffering_hooks", "namespace": "", "aliases": { @@ -274,7 +441,7 @@ ] } }, - { + "2": { "name": "get_selector_conversion_mapping", "namespace": "", "aliases": { @@ -302,7 +469,7 @@ ] } }, - { + "3": { "name": "init", "namespace": "", "aliases": { @@ -337,7 +504,7 @@ ] } }, - { + "4": { "name": "sanitize", "namespace": "", "aliases": { @@ -357,7 +524,7 @@ "tags": [] } }, - { + "5": { "name": "get_scripts", "namespace": "", "aliases": { @@ -389,52 +556,7 @@ ] } }, - { - "name": "get_styles", - "namespace": "", - "aliases": { - "DevMode": "\\AmpProject\\DevMode", - "Document": "\\AmpProject\\Dom\\Document" - }, - "line": 184, - "end_line": 186, - "final": false, - "abstract": false, - "static": false, - "visibility": "public", - "arguments": [], - "doc": { - "description": "Return array of values that would be valid as an HTML `style` attribute.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.4" - }, - { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "As of 1.0, use get_stylesheets().", - "description": "As of 1.0, use get_stylesheets()." - }, - { - "name": "internal", - "content": "" - }, - { - "name": "return", - "content": "Mapping of CSS selectors to arrays of properties.", - "types": [ - "array[][]" - ] - } - ] - } - }, - { + "7": { "name": "get_stylesheets", "namespace": "", "aliases": { @@ -494,7 +616,7 @@ ] } }, - { + "8": { "name": "get_body_node", "namespace": "", "aliases": { @@ -541,7 +663,7 @@ ] } }, - { + "9": { "name": "sanitize_dimension", "namespace": "", "aliases": { @@ -643,7 +765,7 @@ ] } }, - { + "10": { "name": "is_empty_attribute_value", "namespace": "", "aliases": { @@ -686,7 +808,7 @@ ] } }, - { + "11": { "name": "set_layout", "namespace": "", "aliases": { @@ -760,7 +882,7 @@ ] } }, - { + "12": { "name": "add_or_append_attribute", "namespace": "", "aliases": { @@ -843,7 +965,7 @@ ] } }, - { + "13": { "name": "maybe_enforce_https_src", "namespace": "", "aliases": { @@ -912,7 +1034,7 @@ ] } }, - { + "14": { "name": "is_document_in_dev_mode", "namespace": "", "aliases": { @@ -968,7 +1090,7 @@ ] } }, - { + "15": { "name": "has_dev_mode_exemption", "namespace": "", "aliases": { @@ -1038,7 +1160,7 @@ ] } }, - { + "16": { "name": "is_exempt_from_validation", "namespace": "", "aliases": { @@ -1104,7 +1226,7 @@ ] } }, - { + "17": { "name": "remove_invalid_child", "namespace": "", "aliases": { @@ -1201,7 +1323,7 @@ ] } }, - { + "18": { "name": "remove_invalid_attribute", "namespace": "", "aliases": { @@ -1331,7 +1453,7 @@ ] } }, - { + "19": { "name": "should_sanitize_validation_error", "namespace": "", "aliases": { @@ -1413,7 +1535,7 @@ ] } }, - { + "20": { "name": "prepare_validation_error", "namespace": "", "aliases": { @@ -1421,7 +1543,7 @@ "Document": "\\AmpProject\\Dom\\Document" }, "line": 566, - "end_line": 632, + "end_line": 638, "final": false, "abstract": false, "static": false, @@ -1473,60 +1595,74 @@ "name": "hasAttribute", "class": "$node", "static": false, - "line": 597, - "end_line": 597 + "line": 598, + "end_line": 598 + }, + { + "name": "hasAttribute", + "class": "$node", + "static": false, + "line": 602, + "end_line": 602 + }, + { + "name": "hasAttribute", + "class": "$node", + "static": false, + "line": 602, + "end_line": 602 }, { "name": "hasAttributes", "class": "$node->parentNode", "static": false, - "line": 617, - "end_line": 617 + "line": 623, + "end_line": 623 } ], "functions": [ { "name": "strpos", - "line": 602, - "end_line": 602 + "line": 608, + "end_line": 608 }, { "name": "add_query_arg", - "line": 603, - "end_line": 603 + "line": 609, + "end_line": 609 }, { "name": "strpos", - "line": 604, - "end_line": 604 + "line": 610, + "end_line": 610 }, { "name": "add_query_arg", - "line": 605, - "end_line": 605 + "line": 611, + "end_line": 611 }, { "name": "preg_match", - "line": 613, - "end_line": 613 + "line": 619, + "end_line": 619 }, { "name": "trim", - "line": 624, - "end_line": 624 + "line": 630, + "end_line": 630 } ] } }, - { + "21": { "name": "clean_up_after_attribute_removal", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 642, - "end_line": 657, + "line": 648, + "end_line": 663, "final": false, "abstract": false, "static": false, @@ -1575,28 +1711,28 @@ "name": "hasAttribute", "class": "$element", "static": false, - "line": 652, - "end_line": 652 + "line": 658, + "end_line": 658 }, { "name": "removeAttribute", "class": "$element", "static": false, - "line": 653, - "end_line": 653 + "line": 659, + "end_line": 659 } ] } }, - { + "22": { "name": "get_data_amp_attributes", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 665, - "end_line": 681, + "line": 671, + "end_line": 687, "final": false, "abstract": false, "static": false, @@ -1635,28 +1771,28 @@ "name": "get_node_attributes_as_assoc_array", "class": "\\AMP_DOM_Utils", "static": true, - "line": 671, - "end_line": 671 + "line": 677, + "end_line": 677 } ], "functions": [ { "name": "filter_var", - "line": 675, - "end_line": 675 + "line": 681, + "end_line": 681 } ] } }, - { + "23": { "name": "filter_data_amp_attributes", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 690, - "end_line": 698, + "line": 696, + "end_line": 704, "final": false, "abstract": false, "static": false, @@ -1703,15 +1839,15 @@ ] } }, - { + "24": { "name": "filter_attachment_layout_attributes", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 708, - "end_line": 734, + "line": 714, + "end_line": 740, "final": false, "abstract": false, "static": false, @@ -1776,35 +1912,35 @@ "name": "setAttribute", "class": "$node->parentNode", "static": false, - "line": 716, - "end_line": 716 + "line": 722, + "end_line": 722 }, { "name": "setAttribute", "class": "$node->parentNode", "static": false, - "line": 723, - "end_line": 723 + "line": 729, + "end_line": 729 }, { "name": "setAttribute", "class": "$node->parentNode", "static": false, - "line": 726, - "end_line": 726 + "line": 732, + "end_line": 732 } ] } }, - { + "25": { "name": "parse_style_string", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 742, - "end_line": 756, + "line": 748, + "end_line": 762, "final": false, "abstract": false, "static": false, @@ -1841,56 +1977,56 @@ "functions": [ { "name": "trim", - "line": 744, - "end_line": 744 + "line": 750, + "end_line": 750 }, { "name": "preg_split", - "line": 745, - "end_line": 745 + "line": 751, + "end_line": 751 }, { "name": "count", - "line": 747, - "end_line": 747 + "line": 753, + "end_line": 753 }, { "name": "array_pop", - "line": 749, - "end_line": 749 + "line": 755, + "end_line": 755 }, { "name": "array_chunk", - "line": 752, - "end_line": 752 + "line": 758, + "end_line": 758 }, { "name": "array_combine", - "line": 755, - "end_line": 755 + "line": 761, + "end_line": 761 }, { "name": "array_column", - "line": 755, - "end_line": 755 + "line": 761, + "end_line": 761 }, { "name": "array_column", - "line": 755, - "end_line": 755 + "line": 761, + "end_line": 761 } ] } }, - { + "26": { "name": "reassemble_style_string", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 764, - "end_line": 783, + "line": 770, + "end_line": 789, "final": false, "abstract": false, "static": false, @@ -1927,36 +2063,36 @@ "functions": [ { "name": "is_array", - "line": 765, - "end_line": 765 + "line": 771, + "end_line": 771 }, { "name": "array_filter", - "line": 770, - "end_line": 770 + "line": 776, + "end_line": 776 }, { "name": "array_reduce", - "line": 772, - "end_line": 782 + "line": 778, + "end_line": 788 }, { "name": "array_keys", - "line": 773, - "end_line": 773 + "line": 779, + "end_line": 779 } ] } }, - { + "27": { "name": "get_validate_response_data", "namespace": "", "aliases": { "DevMode": "\\AmpProject\\DevMode", "Document": "\\AmpProject\\Dom\\Document" }, - "line": 793, - "end_line": 795, + "line": 799, + "end_line": 801, "final": false, "abstract": false, "static": false, @@ -1981,7 +2117,7 @@ ] } } - ], + }, "doc": { "description": "Class AMP_Base_Sanitizer", "long_description": "", @@ -1993,56 +2129,81 @@ ] } } - ] + ], + "hooks": [] }, - "101": { + "34": { "file": { - "description": "Deprecated functions.", + "description": "Callbacks for adding AMP-related things to the main theme.", "long_description": "", "tags": [ + { + "name": "codeCoverageIgnore", + "content": "" + }, + { + "name": "deprecated", + "content": "Function in this file has been moved to amp-helper-functions.php.", + "description": "Function in this file has been moved to amp-helper-functions.php." + }, { "name": "package", "content": "AMP" } ] }, - "path": "includes\/deprecated.php", + "path": "includes\/amp-frontend-actions.php", "root": "\/app\/public\/content\/plugins\/amp", - "includes": [ - { - "name": "", - "line": 92, - "type": "Require Once" - } - ], + "uses": { + "functions": [ + { + "name": "_deprecated_file", + "line": 10, + "end_line": 20, + "deprecation_version": "1.0" + }, + { + "name": "sprintf", + "line": 14, + "end_line": 19 + }, + { + "name": "esc_html__", + "line": 16, + "end_line": 16 + } + ] + }, "functions": [ { - "name": "amp_load_classes", + "name": "amp_frontend_add_canonical", "namespace": "global", "aliases": [], - "line": 16, - "end_line": 18, + "line": 31, + "end_line": 34, "arguments": [], "doc": { - "description": "Load classes.", + "description": "Add amphtml link to frontend.", "long_description": "", "tags": [ { - "name": "since", - "content": "0.2" + "name": "deprecated", + "content": "Use amp_add_amphtml_link() instead.", + "description": "Use amp_add_amphtml_link() instead." }, { - "name": "codeCoverageIgnore", - "content": "" + "name": "since", + "content": "0.2" }, { - "name": "deprecated", - "content": "As of 0.6 since autoloading is now employed.", - "description": "As of 0.6 since autoloading is now employed." + "name": "since", + "content": "1.0", + "description": "Deprecated" }, { - "name": "internal", - "content": "" + "name": "see", + "content": "", + "refers": "amp_add_amphtml_link()" } ] }, @@ -2051,637 +2212,570 @@ "functions": [ { "name": "_deprecated_function", - "line": 17, - "end_line": 17, - "deprecation_version": "0.6" + "line": 32, + "end_line": 32, + "deprecation_version": "1.0" + }, + { + "name": "amp_add_amphtml_link", + "line": 33, + "end_line": 33 } ] } + } + ], + "hooks": [] + }, + "35": { + "file": { + "description": "Class AMP_Theme_Support", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/class-amp-theme-support.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 2371, + "type": "Require" }, { - "name": "amp_maybe_add_actions", - "namespace": "global", - "aliases": [], - "line": 32, - "end_line": 81, - "arguments": [], + "name": "", + "line": 2472, + "type": "Require" + } + ], + "classes": [], + "hooks": { + "1": { + "name": "amp_supportable_templates", + "line": 903, + "end_line": 903, + "type": "filter", + "arguments": [ + "$templates" + ], "doc": { - "description": "Conditionally add AMP actions or render the transitional mode template(s).", - "long_description": "If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page. It won't need this plugin's template system, nor the frontend actions like the 'rel' link.", + "description": "Filters list of supportable templates.", + "long_description": "Each array item should have a key that corresponds to a template conditional function. If the key is such a function, then the key is used to evaluate whether the given template entry is a match. Otherwise, a supportable template item can include a callback value which is used instead. Each item needs a 'label' value. Additionally, if the supportable template is a subset of another condition (e.g. is_singular > is_single) then this relationship needs to be indicated via the 'parent' value.", "tags": [ - { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "This function is not used when 'amp' theme support is added.", - "description": "This function is not used when 'amp' theme support is added." - }, - { - "name": "global", - "content": "WP_Query $wp_query" - }, { "name": "since", - "content": "0.2" + "content": "1.0" }, { - "name": "return", - "content": "", + "name": "param", + "content": "Supportable templates.", "types": [ - "void" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 33, - "end_line": 33, - "deprecation_version": "1.5" - }, - { - "name": "current_theme_supports", - "line": 36, - "end_line": 36 - }, - { - "name": "is_singular", - "line": 42, - "end_line": 42 - }, - { - "name": "is_feed", - "line": 42, - "end_line": 42 - }, - { - "name": "amp_is_request", - "line": 46, - "end_line": 46 - }, - { - "name": "get_queried_object", - "line": 53, - "end_line": 53 - }, - { - "name": "amp_is_post_supported", - "line": 54, - "end_line": 54 - }, - { - "name": "wp_safe_redirect", - "line": 60, - "end_line": 60 - }, - { - "name": "get_permalink", - "line": 60, - "end_line": 60 - }, - { - "name": "current_user_can", - "line": 60, - "end_line": 60 - }, - { - "name": "wp_parse_str", - "line": 71, - "end_line": 71 - }, - { - "name": "amp_get_slug", - "line": 72, - "end_line": 72 - }, - { - "name": "amp_get_slug", - "line": 72, - "end_line": 72 - }, - { - "name": "wp_safe_redirect", - "line": 73, - "end_line": 73 - }, - { - "name": "amp_get_permalink", - "line": 73, - "end_line": 73 - }, - { - "name": "amp_prepare_render", - "line": 77, - "end_line": 77 - }, - { - "name": "amp_add_frontend_actions", - "line": 79, - "end_line": 79 + "array" + ], + "variable": "$templates" } ] } }, - { - "name": "amp_add_post_template_actions", - "namespace": "global", - "aliases": [], - "line": 90, - "end_line": 94, - "arguments": [], + "9": { + "name": "amp_enable_optimizer", + "line": 2158, + "end_line": 2158, + "type": "filter", + "arguments": [ + "$enable_optimizer" + ], "doc": { - "description": "Add post template actions.", + "description": "Filter whether the generated HTML output should be run through the AMP Optimizer or not.", "long_description": "", "tags": [ { "name": "since", - "content": "0.2" - }, - { - "name": "codeCoverageIgnore", - "content": "" + "content": "1.5.0" }, { - "name": "deprecated", - "content": "This function is not used when 'amp' theme support is added.", - "description": "This function is not used when 'amp' theme support is added." + "name": "param", + "content": "Whether the generated HTML output should be run through the AMP Optimizer or not.", + "types": [ + "bool" + ], + "variable": "$enable_optimizer" } ] - }, - "hooks": [], - "uses": { - "functions": [ + } + }, + "13": { + "name": "amp_enable_ssr", + "line": 2277, + "end_line": 2277, + "type": "filter", + "arguments": [ + "$enable_ssr" + ], + "doc": { + "description": "Filter whether the AMP Optimizer should use server-side rendering or not.", + "long_description": "", + "tags": [ { - "name": "_deprecated_function", - "line": 91, - "end_line": 91, - "deprecation_version": "1.5" + "name": "since", + "content": "1.5.0" }, { - "name": "amp_post_template_init_hooks", - "line": 93, - "end_line": 93 + "name": "param", + "content": "Whether the AMP Optimizer should use server-side rendering or not.", + "types": [ + "bool" + ], + "variable": "$enable_ssr" } ] } }, - { - "name": "amp_prepare_render", - "namespace": "global", - "aliases": [], - "line": 104, - "end_line": 107, - "arguments": [], + "14": { + "name": "amp_optimizer_config", + "line": 2300, + "end_line": 2306, + "type": "filter", + "arguments": [ + "array_merge(array(\\AmpProject\\Optimizer\\Configuration::KEY_TRANSFORMERS => $transformers), $args)" + ], "doc": { - "description": "Add action to do post template rendering at template_redirect action.", + "description": "Filter the configuration to be used for the AMP Optimizer.", "long_description": "", "tags": [ { "name": "since", - "content": "0.2" - }, - { - "name": "since", - "content": "1.0", - "description": "The amp_render() function is called at template_redirect action priority 11 instead of priority 10." - }, - { - "name": "codeCoverageIgnore", - "content": "" + "content": "1.5.0" }, { - "name": "deprecated", - "content": "This function is not used when 'amp' theme support is added.", - "description": "This function is not used when 'amp' theme support is added." + "name": "param", + "content": "Associative array of configuration data.", + "types": [ + "array" + ], + "variable": "$configuration" } ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 105, - "end_line": 105, - "deprecation_version": "1.5" - }, + } + } + } + }, + "36": { + "file": { + "description": "Callbacks for adding AMP-related things to the admin.", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/admin\/functions.php", + "root": "\/app\/public\/content\/plugins\/amp", + "functions": [], + "hooks": { + "0": { + "name": "amp_customizer_post_type", + "line": 43, + "end_line": 43, + "type": "filter", + "arguments": [ + "'post'" + ], + "doc": { + "description": "Filter the post type to retrieve the latest for use in the AMP template customizer.", + "long_description": "", + "tags": [ { - "name": "add_action", - "line": 106, - "end_line": 106 + "name": "param", + "content": "Post type slug. Default 'post'.", + "types": [ + "string" + ], + "variable": "$post_type" } ] } }, - { - "name": "amp_render", - "namespace": "global", - "aliases": [], - "line": 116, - "end_line": 125, - "arguments": [], + "2": { + "name": "amp_post_template_analytics", + "line": 159, + "end_line": 159, + "type": "filter", + "arguments": [ + "$analytics", + "get_queried_object()" + ], "doc": { - "description": "Render AMP for queried post.", - "long_description": "", + "description": "Add amp-analytics tags.", + "long_description": "This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting. This filter should be used to alter entries for legacy AMP templates.", "tags": [ { "name": "since", - "content": "0.1" + "content": "0.4" }, { - "name": "codeCoverageIgnore", - "content": "" + "name": "param", + "content": "An associative array of the analytics entries we want to output. Each array entry must have a unique key, and the value should be an array with the following keys: `type`, `attributes`, `script_data`. See readme for more details.", + "types": [ + "array" + ], + "variable": "$analytics" }, { - "name": "deprecated", - "content": "This function is not used when 'amp' theme support is added.", - "description": "This function is not used when 'amp' theme support is added." + "name": "param", + "content": "The current post.", + "types": [ + "\\WP_Post" + ], + "variable": "$post" } ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 117, - "end_line": 117, - "deprecation_version": "1.5" - }, + } + } + } + }, + "38": { + "file": { + "description": "Class AMP_Template_Customizer", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/admin\/class-amp-template-customizer.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 307, + "type": "Require" + }, + { + "name": "", + "line": 562, + "type": "Require" + }, + { + "name": "", + "line": 630, + "type": "Require" + } + ], + "classes": [], + "hooks": { + "0": { + "name": "amp_customizer_init", + "line": 105, + "end_line": 105, + "type": "action", + "arguments": [ + "$self" + ], + "doc": { + "description": "Fires when the AMP Template Customizer initializes.", + "long_description": "In practice the `customize_register` hook should be used instead.", + "tags": [ { - "name": "get_queried_object", - "line": 120, - "end_line": 120 + "name": "param", + "content": "Instance.", + "types": [ + "\\AMP_Template_Customizer" + ], + "variable": "$self" }, { - "name": "amp_render_post", - "line": 122, - "end_line": 122 + "name": "since", + "content": "0.4" } ] } }, - { - "name": "amp_render_post", - "namespace": "global", - "aliases": [], - "line": 137, - "end_line": 183, + "1": { + "name": "amp_customizer_register_ui", + "line": 260, + "end_line": 260, + "type": "action", "arguments": [ - { - "name": "$post", - "default": null, - "type": "" - } + "$this->wp_customize" ], "doc": { - "description": "Render AMP post template.", - "long_description": "", + "description": "Fires after the AMP panel has been registered for plugins to add additional controls.", + "long_description": "In practice the `customize_register` hook should be used instead.", "tags": [ { "name": "since", - "content": "0.5" - }, - { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "Rendering a post is now handled by AMP_Theme_Support.", - "description": "Rendering a post is now handled by AMP_Theme_Support." + "content": "0.4" }, { "name": "param", - "content": "Post.", + "content": "Manager.", "types": [ - "\\WP_Post", - "int" + "\\WP_Customize_Manager" ], - "variable": "$post" - }, - { - "name": "global", - "content": "WP_Query $wp_query" + "variable": "$manager" } ] - }, - "hooks": [ - { - "name": "pre_amp_render_post", - "line": 174, - "end_line": 174, - "type": "action", - "arguments": [ - "$post_id" - ], - "doc": { - "description": "Fires before rendering a post in AMP.", - "long_description": "This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `amp_is_request()`.", - "tags": [ - { - "name": "since", - "content": "0.2" - }, - { - "name": "deprecated", - "content": "Check amp_is_request() on the template_redirect action instead.", - "description": "Check amp_is_request() on the template_redirect action instead." - }, - { - "name": "param", - "content": "Post ID.", - "types": [ - "int" - ], - "variable": "$post_id" - } - ] - } - } + } + }, + "2": { + "name": "amp_customizer_register_settings", + "line": 296, + "end_line": 296, + "type": "action", + "arguments": [ + "$this->wp_customize" ], - "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 138, - "end_line": 138, - "deprecation_version": "1.5" - }, - { - "name": "get_post", - "line": 142, - "end_line": 142 - }, - { - "name": "amp_get_slug", - "line": 154, - "end_line": 154 - }, - { - "name": "amp_get_slug", - "line": 156, - "end_line": 156 - }, - { - "name": "extension_loaded", - "line": 160, - "end_line": 160 - }, - { - "name": "newrelic_disable_autorum", - "line": 161, - "end_line": 161 - }, - { - "name": "do_action", - "line": 174, - "end_line": 174 - }, - { - "name": "amp_add_post_template_actions", - "line": 176, - "end_line": 176 - }, - { - "name": "amp_get_slug", - "line": 181, - "end_line": 181 - } - ], - "methods": [ + "doc": { + "description": "Fires when plugins should register settings for AMP.", + "long_description": "In practice the `customize_register` hook should be used instead.", + "tags": [ { - "name": "__construct", - "class": "\\AMP_Post_Template", - "static": false, - "line": 177, - "end_line": 177 + "name": "since", + "content": "0.4" }, { - "name": "load", - "class": "$template", - "static": false, - "line": 178, - "end_line": 178 + "name": "param", + "content": "Manager.", + "types": [ + "\\WP_Customize_Manager" + ], + "variable": "$manager" } ] } }, - { - "name": "amp_post_template_add_scripts", - "namespace": "global", - "aliases": [], - "line": 195, - "end_line": 207, + "9": { + "name": "amp_customizer_enqueue_scripts", + "line": 612, + "end_line": 612, + "type": "action", "arguments": [ - { - "name": "$amp_template", - "default": null, - "type": "" - } + "$this->wp_customize" ], "doc": { - "description": "Print scripts.", - "long_description": "", + "description": "Fires when plugins should register settings for AMP.", + "long_description": "In practice the `customize_controls_enqueue_scripts` hook should be used instead.", "tags": [ { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "Scripts are now automatically added.", - "description": "Scripts are now automatically added." - }, - { - "name": "internal", - "content": "" - }, - { - "name": "see", - "content": "", - "refers": "amp_register_default_scripts()" - }, - { - "name": "see", - "content": "", - "refers": "amp_filter_script_loader_tag()" + "name": "since", + "content": "0.4" }, { "name": "param", - "content": "Template.", + "content": "Manager.", "types": [ - "\\AMP_Post_Template" + "\\WP_Customize_Manager" ], - "variable": "$amp_template" + "variable": "$manager" } ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 196, - "end_line": 196, - "deprecation_version": "1.5" - }, - { - "name": "amp_render_scripts", - "line": 198, - "end_line": 206 - }, - { - "name": "array_merge", - "line": 199, - "end_line": 205 - } - ], - "methods": [ + } + }, + "11": { + "name": "amp_customizer_enqueue_preview_scripts", + "line": 703, + "end_line": 703, + "type": "action", + "arguments": [ + "$this->wp_customize" + ], + "doc": { + "description": "Fires when plugins should enqueue their own scripts for the AMP Customizer preview.", + "long_description": "", + "tags": [ { - "name": "get", - "class": "$amp_template", - "static": false, - "line": 202, - "end_line": 202 + "name": "since", + "content": "0.4" }, { - "name": "get", - "class": "$amp_template", - "static": false, - "line": 204, - "end_line": 204 + "name": "param", + "content": "Manager.", + "types": [ + "\\WP_Customize_Manager" + ], + "variable": "$wp_customize" } ] } - }, + } + } + }, + "42": { + "file": { + "description": "AMP Helper Functions", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/amp-helper-functions.php", + "root": "\/app\/public\/content\/plugins\/amp", + "constants": [ { - "name": "amp_post_template_add_boilerplate_css", + "name": "AMP_QUERY_VAR", + "line": 241, + "value": "amp_get_slug()" + } + ], + "functions": { + "7": { + "name": "amp_is_canonical", "namespace": "global", - "aliases": [], - "line": 218, - "end_line": 221, + "aliases": { + "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", + "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", + "Icon": "\\AmpProject\\AmpWP\\Icon", + "Option": "\\AmpProject\\AmpWP\\Option", + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" + }, + "line": 367, + "end_line": 369, "arguments": [], "doc": { - "description": "Print boilerplate CSS.", - "long_description": "", + "description": "Whether this is in 'canonical mode'.", + "long_description": "Themes can register support for this with `add_theme_support( AMP_Theme_Support::SLUG )`:\n add_theme_support( AMP_Theme_Support::SLUG );\n This will serve templates in AMP-first, allowing you to use AMP components in your theme templates. If you want to make available in transitional mode, where templates are served in AMP or non-AMP documents, do:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'paired' => true, ) );\n Transitional mode is also implied if you define a template_dir:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'template_dir' => 'amp', ) );\n If you want to have AMP-specific templates in addition to serving AMP-first, do:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'paired' => false, 'template_dir' => 'amp', ) );\n If you want to force AMP to always be served on a given template, you can use the templates_supported arg, for example to always serve the Category template in AMP:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'templates_supported' => array( 'is_category' => true, ), ) );\n Or if you want to force AMP to be used on all templates:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'templates_supported' => 'all', ) );", "tags": [ - { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "Boilerplate is now automatically added via the ampproject\/optimizer library.", - "description": "Boilerplate is now automatically added via the ampproject\/optimizer library." - }, - { - "name": "internal", - "content": "" - }, - { - "name": "since", - "content": "0.3" - }, { "name": "see", "content": "", - "refers": "amp_get_boilerplate_code()" + "refers": "AMP_Theme_Support::read_theme_support()" + }, + { + "name": "return", + "content": "Whether this is in AMP 'canonical' mode, that is whether it is AMP-first and there is not a separate (paired) AMP URL.", + "types": [ + "boolean" + ] } ] }, "hooks": [], "uses": { - "functions": [ - { - "name": "_deprecated_function", - "line": 219, - "end_line": 219, - "deprecation_version": "1.5" - }, + "methods": [ { - "name": "amp_get_boilerplate_code", - "line": 220, - "end_line": 220 + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 368, + "end_line": 368 } ] } }, - { - "name": "amp_post_template_add_schemaorg_metadata", + "8": { + "name": "amp_is_legacy", "namespace": "global", - "aliases": [], - "line": 230, - "end_line": 233, + "aliases": { + "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", + "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", + "Icon": "\\AmpProject\\AmpWP\\Icon", + "Option": "\\AmpProject\\AmpWP\\Option", + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" + }, + "line": 377, + "end_line": 388, "arguments": [], "doc": { - "description": "Print Schema.org metadata.", + "description": "Determines whether the legacy AMP post templates are being used.", "long_description": "", "tags": [ { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "Since 0.7", - "description": "Since 0.7" + "name": "since", + "content": "2.0" }, { - "name": "internal", - "content": "" + "name": "return", + "content": "", + "types": [ + "bool" + ] } ] }, "hooks": [], "uses": { - "functions": [ + "methods": [ { - "name": "_deprecated_function", - "line": 231, - "end_line": 231, - "deprecation_version": "0.7" + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 378, + "end_line": 378 + }, + { + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 382, + "end_line": 382 }, { - "name": "amp_print_schemaorg_metadata", - "line": 232, - "end_line": 232 + "name": "exists", + "class": "wp_get_theme($reader_theme)", + "static": false, + "line": 387, + "end_line": 387 + } + ], + "functions": [ + { + "name": "wp_get_theme", + "line": 387, + "end_line": 387 } ] } }, - { - "name": "amp_post_meta_box", + "10": { + "name": "amp_is_available", "namespace": "global", - "aliases": [], - "line": 245, - "end_line": 247, + "aliases": { + "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", + "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", + "Icon": "\\AmpProject\\AmpWP\\Icon", + "Option": "\\AmpProject\\AmpWP\\Option", + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" + }, + "line": 409, + "end_line": 582, "arguments": [], "doc": { - "description": "Bootstrap AMP post meta box.", - "long_description": "This function must be invoked only once through the 'wp_loaded' action.", + "description": "Determine whether AMP is available for the current URL.", + "long_description": "", "tags": [ { "name": "since", - "content": "0.6" + "content": "2.0" }, { - "name": "codeCoverageIgnore", - "content": "" + "name": "return", + "content": "Whether there is an AMP version for the provided URL.", + "types": [ + "bool" + ] }, { - "name": "deprecated", - "content": "Since 1.5.0, as admin class bootstrapping is moved to amp_bootstrap_admin().", - "description": "Since 1.5.0, as admin class bootstrapping is moved to amp_bootstrap_admin()." + "name": "global", + "content": "string $pagenow" }, { - "name": "internal", - "content": "" + "name": "global", + "content": "WP_Query $wp_query" } ] }, @@ -2689,513 +2783,351 @@ "uses": { "functions": [ { - "name": "_deprecated_function", - "line": 246, - "end_line": 246, - "deprecation_version": "1.5.0" - } - ] - } - }, - { - "name": "amp_admin_pointer", - "namespace": "global", - "aliases": [], - "line": 257, - "end_line": 259, - "arguments": [], - "doc": { - "description": "Bootstrap the AMP admin pointer class.", - "long_description": "", - "tags": [ + "name": "is_admin", + "line": 413, + "end_line": 413 + }, { - "name": "since", - "content": "1.0" + "name": "in_array", + "line": 413, + "end_line": 413 }, { - "name": "codeCoverageIgnore", - "content": "" + "name": "in_array", + "line": 424, + "end_line": 424 }, { - "name": "deprecated", - "content": "Since 1.5.0, as admin class bootstrapping is moved to amp_bootstrap_admin().", - "description": "Since 1.5.0, as admin class bootstrapping is moved to amp_bootstrap_admin()." + "name": "sprintf", + "line": 428, + "end_line": 434 }, { - "name": "internal", - "content": "" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ + "name": "__", + "line": 430, + "end_line": 430 + }, { - "name": "_deprecated_function", - "line": 258, - "end_line": 258, - "deprecation_version": "1.5.0" - } - ] - } - }, - { - "name": "_amp_xdebug_admin_notice", - "namespace": "global", - "aliases": [], - "line": 269, - "end_line": 284, - "arguments": [], - "doc": { - "description": "Print admin notice if the Xdebug extension is loaded.", - "long_description": "", - "tags": [ + "name": "sprintf", + "line": 436, + "end_line": 443 + }, { - "name": "since", - "content": "1.3" + "name": "__", + "line": 438, + "end_line": 438 }, { - "name": "deprecated", - "content": "1.5.0", - "description": "Warning moved to Site Health." + "name": "current_action", + "line": 439, + "end_line": 439 }, { - "name": "internal", - "content": "" + "name": "__", + "line": 451, + "end_line": 451 }, { - "name": "see", - "content": "", - "refers": "AmpProject\\AmpWP\\Admin\\SiteHealth::xdebug_extension()" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ + "name": "__", + "line": 455, + "end_line": 455 + }, { - "name": "_deprecated_function", - "line": 270, - "end_line": 270, - "deprecation_version": "1.5.0" + "name": "__", + "line": 459, + "end_line": 459 }, { - "name": "esc_html_e", - "line": 276, - "end_line": 279 - } - ] - } - } - ] - }, - "107": { - "file": { - "description": "Load the reader mode template.", - "long_description": "", - "tags": [ - { - "name": "package", - "content": "AMP" - } - ] - }, - "path": "includes\/templates\/reader-template-loader.php", - "root": "\/app\/public\/content\/plugins\/amp", - "uses": { - "functions": [ - { - "name": "get_queried_object", - "line": 18, - "end_line": 18 - }, - { - "name": "setup_postdata", - "line": 19, - "end_line": 19 - }, - { - "name": "do_action", - "line": 30, - "end_line": 30 - }, - { - "name": "get_queried_object_id", - "line": 30, - "end_line": 30 - }, - { - "name": "amp_post_template_init_hooks", - "line": 33, - "end_line": 33 - } - ], - "methods": [ - { - "name": "__construct", - "class": "\\AMP_Post_Template", - "static": false, - "line": 35, - "end_line": 35 - }, - { - "name": "load", - "class": "$amp_post_template", - "static": false, - "line": 36, - "end_line": 36 - } - ] - }, - "includes": [ - { - "name": "", - "line": 32, - "type": "Require Once" - } - ], - "hooks": [ - { - "name": "pre_amp_render_post", - "line": 30, - "end_line": 30, - "type": "action", - "arguments": [ - "get_queried_object_id()" - ], - "doc": { - "description": "Fires before rendering a post in AMP.", - "long_description": "This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `amp_is_request()`.", - "tags": [ - { - "name": "since", - "content": "0.2" + "name": "sprintf", + "line": 464, + "end_line": 464 }, { - "name": "param", - "content": "Post ID.", - "types": [ - "int" - ], - "variable": "$post_id" - } - ] - } - } - ] - }, - "116": { - "file": { - "description": "Callbacks for adding AMP-related things to the main theme.", - "long_description": "", - "tags": [ - { - "name": "codeCoverageIgnore", - "content": "" - }, - { - "name": "deprecated", - "content": "Function in this file has been moved to amp-helper-functions.php.", - "description": "Function in this file has been moved to amp-helper-functions.php." - }, - { - "name": "package", - "content": "AMP" - } - ] - }, - "path": "includes\/amp-frontend-actions.php", - "root": "\/app\/public\/content\/plugins\/amp", - "uses": { - "functions": [ - { - "name": "_deprecated_file", - "line": 10, - "end_line": 20, - "deprecation_version": "1.0" - }, - { - "name": "sprintf", - "line": 14, - "end_line": 19 - }, - { - "name": "esc_html__", - "line": 16, - "end_line": 16 - } - ] - }, - "functions": [ - { - "name": "amp_frontend_add_canonical", - "namespace": "global", - "aliases": [], - "line": 31, - "end_line": 34, - "arguments": [], - "doc": { - "description": "Add amphtml link to frontend.", - "long_description": "", - "tags": [ - { - "name": "deprecated", - "content": "Use amp_add_amphtml_link() instead.", - "description": "Use amp_add_amphtml_link() instead." + "name": "_doing_it_wrong", + "line": 468, + "end_line": 468 }, { - "name": "since", - "content": "0.2" + "name": "esc_html", + "line": 468, + "end_line": 468 }, { - "name": "since", - "content": "1.0", - "description": "Deprecated" + "name": "did_action", + "line": 473, + "end_line": 473 }, { - "name": "see", - "content": "", - "refers": "amp_add_amphtml_link()" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ + "name": "warn", + "line": 474, + "end_line": 474 + }, { - "name": "_deprecated_function", - "line": 32, - "end_line": 32, - "deprecation_version": "1.0" + "name": "defined", + "line": 475, + "end_line": 475 }, { - "name": "amp_add_amphtml_link", - "line": 33, - "end_line": 33 - } - ] - } - } - ] - }, - "120": { - "file": { - "description": "AMP Helper Functions", - "long_description": "", - "tags": [ - { - "name": "package", - "content": "AMP" - } - ] - }, - "path": "includes\/amp-helper-functions.php", - "root": "\/app\/public\/content\/plugins\/amp", - "functions": [ - { - "name": "amp_activate", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 22, - "end_line": 29, - "arguments": [ - { - "name": "$network_wide", - "default": "false", - "type": "" - } - ], - "doc": { - "description": "Handle activation of plugin.", - "long_description": "", - "tags": [ + "name": "did_action", + "line": 480, + "end_line": 480 + }, { - "name": "since", - "content": "0.2" + "name": "warn", + "line": 481, + "end_line": 481 }, { - "name": "internal", - "content": "" + "name": "class_exists", + "line": 487, + "end_line": 487 }, { - "name": "param", - "content": "Whether the activation was done network-wide.", - "types": [ - "bool" - ], - "variable": "$network_wide" - } - ] - }, - "hooks": [], - "uses": { - "methods": [ + "name": "defined", + "line": 487, + "end_line": 487 + }, { - "name": "activate", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory::create()", - "static": false, - "line": 23, - "end_line": 23 + "name": "method_exists", + "line": 507, + "end_line": 507 }, { - "name": "create", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "static": true, - "line": 23, - "end_line": 23 - } - ], - "functions": [ + "name": "is_customize_preview", + "line": 519, + "end_line": 519 + }, { - "name": "amp_after_setup_theme", - "line": 24, - "end_line": 24 + "name": "amp_is_legacy", + "line": 523, + "end_line": 523 }, { "name": "did_action", - "line": 25, - "end_line": 25 + "line": 526, + "end_line": 526 }, { - "name": "amp_init", - "line": 26, - "end_line": 26 + "name": "warn", + "line": 527, + "end_line": 527 }, { - "name": "flush_rewrite_rules", - "line": 28, - "end_line": 28 - } - ] - } - }, - { - "name": "amp_deactivate", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 39, - "end_line": 51, - "arguments": [ - { - "name": "$network_wide", - "default": "false", - "type": "" - } - ], - "doc": { - "description": "Handle deactivation of plugin.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.2" + "name": "amp_is_canonical", + "line": 533, + "end_line": 533 }, { - "name": "internal", - "content": "" + "name": "get_queried_object", + "line": 550, + "end_line": 550 }, { - "name": "param", - "content": "Whether the activation was done network-wide.", - "types": [ - "bool" - ], - "variable": "$network_wide" + "name": "amp_is_canonical", + "line": 562, + "end_line": 562 + }, + { + "name": "amp_get_current_url", + "line": 564, + "end_line": 564 + }, + { + "name": "count", + "line": 567, + "end_line": 567 + }, + { + "name": "amp_is_post_supported", + "line": 575, + "end_line": 575 } - ] - }, - "hooks": [], - "uses": { + ], "methods": [ { - "name": "deactivate", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory::create()", + "name": "get", + "class": "\\AmpProject\\AmpWP\\Services", + "static": true, + "line": 420, + "end_line": 420 + }, + { + "name": "analyze_backtrace", + "class": "$likely_culprit_detector", + "static": false, + "line": 422, + "end_line": 422 + }, + { + "name": "get", + "class": "$wp_query", + "static": false, + "line": 487, + "end_line": 487 + }, + { + "name": "is_embed", + "class": "$wp_query", + "static": false, + "line": 497, + "end_line": 497 + }, + { + "name": "is_feed", + "class": "$wp_query", + "static": false, + "line": 499, + "end_line": 499 + }, + { + "name": "is_comment_feed", + "class": "$wp_query", + "static": false, + "line": 501, + "end_line": 501 + }, + { + "name": "is_trackback", + "class": "$wp_query", + "static": false, + "line": 503, + "end_line": 503 + }, + { + "name": "is_robots", + "class": "$wp_query", + "static": false, + "line": 505, + "end_line": 505 + }, + { + "name": "is_favicon", + "class": "$wp_query", "static": false, - "line": 40, - "end_line": 40 + "line": 507, + "end_line": 507 }, { - "name": "create", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", + "name": "get_option", + "class": "\\AMP_Options_Manager", "static": true, - "line": 40, - "end_line": 40 - } - ], - "functions": [ + "line": 515, + "end_line": 515 + }, { - "name": "amp_get_slug", - "line": 44, - "end_line": 44 + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 517, + "end_line": 517 + }, + { + "name": "get_option", + "class": "\\AMP_Options_Manager", + "static": true, + "line": 528, + "end_line": 528 + }, + { + "name": "has_cap", + "class": "\\AMP_Validation_Manager", + "static": true, + "line": 533, + "end_line": 533 + }, + { + "name": "is_theme_support_forced", + "class": "\\AMP_Validation_Manager", + "static": true, + "line": 546, + "end_line": 546 + }, + { + "name": "get_template_availability", + "class": "\\AMP_Theme_Support", + "static": true, + "line": 553, + "end_line": 553 + }, + { + "name": "has_cap", + "class": "\\AMP_Validation_Manager", + "static": true, + "line": 562, + "end_line": 562 + }, + { + "name": "get_invalid_url_validation_errors", + "class": "\\AMP_Validated_URL_Post_Type", + "static": true, + "line": 563, + "end_line": 566 }, { - "name": "flush_rewrite_rules", - "line": 50, - "end_line": 50 + "name": "is_singular", + "class": "$wp_query", + "static": false, + "line": 574, + "end_line": 574 } ] } }, - { - "name": "amp_bootstrap_plugin", + "13": { + "name": "amp_get_slug", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 59, - "end_line": 95, + "line": 635, + "end_line": 646, "arguments": [], "doc": { - "description": "Bootstrap plugin.", - "long_description": "", + "description": "Get the slug used in AMP for the query var, endpoint, and post type support.", + "long_description": "The return value can be overridden by previously defining a AMP_QUERY_VAR constant or by adding a 'amp_query_var' filter, but *warning* this ability may be deprecated in the future. Normally the slug should be just 'amp'.", "tags": [ { "name": "since", - "content": "1.5" + "content": "0.7" }, { - "name": "internal", - "content": "" + "name": "return", + "content": "Slug used for query var, endpoint, and post type support.", + "types": [ + "string" + ] } ] }, "hooks": [ { - "name": "amp_is_enabled", - "line": 68, - "end_line": 68, + "name": "amp_query_var", + "line": 645, + "end_line": 645, "type": "filter", "arguments": [ - "true" + "defined('AMP_QUERY_VAR') ? AMP_QUERY_VAR : \\AmpProject\\AmpWP\\QueryVar::AMP" ], "doc": { - "description": "Filters whether AMP is enabled on the current site.", - "long_description": "Useful if the plugin is network activated and you want to turn it off on select sites.", + "description": "Filter the AMP query variable.", + "long_description": "Warning: This filter may become deprecated.", "tags": [ { "name": "since", - "content": "0.2" + "content": "0.3.2" }, { - "name": "since", - "content": "2.0", - "description": "Filter now runs earlier at plugins_loaded (with earliest priority) rather than at the after_setup_theme action." + "name": "param", + "content": "The AMP query variable.", + "types": [ + "string" + ], + "variable": "$query_var" } ] } @@ -3205,80 +3137,39 @@ "functions": [ { "name": "apply_filters", - "line": 68, - "end_line": 68 - }, - { - "name": "add_action", - "line": 82, - "end_line": 82 - }, - { - "name": "add_action", - "line": 84, - "end_line": 84 - }, - { - "name": "add_filter", - "line": 87, - "end_line": 87 - }, - { - "name": "add_filter", - "line": 90, - "end_line": 90 - }, - { - "name": "add_action", - "line": 92, - "end_line": 92 - }, - { - "name": "add_action", - "line": 94, - "end_line": 94 - } - ], - "methods": [ - { - "name": "register", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory::create()", - "static": false, - "line": 72, - "end_line": 72 - }, - { - "name": "create", - "class": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "static": true, - "line": 72, - "end_line": 72 + "line": 645, + "end_line": 645 }, { - "name": "init_validate_request", - "class": "\\AMP_Validation_Manager", - "static": true, - "line": 76, - "end_line": 76 + "name": "defined", + "line": 645, + "end_line": 645 } ] } }, - { - "name": "amp_init", + "15": { + "name": "amp_get_permalink", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 103, - "end_line": 226, - "arguments": [], + "line": 701, + "end_line": 770, + "arguments": [ + { + "name": "$post_id", + "default": null, + "type": "" + } + ], "doc": { - "description": "Init AMP.", + "description": "Retrieves the full AMP-specific permalink for the given post ID.", "long_description": "", "tags": [ { @@ -3286,416 +3177,481 @@ "content": "0.1" }, { - "name": "internal", - "content": "" + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" + }, + { + "name": "return", + "content": "AMP permalink.", + "types": [ + "string" + ] } ] }, "hooks": [ { - "name": "amp_init", - "line": 110, - "end_line": 110, - "type": "action", - "arguments": [], + "name": "amp_pre_get_permalink", + "line": 723, + "end_line": 723, + "type": "filter", + "arguments": [ + "false", + "$post_id" + ], "doc": { - "description": "Triggers on init when AMP plugin is active.", - "long_description": "", + "description": "Filters the AMP permalink to short-circuit normal generation.", + "long_description": "Returning a non-false value in this filter will cause the `get_permalink()` to get called and the `amp_get_permalink` filter to not apply.", "tags": [ { "name": "since", - "content": "0.3" + "content": "0.4" + }, + { + "name": "since", + "content": "1.0", + "description": "This filter does not apply when 'amp' theme support is present." + }, + { + "name": "param", + "content": "Short-circuited URL.", + "types": [ + "false" + ], + "variable": "$url" + }, + { + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" } ] } }, { - "name": "amp_plugin_update", - "line": 172, - "end_line": 172, - "type": "action", + "name": "amp_get_permalink", + "line": 769, + "end_line": 769, + "type": "filter", "arguments": [ - "$old_version" + "$amp_url", + "$post_id" ], "doc": { - "description": "Triggers when after amp_init when the plugin version has updated.", + "description": "Filters AMP permalink.", "long_description": "", "tags": [ + { + "name": "since", + "content": "0.2" + }, + { + "name": "since", + "content": "1.0", + "description": "This filter does not apply when 'amp' theme support is present." + }, { "name": "param", - "content": "Old version.", + "content": "AMP URL.", "types": [ - "string" + "false" ], - "variable": "$old_version" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "do_action", - "line": 110, - "end_line": 110 - }, - { - "name": "add_filter", - "line": 112, - "end_line": 112 - }, - { - "name": "add_action", - "line": 119, - "end_line": 119 - }, + "variable": "$amp_url" + }, + { + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" + } + ] + } + } + ], + "uses": { + "functions": [ { - "name": "add_action", - "line": 120, - "end_line": 120 + "name": "amp_is_legacy", + "line": 704, + "end_line": 704 }, { - "name": "add_action", - "line": 121, - "end_line": 121 + "name": "get_permalink", + "line": 705, + "end_line": 705 }, { - "name": "add_action", - "line": 122, - "end_line": 122 + "name": "amp_is_canonical", + "line": 706, + "end_line": 706 }, { - "name": "add_rewrite_endpoint", - "line": 124, - "end_line": 124 + "name": "add_query_arg", + "line": 707, + "end_line": 707 }, { "name": "amp_get_slug", - "line": 124, - "end_line": 124 - }, - { - "name": "add_action", - "line": 125, - "end_line": 125 - }, - { - "name": "add_action", - "line": 126, - "end_line": 126 - }, - { - "name": "add_action", - "line": 128, - "end_line": 137 - }, - { - "name": "is_admin", - "line": 132, - "end_line": 132 - }, - { - "name": "wp_style_is", - "line": 132, - "end_line": 132 - }, - { - "name": "wp_styles", - "line": 133, - "end_line": 133 - }, - { - "name": "wp_enqueue_style", - "line": 134, - "end_line": 134 + "line": 707, + "end_line": 707 }, { - "name": "add_action", - "line": 139, - "end_line": 139 + "name": "apply_filters", + "line": 723, + "end_line": 723 }, { - "name": "add_filter", - "line": 140, - "end_line": 140 + "name": "get_permalink", + "line": 729, + "end_line": 729 }, { - "name": "add_filter", - "line": 143, - "end_line": 143 + "name": "amp_is_canonical", + "line": 731, + "end_line": 731 }, { - "name": "defined", - "line": 145, - "end_line": 145 + "name": "wp_parse_url", + "line": 734, + "end_line": 734 }, { - "name": "class_exists", - "line": 146, - "end_line": 146 + "name": "get_permalink", + "line": 734, + "end_line": 734 }, { "name": "get_option", - "line": 159, - "end_line": 159 - }, - { - "name": "is_admin", - "line": 162, - "end_line": 162 + "line": 735, + "end_line": 735 }, { - "name": "current_user_can", - "line": 162, - "end_line": 162 + "name": "is_post_type_hierarchical", + "line": 744, + "end_line": 744 }, { - "name": "add_action", - "line": 164, - "end_line": 176 + "name": "get_post_type", + "line": 744, + "end_line": 744 }, { - "name": "do_action", - "line": 172, - "end_line": 172 + "name": "get_post_type", + "line": 747, + "end_line": 747 }, { - "name": "add_action", - "line": 179, - "end_line": 187 + "name": "add_query_arg", + "line": 750, + "end_line": 750 }, { - "name": "add_action", - "line": 195, - "end_line": 225 + "name": "amp_get_slug", + "line": 750, + "end_line": 750 }, { - "name": "amp_is_dev_mode", - "line": 198, - "end_line": 198 + "name": "preg_replace", + "line": 752, + "end_line": 752 }, { - "name": "is_admin_bar_showing", - "line": 198, - "end_line": 198 - } - ], - "methods": [ - { - "name": "purge_amp_query_vars", - "class": "\\AMP_HTTP", - "static": true, - "line": 113, - "end_line": 113 + "name": "trailingslashit", + "line": 753, + "end_line": 753 }, { - "name": "send_cors_headers", - "class": "\\AMP_HTTP", - "static": true, - "line": 114, - "end_line": 114 + "name": "user_trailingslashit", + "line": 753, + "end_line": 753 }, { - "name": "handle_xhr_request", - "class": "\\AMP_HTTP", - "static": true, - "line": 115, - "end_line": 115 + "name": "amp_get_slug", + "line": 753, + "end_line": 753 }, { - "name": "init", - "class": "\\AMP_Theme_Support", - "static": true, - "line": 116, - "end_line": 116 - }, + "name": "apply_filters", + "line": 769, + "end_line": 769 + } + ] + } + }, + "16": { + "name": "amp_remove_endpoint", + "namespace": "global", + "aliases": { + "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", + "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", + "Icon": "\\AmpProject\\AmpWP\\Icon", + "Option": "\\AmpProject\\AmpWP\\Option", + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" + }, + "line": 780, + "end_line": 789, + "arguments": [ + { + "name": "$url", + "default": null, + "type": "" + } + ], + "doc": { + "description": "Remove the AMP endpoint (and query var) from a given URL.", + "long_description": "", + "tags": [ { - "name": "init", - "class": "\\AMP_Validation_Manager", - "static": true, - "line": 117, - "end_line": 117 + "name": "since", + "content": "0.7" }, { - "name": "init", - "class": "\\AMP_Service_Worker", - "static": true, - "line": 118, - "end_line": 118 + "name": "param", + "content": "URL.", + "types": [ + "string" + ], + "variable": "$url" }, { - "name": "add_command", - "class": "\\WP_CLI", - "static": true, - "line": 147, - "end_line": 147 - }, + "name": "return", + "content": "URL with AMP stripped.", + "types": [ + "string" + ] + } + ] + }, + "hooks": [], + "uses": { + "functions": [ { - "name": "add_command", - "class": "\\WP_CLI", - "static": true, - "line": 150, - "end_line": 150 + "name": "preg_replace", + "line": 783, + "end_line": 783 }, { - "name": "update_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 173, - "end_line": 173 + "name": "preg_quote", + "line": 783, + "end_line": 783 }, { - "name": "__construct", - "class": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "static": false, - "line": 182, - "end_line": 182 + "name": "amp_get_slug", + "line": 783, + "end_line": 783 }, { - "name": "__construct", - "class": "\\AMP_Reader_Theme_REST_Controller", - "static": false, - "line": 184, - "end_line": 184 + "name": "remove_query_arg", + "line": 786, + "end_line": 786 }, { - "name": "register_routes", - "class": "$reader_theme_controller", - "static": false, - "line": 185, - "end_line": 185 + "name": "amp_get_slug", + "line": 786, + "end_line": 786 } ] } }, - { - "name": "amp_after_setup_theme", + "17": { + "name": "amp_add_amphtml_link", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 237, - "end_line": 257, + "line": 798, + "end_line": 848, "arguments": [], "doc": { - "description": "Set up AMP.", - "long_description": "This function must be invoked through the 'after_setup_theme' action to allow the AMP setting to declare the post types support earlier than plugins\/theme.", + "description": "Add amphtml link.", + "long_description": "If there are known validation errors for the current URL then do not output anything.", "tags": [ { "name": "since", - "content": "0.6" - }, - { - "name": "internal", - "content": "" + "content": "1.0" } ] }, "hooks": [ { - "name": "amp_is_enabled", - "line": 241, - "end_line": 241, - "type": "filter", + "name": "amp_frontend_show_canonical", + "line": 815, + "end_line": 828, + "type": "filter_deprecated", "arguments": [ - "true" + "array(true)", + "'2.0'", + "''", + "sprintf(esc_html__('Removal of %1$s link should be done by removing %2$s from the %3$s action at %4$s.', 'amp'), 'amphtml', __FUNCTION__ . '()', 'wp_head', 'template_redirect')" ], "doc": { - "description": "This filter is documented in includes\/amp-helper-functions.php", - "long_description": "", - "tags": [] + "description": "Filters whether to show the amphtml link on the frontend.", + "long_description": "This is deprecated since the name was wrong and the use case is not clear. To remove this from being printed, instead of using the filter you can rather do:\n add_action( 'template_redirect', static function () { remove_action( 'wp_head', 'amp_add_amphtml_link' ); } );", + "tags": [ + { + "name": "since", + "content": "0.2" + }, + { + "name": "deprecated", + "content": "Remove amp_add_amphtml_link() call on wp_head action instead.", + "description": "Remove amp_add_amphtml_link() call on wp_head action instead." + } + ] } } ], "uses": { "functions": [ + { + "name": "amp_is_canonical", + "line": 800, + "end_line": 800 + }, + { + "name": "apply_filters_deprecated", + "line": 815, + "end_line": 828 + }, + { + "name": "sprintf", + "line": 820, + "end_line": 827 + }, + { + "name": "esc_html__", + "line": 822, + "end_line": 822 + }, + { + "name": "amp_is_available", + "line": 833, + "end_line": 833 + }, + { + "name": "printf", + "line": 834, + "end_line": 834 + }, + { + "name": "esc_html__", + "line": 834, + "end_line": 834 + }, + { + "name": "add_query_arg", + "line": 839, + "end_line": 839 + }, { "name": "amp_get_slug", - "line": 238, - "end_line": 238 + "line": 839, + "end_line": 839 }, { - "name": "apply_filters", - "line": 241, - "end_line": 241 + "name": "amp_get_current_url", + "line": 839, + "end_line": 839 }, { - "name": "_doing_it_wrong", - "line": 242, - "end_line": 253 + "name": "amp_get_permalink", + "line": 841, + "end_line": 841 }, { - "name": "esc_html", - "line": 244, - "end_line": 251 + "name": "get_queried_object_id", + "line": 841, + "end_line": 841 }, { - "name": "sprintf", - "line": 245, - "end_line": 250 + "name": "remove_query_arg", + "line": 845, + "end_line": 845 }, { - "name": "__", - "line": 247, - "end_line": 247 + "name": "printf", + "line": 846, + "end_line": 846 }, { - "name": "add_action", - "line": 256, - "end_line": 256 + "name": "esc_url", + "line": 846, + "end_line": 846 + } + ], + "methods": [ + { + "name": "is_paired_available", + "class": "\\AMP_Theme_Support", + "static": true, + "line": 838, + "end_line": 838 } ] } }, - { - "name": "amp_force_query_var_value", + "18": { + "name": "amp_is_post_supported", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 270, - "end_line": 275, + "line": 859, + "end_line": 861, "arguments": [ { - "name": "$query_vars", + "name": "$post", "default": null, "type": "" } ], "doc": { - "description": "Make sure the `amp` query var has an explicit value.", - "long_description": "This avoids issues when filtering the deprecated `query_string` hook.", + "description": "Determine whether a given post supports AMP.", + "long_description": "", "tags": [ { "name": "since", - "content": "0.3.3" - }, - { - "name": "internal", - "content": "" + "content": "2.0", + "description": "Formerly known as post_supports_amp()." + }, + { + "name": "see", + "content": "", + "refers": "AMP_Post_Type_Support::get_support_errors()" }, { "name": "param", - "content": "Query vars.", + "content": "Post.", "types": [ - "array" + "\\WP_Post" ], - "variable": "$query_vars" + "variable": "$post" }, { "name": "return", - "content": "Query vars.", + "content": "Whether the post supports AMP.", "types": [ - "array" + "bool" ] } ] @@ -3704,230 +3660,211 @@ "uses": { "functions": [ { - "name": "amp_get_slug", - "line": 271, - "end_line": 271 - }, - { - "name": "amp_get_slug", - "line": 271, - "end_line": 271 - }, + "name": "count", + "line": 860, + "end_line": 860 + } + ], + "methods": [ { - "name": "amp_get_slug", - "line": 272, - "end_line": 272 + "name": "get_support_errors", + "class": "\\AMP_Post_Type_Support", + "static": true, + "line": 860, + "end_line": 860 } ] } }, - { - "name": "amp_correct_query_when_is_front_page", + "19": { + "name": "post_supports_amp", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 289, - "end_line": 316, + "line": 874, + "end_line": 876, "arguments": [ { - "name": "$query", + "name": "$post", "default": null, - "type": "\\WP_Query" + "type": "" } ], "doc": { - "description": "Fix up WP_Query for front page when amp query var is present.", - "long_description": "Normally the front page would not get served if a query var is present other than preview, page, paged, and cpage.", + "description": "Determine whether a given post supports AMP.", + "long_description": "", "tags": [ { "name": "since", - "content": "0.6" + "content": "0.1" }, { - "name": "internal", - "content": "" + "name": "since", + "content": "0.6", + "description": "Returns false when post has meta to disable AMP." }, { - "name": "see", - "content": "", - "refers": "WP_Query::parse_query()" + "name": "since", + "content": "2.0", + "description": "Renamed to AMP-prefixed version, amp_is_post_supported()." }, { - "name": "link", - "content": "https:\/\/github.com\/WordPress\/wordpress-develop\/blob\/0baa8ae85c670d338e78e408f8d6e301c6410c86\/src\/wp-includes\/class-wp-query.php#L951-L971", - "link": "https:\/\/github.com\/WordPress\/wordpress-develop\/blob\/0baa8ae85c670d338e78e408f8d6e301c6410c86\/src\/wp-includes\/class-wp-query.php#L951-L971" + "name": "deprecated", + "content": "Use amp_is_post_supported() instead.", + "description": "Use amp_is_post_supported() instead." }, { "name": "param", - "content": "Query.", + "content": "Post.", "types": [ - "\\WP_Query" + "\\WP_Post" ], - "variable": "$query" + "variable": "$post" + }, + { + "name": "return", + "content": "Whether the post supports AMP.", + "types": [ + "bool" + ] } ] }, "hooks": [], "uses": { - "methods": [ - { - "name": "is_main_query", - "class": "$query", - "static": false, - "line": 291, - "end_line": 291 - }, - { - "name": "is_home", - "class": "$query", - "static": false, - "line": 293, - "end_line": 293 - }, - { - "name": "get", - "class": "$query", - "static": false, - "line": 296, - "end_line": 296 - }, - { - "name": "is_front_page", - "class": "$query", - "static": false, - "line": 299, - "end_line": 299 - }, - { - "name": "set", - "class": "$query", - "static": false, - "line": 314, - "end_line": 314 - } - ], "functions": [ { - "name": "amp_get_slug", - "line": 296, - "end_line": 296 - }, - { - "name": "get_option", - "line": 302, - "end_line": 302 - }, - { - "name": "get_option", - "line": 305, - "end_line": 305 - }, - { - "name": "count", - "line": 308, - "end_line": 308 - }, - { - "name": "array_diff", - "line": 308, - "end_line": 308 - }, - { - "name": "array_keys", - "line": 308, - "end_line": 308 - }, - { - "name": "wp_parse_args", - "line": 308, - "end_line": 308 - }, - { - "name": "amp_get_slug", - "line": 308, - "end_line": 308 - }, - { - "name": "get_option", - "line": 314, - "end_line": 314 + "name": "amp_is_post_supported", + "line": 875, + "end_line": 875 } ] } }, - { - "name": "amp_is_canonical", + "20": { + "name": "amp_is_request", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 363, - "end_line": 365, + "line": 892, + "end_line": 925, "arguments": [], "doc": { - "description": "Whether this is in 'canonical mode'.", - "long_description": "Themes can register support for this with `add_theme_support( AMP_Theme_Support::SLUG )`:\n add_theme_support( AMP_Theme_Support::SLUG );\n This will serve templates in AMP-first, allowing you to use AMP components in your theme templates. If you want to make available in transitional mode, where templates are served in AMP or non-AMP documents, do:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'paired' => true, ) );\n Transitional mode is also implied if you define a template_dir:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'template_dir' => 'amp', ) );\n If you want to have AMP-specific templates in addition to serving AMP-first, do:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'paired' => false, 'template_dir' => 'amp', ) );\n If you want to force AMP to always be served on a given template, you can use the templates_supported arg, for example to always serve the Category template in AMP:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'templates_supported' => array( 'is_category' => true, ), ) );\n Or if you want to force AMP to be used on all templates:\n add_theme_support( AMP_Theme_Support::SLUG, array( 'templates_supported' => 'all', ) );", + "description": "Determine whether the current request is for an AMP page.", + "long_description": "This function cannot be called before the parse_query action because it needs to be able to determine the queried object is able to be served as AMP. If 'amp' theme support is not present, this function returns true just if the query var is present. If theme support is present, then it returns true in transitional mode if an AMP template is available and the query var is present, or else in standard mode if just the template is available.", "tags": [ { - "name": "see", - "content": "", - "refers": "AMP_Theme_Support::read_theme_support()" + "name": "since", + "content": "2.0", + "description": "Formerly known as is_amp_endpoint()." }, { "name": "return", - "content": "Whether this is in AMP 'canonical' mode, that is whether it is AMP-first and there is not a separate (paired) AMP URL.", + "content": "Whether it is the AMP endpoint.", "types": [ - "boolean" + "bool" ] + }, + { + "name": "global", + "content": "WP_Query $wp_query" } ] }, "hooks": [], "uses": { + "functions": [ + { + "name": "amp_is_canonical", + "line": 900, + "end_line": 900 + }, + { + "name": "amp_get_slug", + "line": 902, + "end_line": 902 + }, + { + "name": "amp_get_slug", + "line": 907, + "end_line": 907 + }, + { + "name": "amp_is_available", + "line": 912, + "end_line": 912 + }, + { + "name": "did_action", + "line": 917, + "end_line": 917 + } + ], "methods": [ + { + "name": "get", + "class": "$wp_query", + "static": false, + "line": 907, + "end_line": 907 + }, { "name": "get_option", "class": "\\AMP_Options_Manager", "static": true, - "line": 364, - "end_line": 364 + "line": 918, + "end_line": 918 } ] } }, - { - "name": "amp_is_legacy", + "21": { + "name": "is_amp_endpoint", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 373, - "end_line": 384, + "line": 942, + "end_line": 944, "arguments": [], "doc": { - "description": "Determines whether the legacy AMP post templates are being used.", - "long_description": "", + "description": "Determine whether the current response being served as AMP.", + "long_description": "This function cannot be called before the parse_query action because it needs to be able to determine the queried object is able to be served as AMP. If 'amp' theme support is not present, this function returns true just if the query var is present. If theme support is present, then it returns true in transitional mode if an AMP template is available and the query var is present, or else in standard mode if just the template is available.", "tags": [ { "name": "since", - "content": "2.0" + "content": "0.1" + }, + { + "name": "since", + "content": "2.0", + "description": "Renamed to AMP-prefixed version, amp_is_request()." + }, + { + "name": "deprecated", + "content": "Use amp_is_request() instead.", + "description": "Use amp_is_request() instead." }, { "name": "return", - "content": "", + "content": "Whether it is the AMP endpoint.", "types": [ "bool" ] @@ -3936,111 +3873,168 @@ }, "hooks": [], "uses": { - "methods": [ - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 374, - "end_line": 374 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 378, - "end_line": 378 - }, - { - "name": "exists", - "class": "wp_get_theme($reader_theme)", - "static": false, - "line": 383, - "end_line": 383 - } - ], "functions": [ { - "name": "wp_get_theme", - "line": 383, - "end_line": 383 + "name": "amp_is_request", + "line": 943, + "end_line": 943 } ] } }, - { - "name": "amp_add_frontend_actions", + "34": { + "name": "amp_is_dev_mode", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 392, - "end_line": 394, + "line": 1440, + "end_line": 1463, "arguments": [], "doc": { - "description": "Add frontend actions.", - "long_description": "", + "description": "Determine whether AMP dev mode is enabled.", + "long_description": "When enabled, the element will get the data-ampdevmode attribute and the plugin will add the same attribute to elements associated with the admin bar and other elements that are provided by the `amp_dev_mode_element_xpaths` filter.", "tags": [ { "name": "since", - "content": "0.2" + "content": "1.3" }, { - "name": "internal", - "content": "" + "name": "return", + "content": "Whether AMP dev mode is enabled.", + "types": [ + "bool" + ] } ] }, - "hooks": [], + "hooks": [ + { + "name": "amp_dev_mode_enabled", + "line": 1452, + "end_line": 1462, + "type": "filter", + "arguments": [ + "is_admin_bar_showing() && is_user_logged_in() || is_customize_preview()" + ], + "doc": { + "description": "Filters whether AMP mode is enabled.", + "long_description": "When enabled, the data-ampdevmode attribute will be added to the document element and it will allow the attributes to be added to the admin bar. It will also add the attribute to all elements which match the queries for the expressions returned by the 'amp_dev_mode_element_xpaths' filter.", + "tags": [ + { + "name": "since", + "content": "1.3" + }, + { + "name": "param", + "content": "Whether AMP dev mode is enabled.", + "types": [ + "bool" + ], + "variable": "" + } + ] + } + } + ], "uses": { "functions": [ { - "name": "add_action", - "line": 393, - "end_line": 393 + "name": "apply_filters", + "line": 1452, + "end_line": 1462 + }, + { + "name": "is_admin_bar_showing", + "line": 1458, + "end_line": 1458 + }, + { + "name": "is_user_logged_in", + "line": 1458, + "end_line": 1458 + }, + { + "name": "is_customize_preview", + "line": 1460, + "end_line": 1460 } ] } }, - { - "name": "amp_is_available", + "42": { + "name": "amp_generate_script_hash", "namespace": "global", "aliases": { "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", "Icon": "\\AmpProject\\AmpWP\\Icon", "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + "QueryVar": "\\AmpProject\\AmpWP\\QueryVar", + "Services": "\\AmpProject\\AmpWP\\Services" }, - "line": 405, - "end_line": 543, - "arguments": [], + "line": 1974, + "end_line": 1985, + "arguments": [ + { + "name": "$script", + "default": null, + "type": "" + } + ], "doc": { - "description": "Determine whether AMP is available for the current URL.", - "long_description": "", + "description": "Generate hash for inline amp-script.", + "long_description": "The sha384 hash used by amp-script is represented not as hexadecimal but as base64url, which is defined in RFC 4648 under section 5, \"Base 64 Encoding with URL and Filename Safe Alphabet\". It is sometimes referred to as \"web safe\".", "tags": [ { "name": "since", - "content": "2.0" + "content": "1.4.0" }, { - "name": "return", - "content": "Whether there is an AMP version for the provided URL.", - "types": [ - "bool" - ] + "name": "link", + "content": "https:\/\/amp.dev\/documentation\/components\/amp-script\/#security-features", + "link": "https:\/\/amp.dev\/documentation\/components\/amp-script\/#security-features" }, { - "name": "global", - "content": "string $pagenow" + "name": "link", + "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/e8707858895c2af25903af25d396e144e64690ba\/extensions\/amp-script\/0.1\/amp-script.js#L401-L425", + "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/e8707858895c2af25903af25d396e144e64690ba\/extensions\/amp-script\/0.1\/amp-script.js#L401-L425" }, { - "name": "global", - "content": "WP_Query $wp_query" + "name": "link", + "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/27b46b9c8c0fb3711a00376668d808f413d798ed\/src\/service\/crypto-impl.js#L67-L124", + "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/27b46b9c8c0fb3711a00376668d808f413d798ed\/src\/service\/crypto-impl.js#L67-L124" + }, + { + "name": "link", + "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/c4a663d0ba13d0488c6fe73c55dc8c971ac6ec0d\/src\/utils\/base64.js#L52-L61", + "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/c4a663d0ba13d0488c6fe73c55dc8c971ac6ec0d\/src\/utils\/base64.js#L52-L61" + }, + { + "name": "link", + "content": "https:\/\/tools.ietf.org\/html\/rfc4648#section-5", + "link": "https:\/\/tools.ietf.org\/html\/rfc4648#section-5" + }, + { + "name": "param", + "content": "Script.", + "types": [ + "string" + ], + "variable": "$script" + }, + { + "name": "return", + "content": "Script hash or null if the sha384 algorithm is not supported.", + "types": [ + "string", + "null" + ] } ] }, @@ -4048,1435 +4042,1372 @@ "uses": { "functions": [ { - "name": "is_admin", - "line": 409, - "end_line": 409 + "name": "hash", + "line": 1975, + "end_line": 1975 }, { - "name": "in_array", - "line": 409, - "end_line": 409 + "name": "str_replace", + "line": 1979, + "end_line": 1983 }, { - "name": "sprintf", - "line": 418, - "end_line": 428 - }, + "name": "base64_encode", + "line": 1982, + "end_line": 1982 + } + ] + } + } + }, + "hooks": { + "0": { + "name": "amp_is_enabled", + "line": 69, + "end_line": 69, + "type": "filter", + "arguments": [ + "true" + ], + "doc": { + "description": "Filters whether AMP is enabled on the current site.", + "long_description": "Useful if the plugin is network activated and you want to turn it off on select sites.", + "tags": [ { - "name": "__", - "line": 420, - "end_line": 420 + "name": "since", + "content": "0.2" }, { - "name": "current_action", - "line": 424, - "end_line": 424 - }, + "name": "since", + "content": "2.0", + "description": "Filter now runs earlier at plugins_loaded (with earliest priority) rather than at the after_setup_theme action." + } + ] + } + }, + "1": { + "name": "amp_init", + "line": 111, + "end_line": 111, + "type": "action", + "arguments": [], + "doc": { + "description": "Triggers on init when AMP plugin is active.", + "long_description": "", + "tags": [ { - "name": "_doing_it_wrong", - "line": 429, - "end_line": 429 - }, + "name": "since", + "content": "0.3" + } + ] + } + }, + "2": { + "name": "amp_plugin_update", + "line": 173, + "end_line": 173, + "type": "action", + "arguments": [ + "$old_version" + ], + "doc": { + "description": "Triggers when after amp_init when the plugin version has updated.", + "long_description": "", + "tags": [ { - "name": "esc_html", - "line": 429, - "end_line": 429 - }, + "name": "param", + "content": "Old version.", + "types": [ + "string" + ], + "variable": "$old_version" + } + ] + } + }, + "4": { + "name": "amp_query_var", + "line": 645, + "end_line": 645, + "type": "filter", + "arguments": [ + "defined('AMP_QUERY_VAR') ? AMP_QUERY_VAR : \\AmpProject\\AmpWP\\QueryVar::AMP" + ], + "doc": { + "description": "Filter the AMP query variable.", + "long_description": "Warning: This filter may become deprecated.", + "tags": [ { - "name": "did_action", - "line": 434, - "end_line": 434 + "name": "since", + "content": "0.3.2" }, { - "name": "warn", - "line": 435, - "end_line": 435 - }, + "name": "param", + "content": "The AMP query variable.", + "types": [ + "string" + ], + "variable": "$query_var" + } + ] + } + }, + "5": { + "name": "amp_pre_get_permalink", + "line": 723, + "end_line": 723, + "type": "filter", + "arguments": [ + "false", + "$post_id" + ], + "doc": { + "description": "Filters the AMP permalink to short-circuit normal generation.", + "long_description": "Returning a non-false value in this filter will cause the `get_permalink()` to get called and the `amp_get_permalink` filter to not apply.", + "tags": [ { - "name": "defined", - "line": 436, - "end_line": 436 + "name": "since", + "content": "0.4" }, { - "name": "did_action", - "line": 441, - "end_line": 441 + "name": "since", + "content": "1.0", + "description": "This filter does not apply when 'amp' theme support is present." }, { - "name": "warn", - "line": 442, - "end_line": 442 + "name": "param", + "content": "Short-circuited URL.", + "types": [ + "false" + ], + "variable": "$url" }, { - "name": "class_exists", - "line": 448, - "end_line": 448 - }, + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" + } + ] + } + }, + "6": { + "name": "amp_get_permalink", + "line": 769, + "end_line": 769, + "type": "filter", + "arguments": [ + "$amp_url", + "$post_id" + ], + "doc": { + "description": "Filters AMP permalink.", + "long_description": "", + "tags": [ { - "name": "defined", - "line": 448, - "end_line": 448 + "name": "since", + "content": "0.2" }, { - "name": "method_exists", - "line": 468, - "end_line": 468 + "name": "since", + "content": "1.0", + "description": "This filter does not apply when 'amp' theme support is present." }, { - "name": "is_customize_preview", - "line": 480, - "end_line": 480 + "name": "param", + "content": "AMP URL.", + "types": [ + "false" + ], + "variable": "$amp_url" }, { - "name": "amp_is_legacy", - "line": 484, - "end_line": 484 - }, + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" + } + ] + } + }, + "7": { + "name": "amp_frontend_show_canonical", + "line": 815, + "end_line": 828, + "type": "filter_deprecated", + "arguments": [ + "array(true)", + "'2.0'", + "''", + "sprintf(esc_html__('Removal of %1$s link should be done by removing %2$s from the %3$s action at %4$s.', 'amp'), 'amphtml', __FUNCTION__ . '()', 'wp_head', 'template_redirect')" + ], + "doc": { + "description": "Filters whether to show the amphtml link on the frontend.", + "long_description": "This is deprecated since the name was wrong and the use case is not clear. To remove this from being printed, instead of using the filter you can rather do:\n add_action( 'template_redirect', static function () { remove_action( 'wp_head', 'amp_add_amphtml_link' ); } );", + "tags": [ { - "name": "did_action", - "line": 487, - "end_line": 487 + "name": "since", + "content": "0.2" }, { - "name": "warn", - "line": 488, - "end_line": 488 - }, + "name": "deprecated", + "content": "Remove amp_add_amphtml_link() call on wp_head action instead.", + "description": "Remove amp_add_amphtml_link() call on wp_head action instead." + } + ] + } + }, + "8": { + "name": "amp_analytics_entries", + "line": 1278, + "end_line": 1278, + "type": "filter", + "arguments": [ + "$analytics_entries" + ], + "doc": { + "description": "Add amp-analytics tags.", + "long_description": "This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting. This filter should be used to alter entries for transitional mode.", + "tags": [ { - "name": "amp_is_canonical", - "line": 494, - "end_line": 494 + "name": "since", + "content": "0.7" }, { - "name": "get_queried_object", - "line": 511, - "end_line": 511 - }, + "name": "param", + "content": "An associative array of the analytics entries we want to output. Each array entry must have a unique key, and the value should be an array with the following keys: `type`, `attributes`, `config_data`. See readme for more details.", + "types": [ + "array" + ], + "variable": "$analytics_entries" + } + ] + } + }, + "9": { + "name": "amp_print_analytics", + "line": 1323, + "end_line": 1323, + "type": "action", + "arguments": [ + "$analytics_entries" + ], + "doc": { + "description": "Triggers before analytics entries are printed as amp-analytics tags.", + "long_description": "This is useful for printing additional `amp-analytics` tags to the page without having to refactor any existing markup generation logic to use the data structure mutated by the `amp_analytics_entries` filter. For such cases, this action should be used for printing `amp-analytics` tags as opposed to using the `wp_footer` and `amp_post_template_footer` actions.", + "tags": [ { - "name": "amp_is_canonical", - "line": 523, - "end_line": 523 + "name": "since", + "content": "1.3" }, { - "name": "amp_get_current_url", - "line": 525, - "end_line": 525 + "name": "param", + "content": "Analytics entries, already potentially modified by the amp_analytics_entries filter.", + "types": [ + "array" + ], + "variable": "$analytics_entries" + } + ] + } + }, + "10": { + "name": "amp_content_embed_handlers", + "line": 1400, + "end_line": 1426, + "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())", + "$post" + ], + "doc": { + "description": "Filters the content embed handlers.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "0.2" }, { - "name": "count", - "line": 528, - "end_line": 528 + "name": "since", + "content": "0.7", + "description": "Deprecated $post parameter." }, { - "name": "amp_is_post_supported", - "line": 536, - "end_line": 536 - } - ], - "methods": [ - { - "name": "get", - "class": "$wp_query", - "static": false, - "line": 448, - "end_line": 448 - }, - { - "name": "is_embed", - "class": "$wp_query", - "static": false, - "line": 458, - "end_line": 458 - }, - { - "name": "is_feed", - "class": "$wp_query", - "static": false, - "line": 460, - "end_line": 460 - }, - { - "name": "is_comment_feed", - "class": "$wp_query", - "static": false, - "line": 462, - "end_line": 462 - }, - { - "name": "is_trackback", - "class": "$wp_query", - "static": false, - "line": 464, - "end_line": 464 - }, - { - "name": "is_robots", - "class": "$wp_query", - "static": false, - "line": 466, - "end_line": 466 - }, - { - "name": "is_favicon", - "class": "$wp_query", - "static": false, - "line": 468, - "end_line": 468 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 476, - "end_line": 476 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 478, - "end_line": 478 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 489, - "end_line": 489 - }, - { - "name": "has_cap", - "class": "\\AMP_Validation_Manager", - "static": true, - "line": 494, - "end_line": 494 - }, - { - "name": "is_theme_support_forced", - "class": "\\AMP_Validation_Manager", - "static": true, - "line": 507, - "end_line": 507 - }, - { - "name": "get_template_availability", - "class": "\\AMP_Theme_Support", - "static": true, - "line": 514, - "end_line": 514 + "name": "param", + "content": "Handlers.", + "types": [ + "array" + ], + "variable": "$handlers" }, { - "name": "has_cap", - "class": "\\AMP_Validation_Manager", - "static": true, - "line": 523, - "end_line": 523 - }, + "name": "param", + "content": "Post. Deprecated. It will be null when `amp_is_canonical()`.", + "types": [ + "\\WP_Post" + ], + "variable": "$post" + } + ] + } + }, + "11": { + "name": "amp_dev_mode_enabled", + "line": 1452, + "end_line": 1462, + "type": "filter", + "arguments": [ + "is_admin_bar_showing() && is_user_logged_in() || is_customize_preview()" + ], + "doc": { + "description": "Filters whether AMP mode is enabled.", + "long_description": "When enabled, the data-ampdevmode attribute will be added to the document element and it will allow the attributes to be added to the admin bar. It will also add the attribute to all elements which match the queries for the expressions returned by the 'amp_dev_mode_element_xpaths' filter.", + "tags": [ { - "name": "get_invalid_url_validation_errors", - "class": "\\AMP_Validated_URL_Post_Type", - "static": true, - "line": 524, - "end_line": 527 + "name": "since", + "content": "1.3" }, { - "name": "is_singular", - "class": "$wp_query", - "static": false, - "line": 535, - "end_line": 535 + "name": "param", + "content": "Whether AMP dev mode is enabled.", + "types": [ + "bool" + ], + "variable": "" } ] } }, - { - "name": "_amp_bootstrap_customizer", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 557, - "end_line": 559, - "arguments": [], + "12": { + "name": "amp_to_amp_linking_enabled", + "line": 1504, + "end_line": 1507, + "type": "filter", + "arguments": [ + "\\AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === \\AMP_Options_Manager::get_option(\\AmpProject\\AmpWP\\Option::THEME_SUPPORT)" + ], "doc": { - "description": "Bootstraps the AMP customizer.", - "long_description": "Uses the priority of 12 for the 'after_setup_theme' action. Many themes run `add_theme_support()` on the 'after_setup_theme' hook, at the default priority of 10. And that function's documentation suggests adding it to that action. So this enables themes to `add_theme_support( AMP_Theme_Support::SLUG )`. And `amp_init_customizer()` will be able to recognize theme support by calling `amp_is_canonical()`.", + "description": "Filters whether AMP-to-AMP linking should be enabled.", + "long_description": "", "tags": [ { "name": "since", - "content": "0.4" + "content": "1.4.0" }, { - "name": "internal", - "content": "" + "name": "param", + "content": "Whether AMP-to-AMP linking should be enabled.", + "types": [ + "bool" + ], + "variable": "$amp_to_amp_linking_enabled" } ] - }, - "hooks": [], - "uses": { - "functions": [ + } + }, + "13": { + "name": "amp_to_amp_excluded_urls", + "line": 1571, + "end_line": 1571, + "type": "filter", + "arguments": [ + "array()" + ], + "doc": { + "description": "Filters the list of URLs which are excluded from being included in AMP-to-AMP linking.", + "long_description": "This only applies when the amp_to_amp_linking_enabled filter returns true, which it does by default in Transitional mode. This filter can be used to opt-in when in Reader mode. This does not apply in Standard mode. Only frontend URLs on the frontend need be excluded, as all other URLs are never made into AMP links.", + "tags": [ { - "name": "add_action", - "line": 558, - "end_line": 558 + "name": "since", + "content": "1.5.0" + }, + { + "name": "param", + "content": "The URLs to exclude from having AMP-to-AMP links.", + "types": [ + "string[]" + ], + "variable": "$excluded_urls" } ] } }, - { - "name": "amp_redirect_old_slug_to_new_url", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 572, - "end_line": 583, + "14": { + "name": "amp_content_sanitizers", + "line": 1588, + "end_line": 1588, + "type": "filter", "arguments": [ - { - "name": "$link", - "default": null, - "type": "" - } + "$sanitizers", + "$post" ], "doc": { - "description": "Redirects the old AMP URL to the new AMP URL.", - "long_description": "If post slug is updated the amp page with old post slug will be redirected to the updated url.", + "description": "Filters the content sanitizers.", + "long_description": "", "tags": [ { "name": "since", - "content": "0.5" + "content": "0.2" }, { - "name": "internal", - "content": "" + "name": "since", + "content": "0.7", + "description": "Deprecated $post parameter. It will be null when `amp_is_canonical()`." }, { "name": "param", - "content": "New URL of the post.", + "content": "Handlers.", "types": [ - "string" + "array" ], - "variable": "$link" + "variable": "$handlers" }, { - "name": "return", - "content": "URL to be redirected.", + "name": "param", + "content": "Post. Deprecated.", "types": [ - "string" - ] + "\\WP_Post" + ], + "variable": "$post" } ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_is_request", - "line": 574, - "end_line": 574 - }, - { - "name": "amp_is_canonical", - "line": 574, - "end_line": 574 - }, - { - "name": "amp_is_legacy", - "line": 575, - "end_line": 575 - }, - { - "name": "add_query_arg", - "line": 576, - "end_line": 576 - }, + } + }, + "15": { + "name": "amp_dev_mode_element_xpaths", + "line": 1601, + "end_line": 1601, + "type": "filter", + "arguments": [ + "array()" + ], + "doc": { + "description": "Filters the XPath queries for elements that should be enabled for dev mode.", + "long_description": "By supplying XPath queries to this filter, the data-ampdevmode attribute will automatically be added to the root HTML element as well as to any elements that match the expressions. The attribute is added to the elements prior to running any of the sanitizers.", + "tags": [ { - "name": "amp_get_slug", - "line": 576, - "end_line": 576 + "name": "since", + "content": "1.3" }, { - "name": "trailingslashit", - "line": 578, - "end_line": 578 - }, + "name": "param", + "content": "XPath element queries. Context is the root element.", + "types": [ + "string[]" + ], + "variable": "$element_xpaths" + } + ] + } + }, + "16": { + "name": "amp_parsed_css_transient_caching_allowed", + "line": 1641, + "end_line": 1641, + "type": "filter", + "arguments": [ + "true" + ], + "doc": { + "description": "Filters whether parsed CSS is allowed to be cached in transients.", + "long_description": "When this is filtered to be false, parsed CSS will not be stored in transients. This is important when there is highly-variable CSS content in order to prevent filling up the wp_options table with an endless number of entries.", + "tags": [ { - "name": "trailingslashit", - "line": 578, - "end_line": 578 + "name": "since", + "content": "1.5.0" }, { - "name": "amp_get_slug", - "line": 578, - "end_line": 578 + "name": "param", + "content": "Transient caching allowed.", + "types": [ + "bool" + ], + "variable": "$transient_caching_allowed" } ] } }, - { - "name": "amp_get_slug", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 596, - "end_line": 607, - "arguments": [], + "17": { + "name": "amp_site_icon_url", + "line": 1769, + "end_line": 1769, + "type": "filter", + "arguments": [ + "$logo_image_url" + ], "doc": { - "description": "Get the slug used in AMP for the query var, endpoint, and post type support.", - "long_description": "The return value can be overridden by previously defining a AMP_QUERY_VAR constant or by adding a 'amp_query_var' filter, but *warning* this ability may be deprecated in the future. Normally the slug should be just 'amp'.", + "description": "Filters the publisher logo URL in the schema.org data.", + "long_description": "Previously, this only filtered the Site Icon, as that was the only possible schema.org publisher logo. But the Custom Logo is now the preferred publisher logo, if it exists and its dimensions aren't too big.", "tags": [ { "name": "since", - "content": "0.7" + "content": "0.3" }, { - "name": "return", - "content": "Slug used for query var, endpoint, and post type support.", + "name": "param", + "content": "URL of the publisher logo, either the Custom Logo or the Site Icon.", "types": [ "string" - ] + ], + "variable": "$schema_img_url" } ] - }, - "hooks": [ - { - "name": "amp_query_var", - "line": 606, - "end_line": 606, - "type": "filter", - "arguments": [ - "defined('AMP_QUERY_VAR') ? AMP_QUERY_VAR : \\AmpProject\\AmpWP\\QueryVar::AMP" - ], - "doc": { - "description": "Filter the AMP query variable.", - "long_description": "Warning: This filter may become deprecated.", - "tags": [ - { - "name": "since", - "content": "0.3.2" - }, - { - "name": "param", - "content": "The AMP query variable.", - "types": [ - "string" - ], - "variable": "$query_var" - } - ] - } - } + } + }, + "18": { + "name": "amp_post_template_metadata", + "line": 1842, + "end_line": 1842, + "type": "filter", + "arguments": [ + "$metadata", + "$queried_object" ], - "uses": { - "functions": [ + "doc": { + "description": "Filters Schema.org metadata for a post.", + "long_description": "The 'post_template' in the filter name here is due to this filter originally being introduced in `AMP_Post_Template`. In general the `amp_schemaorg_metadata` filter should be used instead.", + "tags": [ { - "name": "apply_filters", - "line": 606, - "end_line": 606 + "name": "since", + "content": "0.3" }, { - "name": "defined", - "line": 606, - "end_line": 606 + "name": "param", + "content": "Metadata.", + "types": [ + "array" + ], + "variable": "$metadata" + }, + { + "name": "param", + "content": "Post.", + "types": [ + "\\WP_Post" + ], + "variable": "$queried_object" } ] } }, - { - "name": "amp_get_current_url", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 620, - "end_line": 652, - "arguments": [], + "19": { + "name": "amp_schemaorg_metadata", + "line": 1856, + "end_line": 1856, + "type": "filter", + "arguments": [ + "$metadata" + ], "doc": { - "description": "Get the URL for the current request.", - "long_description": "This is essentially the REQUEST_URI prefixed by the scheme and host for the home URL. This is needed in particular due to subdirectory installs.", + "description": "Filters Schema.org metadata for a query.", + "long_description": "Check the the main query for the context for which metadata should be added.", "tags": [ { "name": "since", - "content": "1.0" + "content": "0.7" }, { - "name": "internal", - "content": "" + "name": "param", + "content": "Metadata.", + "types": [ + "array" + ], + "variable": "$metadata" + } + ] + } + } + } + }, + "46": { + "file": { + "description": "Class AMP_Image_Dimension_Extractor", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/utils\/class-amp-image-dimension-extractor.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], + "hooks": [ + { + "name": "amp_extract_image_dimensions_batch", + "line": 69, + "end_line": 69, + "type": "filter", + "arguments": [ + "$extracted_dimensions" + ], + "doc": { + "description": "Filters the dimensions extracted from image URLs.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "0.5.1" }, { - "name": "return", - "content": "Current URL.", + "name": "param", + "content": "Extracted dimensions, initially mapping images URLs to false.", "types": [ - "string" - ] + "array" + ], + "variable": "$extracted_dimensions" } ] - }, - "hooks": [], - "uses": { - "functions": [ + } + }, + { + "name": "amp_normalized_dimension_extractor_image_url", + "line": 132, + "end_line": 132, + "type": "filter", + "arguments": [ + "$normalized_url", + "$url" + ], + "doc": { + "description": "Apply filters on the normalized image URL for dimension extraction.", + "long_description": "", + "tags": [ { - "name": "wp_parse_url", - "line": 621, - "end_line": 621 + "name": "since", + "content": "1.1" }, { - "name": "home_url", - "line": 621, - "end_line": 621 + "name": "param", + "content": "Normalized image URL.", + "types": [ + "string" + ], + "variable": "$normalized_url" }, { - "name": "is_array", - "line": 623, - "end_line": 623 - }, + "name": "param", + "content": "Original image URL.", + "types": [ + "string" + ], + "variable": "$url" + } + ] + } + }, + { + "name": "amp_extract_image_dimensions_batch_callbacks_registered", + "line": 150, + "end_line": 150, + "type": "action", + "arguments": [], + "doc": { + "description": "Fires after the amp_extract_image_dimensions_batch filter has been added to extract by downloading images.", + "long_description": "", + "tags": [ { - "name": "is_ssl", - "line": 628, - "end_line": 628 - }, + "name": "since", + "content": "0.5.1" + } + ] + } + }, + { + "name": "amp_extract_image_dimensions_get_user_agent", + "line": 250, + "end_line": 250, + "type": "filter", + "arguments": [ + "self::get_default_user_agent()" + ], + "doc": { + "description": "Filters the user agent for onbtaining the image dimensions.", + "long_description": "", + "tags": [ + { + "name": "param", + "content": "User agent.", + "types": [ + "string" + ], + "variable": "$user_agent" + } + ] + } + } + ] + }, + "53": { + "file": { + "description": "AMP_Post_Template class.", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/templates\/class-amp-post-template.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 485, + "type": "Include" + } + ], + "classes": [], + "hooks": { + "0": { + "name": "amp_content_max_width", + "line": 113, + "end_line": 113, + "type": "filter", + "arguments": [ + "$content_max_width" + ], + "doc": { + "description": "Filters the content max width for Reader templates.", + "long_description": "", + "tags": [ { - "name": "wp_unslash", - "line": 631, - "end_line": 631 + "name": "since", + "content": "0.2" }, { - "name": "ltrim", - "line": 649, - "end_line": 649 + "name": "param", + "content": "Content max width.", + "types": [ + "int" + ], + "variable": "$content_max_width" + } + ] + } + }, + "2": { + "name": "amp_post_template_data", + "line": 160, + "end_line": 160, + "type": "filter", + "arguments": [ + "$this->data", + "$this->post" + ], + "doc": { + "description": "Filters AMP template data.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "0.2" }, { - "name": "wp_unslash", - "line": 649, - "end_line": 649 + "name": "param", + "content": "Template data.", + "types": [ + "array" + ], + "variable": "$data" }, { - "name": "esc_url_raw", - "line": 651, - "end_line": 651 + "name": "param", + "content": "Post.", + "types": [ + "\\WP_Post" + ], + "variable": "$post" } ] } }, - { - "name": "amp_get_permalink", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 662, - "end_line": 731, + "3": { + "name": "amp_post_template_dir", + "line": 177, + "end_line": 177, + "type": "filter", "arguments": [ - { - "name": "$post_id", - "default": null, - "type": "" - } + "AMP__DIR__ . '\/templates'" ], "doc": { - "description": "Retrieves the full AMP-specific permalink for the given post ID.", + "description": "Filters the Reader template directory.", "long_description": "", "tags": [ { "name": "since", - "content": "0.1" + "content": "0.3.3" + } + ] + } + }, + "6": { + "name": "amp_post_template_customizer_settings", + "line": 428, + "end_line": 428, + "type": "filter", + "arguments": [ + "$settings", + "$this->post" + ], + "doc": { + "description": "Filter AMP Customizer settings.", + "long_description": "Inject your Customizer settings here to make them accessible via the getter in your custom style.php template.\n Example:\n echo esc_html( $this->get_customizer_setting( 'your_setting_key', 'your_default_value' ) );", + "tags": [ + { + "name": "since", + "content": "0.4" }, { "name": "param", - "content": "Post ID.", + "content": "Array of AMP Customizer settings.", "types": [ - "int" + "array" ], - "variable": "$post_id" + "variable": "$settings" }, { - "name": "return", - "content": "AMP permalink.", + "name": "param", + "content": "Current post object.", "types": [ - "string" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_pre_get_permalink", - "line": 684, - "end_line": 684, - "type": "filter", - "arguments": [ - "false", - "$post_id" - ], - "doc": { - "description": "Filters the AMP permalink to short-circuit normal generation.", - "long_description": "Returning a non-false value in this filter will cause the `get_permalink()` to get called and the `amp_get_permalink` filter to not apply.", - "tags": [ - { - "name": "since", - "content": "0.4" - }, - { - "name": "since", - "content": "1.0", - "description": "This filter does not apply when 'amp' theme support is present." - }, - { - "name": "param", - "content": "Short-circuited URL.", - "types": [ - "false" - ], - "variable": "$url" - }, - { - "name": "param", - "content": "Post ID.", - "types": [ - "int" - ], - "variable": "$post_id" - } - ] - } - }, - { - "name": "amp_get_permalink", - "line": 730, - "end_line": 730, - "type": "filter", - "arguments": [ - "$amp_url", - "$post_id" - ], - "doc": { - "description": "Filters AMP permalink.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.2" - }, - { - "name": "since", - "content": "1.0", - "description": "This filter does not apply when 'amp' theme support is present." - }, - { - "name": "param", - "content": "AMP URL.", - "types": [ - "false" - ], - "variable": "$amp_url" - }, - { - "name": "param", - "content": "Post ID.", - "types": [ - "int" - ], - "variable": "$post_id" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "amp_is_legacy", - "line": 665, - "end_line": 665 - }, - { - "name": "get_permalink", - "line": 666, - "end_line": 666 - }, - { - "name": "amp_is_canonical", - "line": 667, - "end_line": 667 - }, - { - "name": "add_query_arg", - "line": 668, - "end_line": 668 - }, - { - "name": "amp_get_slug", - "line": 668, - "end_line": 668 - }, - { - "name": "apply_filters", - "line": 684, - "end_line": 684 - }, - { - "name": "get_permalink", - "line": 690, - "end_line": 690 - }, - { - "name": "amp_is_canonical", - "line": 692, - "end_line": 692 - }, - { - "name": "wp_parse_url", - "line": 695, - "end_line": 695 - }, - { - "name": "get_permalink", - "line": 695, - "end_line": 695 - }, - { - "name": "get_option", - "line": 696, - "end_line": 696 - }, - { - "name": "is_post_type_hierarchical", - "line": 705, - "end_line": 705 - }, - { - "name": "get_post_type", - "line": 705, - "end_line": 705 - }, - { - "name": "get_post_type", - "line": 708, - "end_line": 708 - }, - { - "name": "add_query_arg", - "line": 711, - "end_line": 711 - }, - { - "name": "amp_get_slug", - "line": 711, - "end_line": 711 - }, - { - "name": "preg_replace", - "line": 713, - "end_line": 713 - }, - { - "name": "trailingslashit", - "line": 714, - "end_line": 714 - }, - { - "name": "user_trailingslashit", - "line": 714, - "end_line": 714 - }, - { - "name": "amp_get_slug", - "line": 714, - "end_line": 714 - }, - { - "name": "apply_filters", - "line": 730, - "end_line": 730 + "\\WP_Post" + ], + "variable": "$post" } ] } }, - { - "name": "amp_remove_endpoint", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 741, - "end_line": 750, + "7": { + "name": "amp_post_template_file", + "line": 470, + "end_line": 470, + "type": "filter", "arguments": [ - { - "name": "$url", - "default": null, - "type": "" - } + "$file", + "$template_type", + "$this->post" ], "doc": { - "description": "Remove the AMP endpoint (and query var) from a given URL.", + "description": "Filters the template file being loaded for a given template type.", "long_description": "", "tags": [ { "name": "since", - "content": "0.7" + "content": "0.2" }, { "name": "param", - "content": "URL.", + "content": "Template file.", "types": [ "string" ], - "variable": "$url" + "variable": "$file" }, { - "name": "return", - "content": "URL with AMP stripped.", + "name": "param", + "content": "Template type.", "types": [ "string" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "preg_replace", - "line": 744, - "end_line": 744 - }, - { - "name": "preg_quote", - "line": 744, - "end_line": 744 - }, - { - "name": "amp_get_slug", - "line": 744, - "end_line": 744 - }, - { - "name": "remove_query_arg", - "line": 747, - "end_line": 747 + ], + "variable": "$template_type" }, { - "name": "amp_get_slug", - "line": 747, - "end_line": 747 + "name": "param", + "content": "Post.", + "types": [ + "\\WP_Post" + ], + "variable": "$post" } ] } }, - { - "name": "amp_add_amphtml_link", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 759, - "end_line": 809, - "arguments": [], + "8": { + "name": "amp_post_template_include_{$template_type}", + "line": 484, + "end_line": 484, + "type": "action", + "arguments": [ + "$this" + ], "doc": { - "description": "Add amphtml link.", - "long_description": "If there are known validation errors for the current URL then do not output anything.", + "description": "Fires before including a template.", + "long_description": "", "tags": [ { "name": "since", - "content": "1.0" - } - ] - }, - "hooks": [ - { - "name": "amp_frontend_show_canonical", - "line": 776, - "end_line": 789, - "type": "filter_deprecated", - "arguments": [ - "array(true)", - "'2.0'", - "''", - "sprintf(esc_html__('Removal of %1$s link should be done by removing %2$s from the %3$s action at %4$s.', 'amp'), 'amphtml', __FUNCTION__ . '()', 'wp_head', 'template_redirect')" - ], - "doc": { - "description": "Filters whether to show the amphtml link on the frontend.", - "long_description": "This is deprecated since the name was wrong and the use case is not clear. To remove this from being printed, instead of using the filter you can rather do:\n add_action( 'template_redirect', static function () { remove_action( 'wp_head', 'amp_add_amphtml_link' ); } );", - "tags": [ - { - "name": "since", - "content": "0.2" - }, - { - "name": "deprecated", - "content": "Remove amp_add_amphtml_link() call on wp_head action instead.", - "description": "Remove amp_add_amphtml_link() call on wp_head action instead." - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "amp_is_canonical", - "line": 761, - "end_line": 761 - }, - { - "name": "apply_filters_deprecated", - "line": 776, - "end_line": 789 - }, - { - "name": "sprintf", - "line": 781, - "end_line": 788 - }, - { - "name": "esc_html__", - "line": 783, - "end_line": 783 - }, - { - "name": "amp_is_available", - "line": 794, - "end_line": 794 - }, - { - "name": "printf", - "line": 795, - "end_line": 795 - }, - { - "name": "esc_html__", - "line": 795, - "end_line": 795 - }, - { - "name": "add_query_arg", - "line": 800, - "end_line": 800 - }, - { - "name": "amp_get_slug", - "line": 800, - "end_line": 800 - }, - { - "name": "amp_get_current_url", - "line": 800, - "end_line": 800 - }, - { - "name": "amp_get_permalink", - "line": 802, - "end_line": 802 - }, - { - "name": "get_queried_object_id", - "line": 802, - "end_line": 802 - }, - { - "name": "remove_query_arg", - "line": 806, - "end_line": 806 - }, - { - "name": "printf", - "line": 807, - "end_line": 807 - }, - { - "name": "esc_url", - "line": 807, - "end_line": 807 - } - ], - "methods": [ - { - "name": "is_paired_available", - "class": "\\AMP_Theme_Support", - "static": true, - "line": 799, - "end_line": 799 + "content": "0.4" + }, + { + "name": "param", + "content": "Post template.", + "types": [ + "\\AMP_Post_Template" + ], + "variable": "$this" } ] } - }, + } + } + }, + "63": { + "file": { + "description": "Class AMP_Base_Embed_Handler", + "long_description": "Used by some children.", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/embeds\/class-amp-base-embed-handler.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [ { - "name": "amp_is_post_supported", + "name": "AMP_Base_Embed_Handler", "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 820, - "end_line": 822, - "arguments": [ + "line": 15, + "end_line": 112, + "final": false, + "abstract": true, + "extends": "", + "implements": [], + "properties": [ { - "name": "$post", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Determine whether a given post supports AMP.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "2.0", - "description": "Formerly known as post_supports_amp()." - }, - { - "name": "see", - "content": "", - "refers": "AMP_Post_Type_Support::get_support_errors()" - }, - { - "name": "param", - "content": "Post.", - "types": [ - "\\WP_Post" - ], - "variable": "$post" - }, - { - "name": "return", - "content": "Whether the post supports AMP.", - "types": [ - "bool" + "name": "$DEFAULT_WIDTH", + "line": 21, + "end_line": 21, + "default": "600", + "static": false, + "visibility": "protected", + "doc": { + "description": "Default width.", + "long_description": "", + "tags": [ + { + "name": "var", + "content": "", + "types": [ + "int" + ], + "variable": "" + } ] } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "count", - "line": 821, - "end_line": 821 + }, + { + "name": "$DEFAULT_HEIGHT", + "line": 28, + "end_line": 28, + "default": "480", + "static": false, + "visibility": "protected", + "doc": { + "description": "Default height.", + "long_description": "", + "tags": [ + { + "name": "var", + "content": "", + "types": [ + "int" + ], + "variable": "" + } + ] } - ], - "methods": [ - { - "name": "get_support_errors", - "class": "\\AMP_Post_Type_Support", - "static": true, - "line": 821, - "end_line": 821 + }, + { + "name": "$args", + "line": 35, + "end_line": 35, + "default": "array()", + "static": false, + "visibility": "protected", + "doc": { + "description": "Default arguments.", + "long_description": "", + "tags": [ + { + "name": "var", + "content": "", + "types": [ + "array" + ], + "variable": "" + } + ] } - ] - } - }, - { - "name": "post_supports_amp", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 835, - "end_line": 837, - "arguments": [ + }, { - "name": "$post", - "default": null, - "type": "" + "name": "$did_convert_elements", + "line": 42, + "end_line": 42, + "default": "false", + "static": false, + "visibility": "protected", + "doc": { + "description": "Whether or not conversion was completed.", + "long_description": "", + "tags": [ + { + "name": "var", + "content": "", + "types": [ + "boolean" + ], + "variable": "" + } + ] + } } ], - "doc": { - "description": "Determine whether a given post supports AMP.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.1" - }, - { - "name": "since", - "content": "0.6", - "description": "Returns false when post has meta to disable AMP." - }, - { - "name": "since", - "content": "2.0", - "description": "Renamed to AMP-prefixed version, amp_is_post_supported()." - }, - { - "name": "deprecated", - "content": "Use amp_is_post_supported() instead.", - "description": "Use amp_is_post_supported() instead." - }, - { - "name": "param", - "content": "Post.", - "types": [ - "\\WP_Post" - ], - "variable": "$post" - }, - { - "name": "return", - "content": "Whether the post supports AMP.", - "types": [ - "bool" - ] + "methods": [ + { + "name": "register_embed", + "namespace": "", + "aliases": [], + "line": 47, + "end_line": 47, + "final": false, + "abstract": true, + "static": false, + "visibility": "public", + "arguments": [], + "doc": { + "description": "Registers embed.", + "long_description": "", + "tags": [] } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_is_post_supported", - "line": 836, - "end_line": 836 + }, + { + "name": "unregister_embed", + "namespace": "", + "aliases": [], + "line": 52, + "end_line": 52, + "final": false, + "abstract": true, + "static": false, + "visibility": "public", + "arguments": [], + "doc": { + "description": "Unregisters embed.", + "long_description": "", + "tags": [] } - ] - } - }, - { - "name": "amp_is_request", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 853, - "end_line": 886, - "arguments": [], - "doc": { - "description": "Determine whether the current request is for an AMP page.", - "long_description": "This function cannot be called before the parse_query action because it needs to be able to determine the queried object is able to be served as AMP. If 'amp' theme support is not present, this function returns true just if the query var is present. If theme support is present, then it returns true in transitional mode if an AMP template is available and the query var is present, or else in standard mode if just the template is available.", - "tags": [ - { - "name": "since", - "content": "2.0", - "description": "Formerly known as is_amp_endpoint()." - }, - { - "name": "return", - "content": "Whether it is the AMP endpoint.", - "types": [ - "bool" + }, + { + "name": "__construct", + "namespace": "", + "aliases": [], + "line": 59, + "end_line": 67, + "final": false, + "abstract": false, + "static": false, + "visibility": "public", + "arguments": [ + { + "name": "$args", + "default": "array()", + "type": "" + } + ], + "doc": { + "description": "Constructor.", + "long_description": "", + "tags": [ + { + "name": "param", + "content": "Height and width for embed.", + "types": [ + "array" + ], + "variable": "$args" + } ] }, - { - "name": "global", - "content": "WP_Query $wp_query" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_is_canonical", - "line": 861, - "end_line": 861 - }, - { - "name": "amp_get_slug", - "line": 863, - "end_line": 863 - }, - { - "name": "amp_get_slug", - "line": 868, - "end_line": 868 - }, - { - "name": "amp_is_available", - "line": 873, - "end_line": 873 - }, - { - "name": "did_action", - "line": 878, - "end_line": 878 - } - ], - "methods": [ - { - "name": "get", - "class": "$wp_query", - "static": false, - "line": 868, - "end_line": 868 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 879, - "end_line": 879 - } - ] - } - }, - { - "name": "is_amp_endpoint", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 903, - "end_line": 905, - "arguments": [], - "doc": { - "description": "Determine whether the current response being served as AMP.", - "long_description": "This function cannot be called before the parse_query action because it needs to be able to determine the queried object is able to be served as AMP. If 'amp' theme support is not present, this function returns true just if the query var is present. If theme support is present, then it returns true in transitional mode if an AMP template is available and the query var is present, or else in standard mode if just the template is available.", - "tags": [ - { - "name": "since", - "content": "0.1" - }, - { - "name": "since", - "content": "2.0", - "description": "Renamed to AMP-prefixed version, amp_is_request()." - }, - { - "name": "deprecated", - "content": "Use amp_is_request() instead.", - "description": "Use amp_is_request() instead." - }, - { - "name": "return", - "content": "Whether it is the AMP endpoint.", - "types": [ - "bool" + "uses": { + "functions": [ + { + "name": "wp_parse_args", + "line": 60, + "end_line": 66 + } ] } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_is_request", - "line": 904, - "end_line": 904 + }, + { + "name": "get_scripts", + "namespace": "", + "aliases": [], + "line": 79, + "end_line": 81, + "final": false, + "abstract": false, + "static": false, + "visibility": "public", + "arguments": [], + "doc": { + "description": "Get mapping of AMP component names to AMP script URLs.", + "long_description": "This is normally no longer needed because the validating sanitizer will automatically detect the need for them via the spec.", + "tags": [ + { + "name": "see", + "content": "", + "refers": "AMP_Tag_And_Attribute_Sanitizer::get_scripts()" + }, + { + "name": "return", + "content": "Scripts.", + "types": [ + "array" + ] + } + ] } - ] - } - }, - { - "name": "amp_get_asset_url", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 916, - "end_line": 918, - "arguments": [ + }, { - "name": "$file", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Get AMP asset URL.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.1" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "param", - "content": "Relative path to file in assets directory.", - "types": [ - "string" - ], - "variable": "$file" + "name": "match_element_attributes", + "namespace": "", + "aliases": [], + "line": 93, + "end_line": 111, + "final": false, + "abstract": false, + "static": false, + "visibility": "protected", + "arguments": [ + { + "name": "$html", + "default": null, + "type": "" + }, + { + "name": "$tag_name", + "default": null, + "type": "" + }, + { + "name": "$attribute_names", + "default": null, + "type": "" + } + ], + "doc": { + "description": "Get regex pattern for matching HTML attributes from a given tag name.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "1.5.0" + }, + { + "name": "param", + "content": "HTML source haystack.", + "types": [ + "string" + ], + "variable": "$html" + }, + { + "name": "param", + "content": "Tag name.", + "types": [ + "string" + ], + "variable": "$tag_name" + }, + { + "name": "param", + "content": "Attribute names.", + "types": [ + "string[]" + ], + "variable": "$attribute_names" + }, + { + "name": "return", + "content": "Matched attributes, or null if the element was not matched at all.", + "types": [ + "string[]", + "null" + ] + } + ] }, - { - "name": "return", - "content": "URL.", - "types": [ - "string" + "uses": { + "functions": [ + { + "name": "sprintf", + "line": 94, + "end_line": 106 + }, + { + "name": "preg_quote", + "line": 96, + "end_line": 96 + }, + { + "name": "implode", + "line": 97, + "end_line": 105 + }, + { + "name": "array_map", + "line": 99, + "end_line": 104 + }, + { + "name": "sprintf", + "line": 101, + "end_line": 101 + }, + { + "name": "preg_quote", + "line": 101, + "end_line": 101 + }, + { + "name": "preg_match", + "line": 107, + "end_line": 107 + }, + { + "name": "wp_array_slice_assoc", + "line": 110, + "end_line": 110 + } ] } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "plugins_url", - "line": 917, - "end_line": 917 - }, + } + ], + "doc": { + "description": "Class AMP_Base_Embed_Handler", + "long_description": "", + "tags": [ { - "name": "sprintf", - "line": 917, - "end_line": 917 + "name": "since", + "content": "0.2" } ] } - }, - { - "name": "amp_get_boilerplate_code", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" + } + ], + "hooks": [] + }, + "80": { + "file": { + "description": "AMP Post type support.", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" }, - "line": 929, - "end_line": 932, - "arguments": [], + { + "name": "since", + "content": "0.6" + } + ] + }, + "path": "includes\/class-amp-post-type-support.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], + "hooks": [ + { + "name": "amp_supportable_post_types", + "line": 63, + "end_line": 63, + "type": "filter", + "arguments": [ + "$post_types" + ], "doc": { - "description": "Get AMP boilerplate code.", - "long_description": "", + "description": "Filters the list of post types which may be supported for AMP.", + "long_description": "By default the list includes those which are public.", "tags": [ { "name": "since", - "content": "0.7" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "link", - "content": "https:\/\/www.ampproject.org\/docs\/reference\/spec#boilerplate", - "link": "https:\/\/www.ampproject.org\/docs\/reference\/spec#boilerplate" + "content": "2.0" }, { - "name": "return", - "content": "Boilerplate code.", + "name": "param", + "content": "Post types.", "types": [ - "string" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_get_boilerplate_stylesheets", - "line": 930, - "end_line": 930 - }, - { - "name": "sprintf", - "line": 931, - "end_line": 931 + "string[]" + ], + "variable": "$post_types" } ] } }, { - "name": "amp_get_boilerplate_stylesheets", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 943, - "end_line": 948, - "arguments": [], + "name": "amp_skip_post", + "line": 140, + "end_line": 140, + "type": "filter", + "arguments": [ + "false", + "$post->ID", + "$post" + ], "doc": { - "description": "Get AMP boilerplate stylesheets.", + "description": "Filters whether to skip the post from AMP.", "long_description": "", "tags": [ { "name": "since", - "content": "1.3" + "content": "0.3" }, { - "name": "internal", - "content": "" + "name": "param", + "content": "Skipped.", + "types": [ + "bool" + ], + "variable": "$skipped" }, { - "name": "link", - "content": "https:\/\/www.ampproject.org\/docs\/reference\/spec#boilerplate", - "link": "https:\/\/www.ampproject.org\/docs\/reference\/spec#boilerplate" + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" }, { - "name": "return", - "content": "Stylesheets, where first is contained in style[amp-boilerplate] and the second in noscript>style[amp-boilerplate].", + "name": "param", + "content": "Post.", "types": [ - "string[]" - ] + "\\WP_Post" + ], + "variable": "$post" } ] - }, - "hooks": [] + } }, { - "name": "amp_add_generator_metadata", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 958, - "end_line": 970, - "arguments": [], + "name": "amp_post_status_default_enabled", + "line": 190, + "end_line": 190, + "type": "filter", + "arguments": [ + "$enabled", + "$post" + ], "doc": { - "description": "Add generator metadata.", + "description": "Filters whether default AMP status should be enabled or not.", "long_description": "", "tags": [ { @@ -5484,431 +5415,359 @@ "content": "0.6" }, { - "name": "since", - "content": "1.0", - "description": "Add template mode." - }, - { - "name": "since", - "content": "2.0", - "description": "Add reader theme." + "name": "param", + "content": "Status.", + "types": [ + "string" + ], + "variable": "$status" }, { - "name": "internal", - "content": "" - } + "name": "param", + "content": "Post.", + "types": [ + "\\WP_Post" + ], + "variable": "$post" + } ] + } + } + ] + }, + "81": { + "file": { + "description": "Class AMP_HTTP", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "1.0" }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "sprintf", - "line": 959, - "end_line": 959 - }, + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/class-amp-http.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], + "hooks": [ + { + "name": "amp_comment_posted_message", + "line": 486, + "end_line": 486, + "type": "filter", + "arguments": [ + "$message", + "$comment" + ], + "doc": { + "description": "Filters the message when comment submitted success message when", + "long_description": "", + "tags": [ { - "name": "sprintf", - "line": 962, - "end_line": 962 - }, + "name": "since", + "content": "0.7" + } + ] + } + } + ] + }, + "87": { + "file": { + "description": "Class AMP_Validation_Manager", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/validation\/class-amp-validation-manager.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 2395, + "type": "Require" + } + ], + "classes": [], + "hooks": [ + { + "name": "amp_validation_error_default_sanitized", + "line": 306, + "end_line": 306, + "type": "filter", + "arguments": [ + "$accepted", + "$error" + ], + "doc": { + "description": "Filters whether sanitization is accepted for a newly-encountered validation error .", + "long_description": "This only applies to validation errors that have not been encountered before. To override the sanitization status of existing validation errors, use the `amp_validation_error_sanitized` filter.", + "tags": [ { - "name": "sprintf", - "line": 966, - "end_line": 966 + "name": "since", + "content": "1.4" }, { - "name": "printf", - "line": 969, - "end_line": 969 + "name": "see", + "content": "", + "refers": "AMP_Validation_Error_Taxonomy::get_validation_error_sanitization()" }, { - "name": "esc_attr", - "line": 969, - "end_line": 969 - } - ], - "methods": [ - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 961, - "end_line": 961 + "name": "param", + "content": "Default accepted.", + "types": [ + "bool" + ], + "variable": "$accepted" }, { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 964, - "end_line": 964 + "name": "param", + "content": "Validation error. May be null when asking if accepting sanitization is enabled by default.", + "types": [ + "array", + "null" + ], + "variable": "$error" } ] } }, { - "name": "amp_register_default_scripts", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 979, - "end_line": 1035, + "name": "amp_validation_error", + "line": 800, + "end_line": 800, + "type": "filter", "arguments": [ - { - "name": "$wp_scripts", - "default": null, - "type": "" - } + "$error", + "compact('node')" ], "doc": { - "description": "Register default scripts for AMP components.", - "long_description": "", + "description": "Filters the validation error array.", + "long_description": "This allows plugins to add amend additional properties which can help with more accurately identifying a validation error beyond the name of the parent node and the element's attributes. The $sources are also omitted because these are only available during an explicit validation request and so they are not suitable for plugins to vary sanitization by. If looking to force a validation error to be ignored, use the 'amp_validation_error_sanitized' filter instead of attempting to return an empty value with this filter (as that is not supported).", "tags": [ { - "name": "internal", - "content": "" + "name": "since", + "content": "1.0" }, { "name": "param", - "content": "Scripts.", + "content": "Validation error to be printed.", "types": [ - "\\WP_Scripts" + "array" ], - "variable": "$wp_scripts" - } - ] - }, - "hooks": [], - "uses": { - "methods": [ - { - "name": "add", - "class": "$wp_scripts", - "static": false, - "line": 982, - "end_line": 987 - }, - { - "name": "add_data", - "class": "$wp_scripts", - "static": false, - "line": 988, - "end_line": 994 - }, - { - "name": "add", - "class": "$wp_scripts", - "static": false, - "line": 998, - "end_line": 1003 - }, - { - "name": "add_data", - "class": "$wp_scripts", - "static": false, - "line": 1004, - "end_line": 1010 - }, - { - "name": "get_extension_specs", - "class": "\\AMP_Allowed_Tags_Generated", - "static": true, - "line": 1013, - "end_line": 1013 - }, - { - "name": "add", - "class": "$wp_scripts", - "static": false, - "line": 1020, - "end_line": 1025 - }, - { - "name": "query", - "class": "$wp_scripts", - "static": false, - "line": 1028, - "end_line": 1028 - } - ], - "functions": [ - { - "name": "sprintf", - "line": 1014, - "end_line": 1018 + "variable": "$error" }, { - "name": "end", - "line": 1017, - "end_line": 1017 + "name": "param", + "content": "{ Context data for validation error sanitization. @type DOMNode $node Node for which the validation error is being reported. May be null. }", + "types": [ + "array" + ], + "variable": "$context" } ] } + } + ] + }, + "88": { + "file": { + "description": "Class AMP_Validation_Error_Taxonomy", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/validation\/class-amp-validation-error-taxonomy.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ + { + "name": "", + "line": 943, + "type": "Require" }, { - "name": "amp_register_default_styles", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1045, - "end_line": 1053, + "name": "", + "line": 984, + "type": "Require" + } + ], + "classes": [], + "hooks": [ + { + "name": "amp_validation_error_sanitized", + "line": 521, + "end_line": 521, + "type": "filter", "arguments": [ - { - "name": "$styles", - "default": null, - "type": "\\WP_Styles" - } + "null", + "$error" ], "doc": { - "description": "Register default styles.", - "long_description": "", + "description": "Filters whether the validation error should be sanitized.", + "long_description": "Returning true this indicates that the validation error is acceptable and should not be considered a blocker to render AMP. Returning null means that the default status should be used.\n Note that the $node is not passed here to ensure that the filter can be applied on validation errors that have been stored. Likewise, the $sources are also omitted because these are only available during an explicit validation request and so they are not suitable for plugins to vary sanitization by.", "tags": [ { "name": "since", - "content": "2.0" + "content": "1.0" }, { - "name": "internal", - "content": "" + "name": "see", + "content": "Which controls whether an error is initially accepted or rejected for sanitization.", + "refers": "AMP_Validation_Manager::is_sanitization_auto_accepted()" }, { "name": "param", - "content": "Styles.", + "content": "Whether sanitized; this is initially null, and changing it to bool causes the validation error to be forced.", "types": [ - "\\WP_Styles" + "null", + "bool" ], - "variable": "$styles" - } - ] - }, - "hooks": [], - "uses": { - "methods": [ - { - "name": "add", - "class": "$styles", - "static": false, - "line": 1046, - "end_line": 1051 + "variable": "$sanitized" }, { - "name": "add_data", - "class": "$styles", - "static": false, - "line": 1052, - "end_line": 1052 - } - ], - "functions": [ - { - "name": "amp_get_asset_url", - "line": 1048, - "end_line": 1048 + "name": "param", + "content": "Validation error being sanitized.", + "types": [ + "array" + ], + "variable": "$error" } ] } }, { - "name": "amp_render_scripts", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1071, - "end_line": 1101, + "name": "amp_validation_error_source_file_editor_url_template", + "line": 2306, + "end_line": 2306, + "type": "filter", "arguments": [ - { - "name": "$scripts", - "default": null, - "type": "" - } + "null" ], "doc": { - "description": "Generate HTML for AMP scripts that have not yet been printed.", - "long_description": "This is adapted from `wp_scripts()->do_items()`, but it runs only the bare minimum required to output the missing scripts, without allowing other filters to apply which may cause an invalid AMP response. The HTML for the scripts is returned instead of being printed.", + "description": "Filters the template for the URL for linking to an external editor to open a file for editing.", + "long_description": "Users of IDEs that support opening files in via web protocols can use this filter to override the edit link to result in their editor opening rather than the theme\/plugin editor.\n The initial filtered value is null, requiring extension plugins to supply the URL template string themselves. If no template string is provided, links to the theme\/plugin editors will be provided if available. For example, for an extension plugin to cause file edit links to open in PhpStorm, the following filter can be used:\n add_filter( 'amp_validation_error_source_file_editor_url_template', function () { return 'phpstorm:\/\/open?file={{file}}&line={{line}}'; } );\n For a template to be considered, the string '{{file}}' must be present in the filtered value.", "tags": [ { "name": "since", - "content": "0.7.2" - }, - { - "name": "see", - "content": "", - "refers": "WP_Scripts::do_items()" + "content": "1.4" }, { - "name": "see", - "content": "", - "refers": "AMP_Base_Embed_Handler::get_scripts()" - }, - { - "name": "see", - "content": "", - "refers": "AMP_Base_Sanitizer::get_scripts()" - }, + "name": "param", + "content": "Editor URL template.", + "types": [ + "string", + "null" + ], + "variable": "$editor_url_template" + } + ] + } + }, + { + "name": "amp_validation_error_source_file_path", + "line": 2342, + "end_line": 2342, + "type": "filter", + "arguments": [ + "$file_path", + "$source" + ], + "doc": { + "description": "Filters the file path to be opened in an external editor for a given AMP validation error source.", + "long_description": "This is useful to map the file path from inside of a Docker container or VM to the host machine.", + "tags": [ { - "name": "internal", - "content": "" + "name": "since", + "content": "1.4" }, { "name": "param", - "content": "Script handles mapped to URLs or true.", + "content": "Editor URL template.", "types": [ - "array" + "string", + "null" ], - "variable": "$scripts" + "variable": "$editor_url_template" }, { - "name": "return", - "content": "HTML for scripts tags that have not yet been done.", + "name": "param", + "content": "Source information.", "types": [ - "string" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "is_string", - "line": 1079, - "end_line": 1079 - }, - { - "name": "wp_script_is", - "line": 1079, - "end_line": 1079 - }, - { - "name": "wp_scripts", - "line": 1080, - "end_line": 1080 - }, - { - "name": "array_diff", - "line": 1084, - "end_line": 1084 - }, - { - "name": "array_keys", - "line": 1084, - "end_line": 1084 - }, - { - "name": "wp_scripts", - "line": 1084, - "end_line": 1084 - }, - { - "name": "wp_script_is", - "line": 1085, - "end_line": 1085 - }, - { - "name": "wp_scripts", - "line": 1089, - "end_line": 1089 - }, - { - "name": "amp_filter_script_loader_tag", - "line": 1090, - "end_line": 1096 - }, - { - "name": "sprintf", - "line": 1091, - "end_line": 1094 - }, - { - "name": "esc_url", - "line": 1093, - "end_line": 1093 - }, - { - "name": "wp_scripts", - "line": 1098, - "end_line": 1098 + "array" + ], + "variable": "$source" } ] } - }, + } + ] + }, + "90": { + "file": { + "description": "Deprecated functions.", + "long_description": "", + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] + }, + "path": "includes\/deprecated.php", + "root": "\/app\/public\/content\/plugins\/amp", + "includes": [ { - "name": "amp_filter_script_loader_tag", + "name": "", + "line": 92, + "type": "Require Once" + } + ], + "functions": { + "1": { + "name": "amp_maybe_add_actions", "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1114, - "end_line": 1164, - "arguments": [ - { - "name": "$tag", - "default": null, - "type": "" - }, - { - "name": "$handle", - "default": null, - "type": "" - } - ], + "aliases": [], + "line": 32, + "end_line": 81, + "arguments": [], "doc": { - "description": "Add AMP script attributes to enqueued scripts.", - "long_description": "", + "description": "Conditionally add AMP actions or render the transitional mode template(s).", + "long_description": "If the request is for an AMP page and this is in 'canonical mode,' redirect to the non-AMP page. It won't need this plugin's template system, nor the frontend actions like the 'rel' link.", "tags": [ { - "name": "link", - "content": "https:\/\/core.trac.wordpress.org\/ticket\/12009", - "link": "https:\/\/core.trac.wordpress.org\/ticket\/12009" - }, - { - "name": "since", - "content": "0.7" + "name": "codeCoverageIgnore", + "content": "" }, { - "name": "internal", - "content": "" + "name": "deprecated", + "content": "This function is not used when 'amp' theme support is added.", + "description": "This function is not used when 'amp' theme support is added." }, { - "name": "param", - "content": "The script tag.", - "types": [ - "string" - ], - "variable": "$tag" + "name": "global", + "content": "WP_Query $wp_query" }, { - "name": "param", - "content": "The script handle.", - "types": [ - "string" - ], - "variable": "$handle" + "name": "since", + "content": "0.2" }, { "name": "return", - "content": "Script loader tag.", + "content": "", "types": [ - "string" + "void" ] } ] @@ -5917,2793 +5776,870 @@ "uses": { "functions": [ { - "name": "wp_scripts", - "line": 1116, - "end_line": 1116 + "name": "_deprecated_function", + "line": 33, + "end_line": 33, + "deprecation_version": "1.5" }, { - "name": "strpos", - "line": 1117, - "end_line": 1117 + "name": "current_theme_supports", + "line": 36, + "end_line": 36 }, { - "name": "strtok", - "line": 1130, - "end_line": 1130 + "name": "is_singular", + "line": 42, + "end_line": 42 }, { - "name": "substr", - "line": 1130, - "end_line": 1130 + "name": "is_feed", + "line": 42, + "end_line": 42 }, { - "name": "strlen", - "line": 1130, - "end_line": 1130 + "name": "amp_is_request", + "line": 46, + "end_line": 46 }, { - "name": "preg_match", - "line": 1148, - "end_line": 1148 + "name": "get_queried_object", + "line": 53, + "end_line": 53 }, { - "name": "sprintf", - "line": 1150, - "end_line": 1150 + "name": "amp_is_post_supported", + "line": 54, + "end_line": 54 }, { - "name": "esc_attr", - "line": 1150, - "end_line": 1150 + "name": "wp_safe_redirect", + "line": 60, + "end_line": 60 }, { - "name": "sprintf", - "line": 1152, - "end_line": 1152 + "name": "get_permalink", + "line": 60, + "end_line": 60 }, { - "name": "esc_attr", - "line": 1152, - "end_line": 1152 + "name": "current_user_can", + "line": 60, + "end_line": 60 }, { - "name": "esc_attr", - "line": 1152, - "end_line": 1152 + "name": "wp_parse_str", + "line": 71, + "end_line": 71 }, { - "name": "preg_replace", - "line": 1154, - "end_line": 1159 - } - ] - } - }, - { - "name": "amp_filter_font_style_loader_tag_with_crossorigin_anonymous", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1188, - "end_line": 1207, - "arguments": [ - { - "name": "$tag", - "default": null, - "type": "" - }, - { - "name": "$handle", - "default": null, - "type": "" - }, - { - "name": "$href", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Explicitly opt-in to CORS mode by adding the crossorigin attribute to font stylesheet links.", - "long_description": "This explicitly triggers a CORS request, and gets back a non-opaque response, ensuring that a service worker caching the external stylesheet will not inflate the storage quota. This must be done in AMP and non-AMP alike because in transitional mode the service worker could cache the font stylesheets in a non-AMP document without CORS (crossorigin=\"anonymous\") in which case the service worker could then fail to serve the cached font resources in an AMP document with the warning:\n > The FetchEvent resulted in a network error response: an \"opaque\" response was used for a request whose type is not no-cors", - "tags": [ - { - "name": "since", - "content": "1.0" + "name": "amp_get_slug", + "line": 72, + "end_line": 72 }, { - "name": "link", - "content": "https:\/\/developers.google.com\/web\/tools\/workbox\/guides\/storage-quota#beware_of_opaque_responses", - "link": "https:\/\/developers.google.com\/web\/tools\/workbox\/guides\/storage-quota#beware_of_opaque_responses" + "name": "amp_get_slug", + "line": 72, + "end_line": 72 }, { - "name": "link", - "content": "https:\/\/developers.google.com\/web\/tools\/workbox\/guides\/handle-third-party-requests#cross-origin_requests_and_opaque_responses", - "link": "https:\/\/developers.google.com\/web\/tools\/workbox\/guides\/handle-third-party-requests#cross-origin_requests_and_opaque_responses" + "name": "wp_safe_redirect", + "line": 73, + "end_line": 73 }, { - "name": "todo", - "content": "This should be proposed for WordPress core." + "name": "amp_get_permalink", + "line": 73, + "end_line": 73 }, { - "name": "internal", - "content": "" + "name": "amp_prepare_render", + "line": 77, + "end_line": 77 }, { - "name": "param", - "content": "Link tag HTML.", - "types": [ - "string" - ], - "variable": "$tag" - }, + "name": "amp_add_frontend_actions", + "line": 79, + "end_line": 79 + } + ] + } + }, + "2": { + "name": "amp_add_post_template_actions", + "namespace": "global", + "aliases": [], + "line": 90, + "end_line": 94, + "arguments": [], + "doc": { + "description": "Add post template actions.", + "long_description": "", + "tags": [ { - "name": "param", - "content": "Dependency handle.", - "types": [ - "string" - ], - "variable": "$handle" + "name": "since", + "content": "0.2" }, { - "name": "param", - "content": "Link URL.", - "types": [ - "string" - ], - "variable": "$href" + "name": "codeCoverageIgnore", + "content": "" }, { - "name": "return", - "content": "Link tag HTML.", - "types": [ - "string" - ] + "name": "deprecated", + "content": "This function is not used when 'amp' theme support is added.", + "description": "This function is not used when 'amp' theme support is added." } ] }, "hooks": [], "uses": { - "methods": [ - { - "name": "get_allowed_tag", - "class": "\\AMP_Allowed_Tags_Generated", - "static": true, - "line": 1192, - "end_line": 1192 - } - ], "functions": [ { - "name": "preg_replace", - "line": 1200, - "end_line": 1200 - }, - { - "name": "preg_match", - "line": 1202, - "end_line": 1202 - }, - { - "name": "strpos", - "line": 1202, - "end_line": 1202 + "name": "_deprecated_function", + "line": 91, + "end_line": 91, + "deprecation_version": "1.5" }, { - "name": "preg_replace", - "line": 1203, - "end_line": 1203 + "name": "amp_post_template_init_hooks", + "line": 93, + "end_line": 93 } ] } }, - { - "name": "amp_get_analytics", + "3": { + "name": "amp_prepare_render", "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1218, - "end_line": 1248, - "arguments": [ - { - "name": "$analytics", - "default": "array()", - "type": "" - } - ], - "doc": { - "description": "Retrieve analytics data added in backend.", + "aliases": [], + "line": 104, + "end_line": 107, + "arguments": [], + "doc": { + "description": "Add action to do post template rendering at template_redirect action.", "long_description": "", "tags": [ { "name": "since", - "content": "0.7" + "content": "0.2" }, { - "name": "internal", - "content": "" + "name": "since", + "content": "1.0", + "description": "The amp_render() function is called at template_redirect action priority 11 instead of priority 10." }, { - "name": "param", - "content": "Analytics entries.", - "types": [ - "array" - ], - "variable": "$analytics" + "name": "codeCoverageIgnore", + "content": "" }, { - "name": "return", - "content": "Analytics.", - "types": [ - "array" - ] + "name": "deprecated", + "content": "This function is not used when 'amp' theme support is added.", + "description": "This function is not used when 'amp' theme support is added." } ] }, - "hooks": [ - { - "name": "amp_analytics_entries", - "line": 1231, - "end_line": 1231, - "type": "filter", - "arguments": [ - "$analytics_entries" - ], - "doc": { - "description": "Add amp-analytics tags.", - "long_description": "This filter allows you to easily insert any amp-analytics tags without needing much heavy lifting. This filter should be used to alter entries for transitional mode.", - "tags": [ - { - "name": "since", - "content": "0.7" - }, - { - "name": "param", - "content": "An associative array of the analytics entries we want to output. Each array entry must have a unique key, and the value should be an array with the following keys: `type`, `attributes`, `config_data`. See readme for more details.", - "types": [ - "array" - ], - "variable": "$analytics_entries" - } - ] - } - } - ], + "hooks": [], "uses": { - "methods": [ - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 1219, - "end_line": 1219 - } - ], "functions": [ { - "name": "apply_filters", - "line": 1231, - "end_line": 1231 - }, - { - "name": "is_string", - "line": 1241, - "end_line": 1241 + "name": "_deprecated_function", + "line": 105, + "end_line": 105, + "deprecation_version": "1.5" }, { - "name": "json_decode", - "line": 1242, - "end_line": 1242 + "name": "add_action", + "line": 106, + "end_line": 106 } ] } }, - { - "name": "amp_print_analytics", + "4": { + "name": "amp_render", "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1258, - "end_line": 1318, - "arguments": [ - { - "name": "$analytics", - "default": null, - "type": "" - } - ], + "aliases": [], + "line": 116, + "end_line": 125, + "arguments": [], "doc": { - "description": "Print analytics data.", + "description": "Render AMP for queried post.", "long_description": "", "tags": [ { "name": "since", - "content": "0.7" + "content": "0.1" }, { - "name": "internal", + "name": "codeCoverageIgnore", "content": "" }, { - "name": "param", - "content": "Analytics entries, or empty string when called via wp_footer action.", - "types": [ - "array", - "string" - ], - "variable": "$analytics" + "name": "deprecated", + "content": "This function is not used when 'amp' theme support is added.", + "description": "This function is not used when 'amp' theme support is added." } ] }, - "hooks": [ - { - "name": "amp_print_analytics", - "line": 1276, - "end_line": 1276, - "type": "action", - "arguments": [ - "$analytics_entries" - ], - "doc": { - "description": "Triggers before analytics entries are printed as amp-analytics tags.", - "long_description": "This is useful for printing additional `amp-analytics` tags to the page without having to refactor any existing markup generation logic to use the data structure mutated by the `amp_analytics_entries` filter. For such cases, this action should be used for printing `amp-analytics` tags as opposed to using the `wp_footer` and `amp_post_template_footer` actions.", - "tags": [ - { - "name": "since", - "content": "1.3" - }, - { - "name": "param", - "content": "Analytics entries, already potentially modified by the amp_analytics_entries filter.", - "types": [ - "array" - ], - "variable": "$analytics_entries" - } - ] - } - } - ], + "hooks": [], "uses": { "functions": [ { - "name": "amp_get_analytics", - "line": 1263, - "end_line": 1263 - }, - { - "name": "do_action", - "line": 1276, - "end_line": 1276 - }, - { - "name": "_doing_it_wrong", - "line": 1285, - "end_line": 1296 - }, - { - "name": "sprintf", - "line": 1287, - "end_line": 1294 - }, - { - "name": "esc_html__", - "line": 1289, - "end_line": 1289 - }, - { - "name": "esc_html", - "line": 1290, - "end_line": 1290 - }, - { - "name": "esc_html", - "line": 1293, - "end_line": 1293 - }, - { - "name": "implode", - "line": 1293, - "end_line": 1293 - }, - { - "name": "array_keys", - "line": 1293, - "end_line": 1293 - }, - { - "name": "wp_json_encode", - "line": 1304, - "end_line": 1304 - }, - { - "name": "array_merge", - "line": 1307, - "end_line": 1310 + "name": "_deprecated_function", + "line": 117, + "end_line": 117, + "deprecation_version": "1.5" }, { - "name": "compact", - "line": 1308, - "end_line": 1308 - } - ], - "methods": [ - { - "name": "build_tag", - "class": "\\AMP_HTML_Utils", - "static": true, - "line": 1299, - "end_line": 1305 + "name": "get_queried_object", + "line": 120, + "end_line": 120 }, { - "name": "build_tag", - "class": "\\AMP_HTML_Utils", - "static": true, - "line": 1316, - "end_line": 1316 + "name": "amp_render_post", + "line": 122, + "end_line": 122 } ] } }, - { - "name": "amp_get_content_embed_handlers", + "5": { + "name": "amp_render_post", "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1330, - "end_line": 1380, + "aliases": [], + "line": 137, + "end_line": 183, "arguments": [ { "name": "$post", - "default": "null", + "default": null, "type": "" } ], "doc": { - "description": "Get content embed handlers.", + "description": "Render AMP post template.", "long_description": "", "tags": [ { "name": "since", - "content": "0.7" + "content": "0.5" }, { - "name": "internal", + "name": "codeCoverageIgnore", "content": "" }, { - "name": "param", - "content": "Post that the content belongs to. Deprecated when theme supports AMP, as embeds may apply to non-post data (e.g. Text widget).", - "types": [ - "\\WP_Post" - ], - "variable": "$post" + "name": "deprecated", + "content": "Rendering a post is now handled by AMP_Theme_Support.", + "description": "Rendering a post is now handled by AMP_Theme_Support." }, { - "name": "return", - "content": "Embed handlers.", + "name": "param", + "content": "Post.", "types": [ - "array" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_content_embed_handlers", - "line": 1353, - "end_line": 1379, - "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())", - "$post" - ], - "doc": { - "description": "Filters the content embed handlers.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.2" - }, - { - "name": "since", - "content": "0.7", - "description": "Deprecated $post parameter." - }, - { - "name": "param", - "content": "Handlers.", - "types": [ - "array" - ], - "variable": "$handlers" - }, - { - "name": "param", - "content": "Post. Deprecated. It will be null when `amp_is_canonical()`.", - "types": [ - "\\WP_Post" - ], - "variable": "$post" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "amp_is_legacy", - "line": 1331, - "end_line": 1331, - "deprecation_version": "0.7" - }, - { - "name": "_deprecated_argument", - "line": 1332, - "end_line": 1340 - }, - { - "name": "sprintf", - "line": 1335, - "end_line": 1339 - }, - { - "name": "esc_html__", - "line": 1337, - "end_line": 1337 - }, - { - "name": "apply_filters", - "line": 1353, - "end_line": 1379 - } - ] - } - }, - { - "name": "amp_is_dev_mode", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1393, - "end_line": 1416, - "arguments": [], - "doc": { - "description": "Determine whether AMP dev mode is enabled.", - "long_description": "When enabled, the element will get the data-ampdevmode attribute and the plugin will add the same attribute to elements associated with the admin bar and other elements that are provided by the `amp_dev_mode_element_xpaths` filter.", - "tags": [ - { - "name": "since", - "content": "1.3" - }, - { - "name": "return", - "content": "Whether AMP dev mode is enabled.", - "types": [ - "bool" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_dev_mode_enabled", - "line": 1405, - "end_line": 1415, - "type": "filter", - "arguments": [ - "is_admin_bar_showing() && is_user_logged_in() || is_customize_preview()" - ], - "doc": { - "description": "Filters whether AMP mode is enabled.", - "long_description": "When enabled, the data-ampdevmode attribute will be added to the document element and it will allow the attributes to be added to the admin bar. It will also add the attribute to all elements which match the queries for the expressions returned by the 'amp_dev_mode_element_xpaths' filter.", - "tags": [ - { - "name": "since", - "content": "1.3" - }, - { - "name": "param", - "content": "Whether AMP dev mode is enabled.", - "types": [ - "bool" - ], - "variable": "" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "apply_filters", - "line": 1405, - "end_line": 1415 - }, - { - "name": "is_admin_bar_showing", - "line": 1411, - "end_line": 1411 - }, - { - "name": "is_user_logged_in", - "line": 1411, - "end_line": 1411 - }, - { - "name": "is_customize_preview", - "line": 1413, - "end_line": 1413 - } - ] - } - }, - { - "name": "amp_get_content_sanitizers", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1429, - "end_line": 1605, - "arguments": [ - { - "name": "$post", - "default": "null", - "type": "" - } - ], - "doc": { - "description": "Get content sanitizers.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.7" - }, - { - "name": "since", - "content": "1.1", - "description": "Added AMP_Nav_Menu_Toggle_Sanitizer and AMP_Nav_Menu_Dropdown_Sanitizer." - }, - { - "name": "internal", - "content": "" - }, - { - "name": "param", - "content": "Post that the content belongs to. Deprecated when theme supports AMP, as sanitizers apply to non-post data (e.g. Text widget).", - "types": [ - "\\WP_Post" - ], - "variable": "$post" - }, - { - "name": "return", - "content": "Embed handlers.", - "types": [ - "array" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_to_amp_linking_enabled", - "line": 1457, - "end_line": 1460, - "type": "filter", - "arguments": [ - "\\AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === \\AMP_Options_Manager::get_option(\\AmpProject\\AmpWP\\Option::THEME_SUPPORT)" - ], - "doc": { - "description": "Filters whether AMP-to-AMP linking should be enabled.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "1.4.0" - }, - { - "name": "param", - "content": "Whether AMP-to-AMP linking should be enabled.", - "types": [ - "bool" - ], - "variable": "$amp_to_amp_linking_enabled" - } - ] - } - }, - { - "name": "amp_to_amp_excluded_urls", - "line": 1523, - "end_line": 1523, - "type": "filter", - "arguments": [ - "array()" - ], - "doc": { - "description": "Filters the list of URLs which are excluded from being included in AMP-to-AMP linking.", - "long_description": "This only applies when the amp_to_amp_linking_enabled filter returns true, which it does by default in Transitional mode. This filter can be used to opt-in when in Reader mode. This does not apply in Standard mode. Only frontend URLs on the frontend need be excluded, as all other URLs are never made into AMP links.", - "tags": [ - { - "name": "since", - "content": "1.5.0" - }, - { - "name": "param", - "content": "The URLs to exclude from having AMP-to-AMP links.", - "types": [ - "string[]" - ], - "variable": "$excluded_urls" - } - ] - } - }, - { - "name": "amp_content_sanitizers", - "line": 1540, - "end_line": 1540, - "type": "filter", - "arguments": [ - "$sanitizers", - "$post" - ], - "doc": { - "description": "Filters the content sanitizers.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.2" - }, - { - "name": "since", - "content": "0.7", - "description": "Deprecated $post parameter. It will be null when `amp_is_canonical()`." - }, - { - "name": "param", - "content": "Handlers.", - "types": [ - "array" - ], - "variable": "$handlers" - }, - { - "name": "param", - "content": "Post. Deprecated.", - "types": [ - "\\WP_Post" - ], - "variable": "$post" - } - ] - } - }, - { - "name": "amp_dev_mode_element_xpaths", - "line": 1553, - "end_line": 1553, - "type": "filter", - "arguments": [ - "array()" - ], - "doc": { - "description": "Filters the XPath queries for elements that should be enabled for dev mode.", - "long_description": "By supplying XPath queries to this filter, the data-ampdevmode attribute will automatically be added to the root HTML element as well as to any elements that match the expressions. The attribute is added to the elements prior to running any of the sanitizers.", - "tags": [ - { - "name": "since", - "content": "1.3" - }, - { - "name": "param", - "content": "XPath element queries. Context is the root element.", - "types": [ - "string[]" - ], - "variable": "$element_xpaths" - } - ] - } - }, - { - "name": "amp_parsed_css_transient_caching_allowed", - "line": 1593, - "end_line": 1593, - "type": "filter", - "arguments": [ - "true" - ], - "doc": { - "description": "Filters whether parsed CSS is allowed to be cached in transients.", - "long_description": "When this is filtered to be false, parsed CSS will not be stored in transients. This is important when there is highly-variable CSS content in order to prevent filling up the wp_options table with an endless number of entries.", - "tags": [ - { - "name": "since", - "content": "1.5.0" - }, - { - "name": "param", - "content": "Transient caching allowed.", - "types": [ - "bool" - ], - "variable": "$transient_caching_allowed" - } - ] - } - } - ], - "uses": { - "methods": [ - { - "name": "get_theme_support_args", - "class": "\\AMP_Theme_Support", - "static": true, - "line": 1430, - "end_line": 1430 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 1459, - "end_line": 1459 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 1509, - "end_line": 1509 - } - ], - "functions": [ - { - "name": "amp_is_legacy", - "line": 1432, - "end_line": 1432, - "deprecation_version": "0.7" - }, - { - "name": "_deprecated_argument", - "line": 1433, - "end_line": 1441 - }, - { - "name": "sprintf", - "line": 1436, - "end_line": 1440 - }, - { - "name": "esc_html__", - "line": 1438, - "end_line": 1438 - }, - { - "name": "wp_parse_url", - "line": 1445, - "end_line": 1445 - }, - { - "name": "get_home_url", - "line": 1445, - "end_line": 1445 - }, - { - "name": "apply_filters", - "line": 1457, - "end_line": 1460 - }, - { - "name": "get_template", - "line": 1467, - "end_line": 1467 - }, - { - "name": "get_stylesheet", - "line": 1468, - "end_line": 1468 - }, - { - "name": "current_theme_supports", - "line": 1474, - "end_line": 1474 - }, - { - "name": "current_theme_supports", - "line": 1487, - "end_line": 1487 - }, - { - "name": "is_array", - "line": 1490, - "end_line": 1490 - }, - { - "name": "apply_filters", - "line": 1523, - "end_line": 1523 - }, - { - "name": "array_merge", - "line": 1525, - "end_line": 1528 - }, - { - "name": "amp_is_canonical", - "line": 1526, - "end_line": 1526 - }, - { - "name": "compact", - "line": 1527, - "end_line": 1527 - }, - { - "name": "apply_filters", - "line": 1540, - "end_line": 1540 - }, - { - "name": "amp_is_dev_mode", - "line": 1542, - "end_line": 1542 - }, - { - "name": "apply_filters", - "line": 1553, - "end_line": 1553 - }, - { - "name": "is_admin_bar_showing", - "line": 1555, - "end_line": 1555 - }, - { - "name": "is_customize_preview", - "line": 1561, - "end_line": 1561 - }, - { - "name": "array_merge", - "line": 1574, - "end_line": 1581 - }, - { - "name": "apply_filters", - "line": 1593, - "end_line": 1593 - } - ] - } - }, - { - "name": "amp_get_post_image_metadata", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1616, - "end_line": 1664, - "arguments": [ - { - "name": "$post", - "default": "null", - "type": "" - } - ], - "doc": { - "description": "Grabs featured image or the first attached image for the post.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.7", - "description": "This originally was located in the private method AMP_Post_Template::get_post_image_metadata()." - }, - { - "name": "internal", - "content": "" - }, - { - "name": "param", - "content": "Post or post ID.", - "types": [ - "\\WP_Post", - "int" - ], - "variable": "$post" - }, - { - "name": "return", - "content": "$post_image_meta Post image metadata, or false if not found.", - "types": [ - "array", - "false" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "get_post", - "line": 1617, - "end_line": 1617 - }, - { - "name": "has_post_thumbnail", - "line": 1625, - "end_line": 1625 - }, - { - "name": "get_post_thumbnail_id", - "line": 1626, - "end_line": 1626 - }, - { - "name": "wp_attachment_is", - "line": 1627, - "end_line": 1627 - }, - { - "name": "get_posts", - "line": 1630, - "end_line": 1641 - }, - { - "name": "array_shift", - "line": 1644, - "end_line": 1644 - }, - { - "name": "wp_get_attachment_image_src", - "line": 1652, - "end_line": 1652 - }, - { - "name": "is_array", - "line": 1654, - "end_line": 1654 - } - ] - } - }, - { - "name": "amp_get_publisher_logo", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1681, - "end_line": 1729, - "arguments": [], - "doc": { - "description": "Get the publisher logo.", - "long_description": "The following guidelines apply to logos used for general AMP pages.\n \"The logo should be a rectangle, not a square. The logo should fit in a 60x600px rectangle., and either be exactly 60px high (preferred), or exactly 600px wide. For example, 450x45px would not be acceptable, even though it fits in the 600x60px rectangle.\"", - "tags": [ - { - "name": "since", - "content": "1.2.1" - }, - { - "name": "link", - "content": "https:\/\/developers.google.com\/search\/docs\/data-types\/article#logo-guidelines", - "link": "https:\/\/developers.google.com\/search\/docs\/data-types\/article#logo-guidelines" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "return", - "content": "Publisher logo image URL. WordPress logo if no site icon or custom logo defined, and no logo provided via 'amp_site_icon_url' filter.", - "types": [ - "string" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_site_icon_url", - "line": 1721, - "end_line": 1721, - "type": "filter", - "arguments": [ - "$logo_image_url" - ], - "doc": { - "description": "Filters the publisher logo URL in the schema.org data.", - "long_description": "Previously, this only filtered the Site Icon, as that was the only possible schema.org publisher logo. But the Custom Logo is now the preferred publisher logo, if it exists and its dimensions aren't too big.", - "tags": [ - { - "name": "since", - "content": "0.3" - }, - { - "name": "param", - "content": "URL of the publisher logo, either the Custom Logo or the Site Icon.", - "types": [ - "string" - ], - "variable": "$schema_img_url" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "get_theme_mod", - "line": 1694, - "end_line": 1694 - }, - { - "name": "has_custom_logo", - "line": 1695, - "end_line": 1695 - }, - { - "name": "wp_get_attachment_image_src", - "line": 1696, - "end_line": 1696 - }, - { - "name": "get_option", - "line": 1703, - "end_line": 1703 - }, - { - "name": "wp_get_attachment_image_src", - "line": 1705, - "end_line": 1705 - }, - { - "name": "apply_filters", - "line": 1721, - "end_line": 1721 - }, - { - "name": "amp_get_asset_url", - "line": 1725, - "end_line": 1725 - } - ] - } - }, - { - "name": "amp_get_schemaorg_metadata", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1740, - "end_line": 1811, - "arguments": [], - "doc": { - "description": "Get schema.org metadata for the current query.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.7" - }, - { - "name": "see", - "content": "Where the logic in this function originally existed.", - "refers": "AMP_Post_Template::build_post_data()" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "return", - "content": "$metadata All schema.org metadata for the post.", - "types": [ - "array" - ] - } - ] - }, - "hooks": [ - { - "name": "amp_post_template_metadata", - "line": 1794, - "end_line": 1794, - "type": "filter", - "arguments": [ - "$metadata", - "$queried_object" - ], - "doc": { - "description": "Filters Schema.org metadata for a post.", - "long_description": "The 'post_template' in the filter name here is due to this filter originally being introduced in `AMP_Post_Template`. In general the `amp_schemaorg_metadata` filter should be used instead.", - "tags": [ - { - "name": "since", - "content": "0.3" - }, - { - "name": "param", - "content": "Metadata.", - "types": [ - "array" - ], - "variable": "$metadata" - }, - { - "name": "param", - "content": "Post.", - "types": [ - "\\WP_Post" - ], - "variable": "$queried_object" - } - ] - } - }, - { - "name": "amp_schemaorg_metadata", - "line": 1808, - "end_line": 1808, - "type": "filter", - "arguments": [ - "$metadata" - ], - "doc": { - "description": "Filters Schema.org metadata for a query.", - "long_description": "Check the the main query for the context for which metadata should be added.", - "tags": [ - { - "name": "since", - "content": "0.7" - }, - { - "name": "param", - "content": "Metadata.", - "types": [ - "array" - ], - "variable": "$metadata" - } - ] - } - } - ], - "uses": { - "functions": [ - { - "name": "get_bloginfo", - "line": 1745, - "end_line": 1745 - }, - { - "name": "amp_get_publisher_logo", - "line": 1749, - "end_line": 1749 - }, - { - "name": "get_queried_object", - "line": 1757, - "end_line": 1757 - }, - { - "name": "array_merge", - "line": 1759, - "end_line": 1768 - }, - { - "name": "is_page", - "line": 1762, - "end_line": 1762 - }, - { - "name": "get_permalink", - "line": 1763, - "end_line": 1763 - }, - { - "name": "get_the_title", - "line": 1764, - "end_line": 1764 - }, - { - "name": "mysql2date", - "line": 1765, - "end_line": 1765 - }, - { - "name": "mysql2date", - "line": 1766, - "end_line": 1766 - }, - { - "name": "get_userdata", - "line": 1770, - "end_line": 1770 - }, - { - "name": "html_entity_decode", - "line": 1774, - "end_line": 1774 - }, - { - "name": "get_bloginfo", - "line": 1774, - "end_line": 1774 - }, - { - "name": "amp_get_post_image_metadata", - "line": 1778, - "end_line": 1778 - }, - { - "name": "apply_filters", - "line": 1794, - "end_line": 1794 - }, - { - "name": "is_archive", - "line": 1795, - "end_line": 1795 - }, - { - "name": "apply_filters", - "line": 1808, - "end_line": 1808 - } - ] - } - }, - { - "name": "amp_print_schemaorg_metadata", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1821, - "end_line": 1829, - "arguments": [], - "doc": { - "description": "Output schema.org metadata.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "0.7" - }, - { - "name": "since", - "content": "1.1", - "description": "we pass `JSON_UNESCAPED_UNICODE` to `wp_json_encode`." - }, - { - "name": "see", - "content": "", - "refers": "https:\/\/github.com\/ampproject\/amp-wp\/issues\/1969" - }, - { - "name": "internal", - "content": "" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "amp_get_schemaorg_metadata", - "line": 1822, - "end_line": 1822 - }, - { - "name": "wp_json_encode", - "line": 1827, - "end_line": 1827 - } - ] - } - }, - { - "name": "amp_wp_kses_mustache", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1841, - "end_line": 1844, - "arguments": [ - { - "name": "$markup", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Filters content and keeps only allowable HTML elements by amp-mustache.", - "long_description": "", - "tags": [ - { - "name": "see", - "content": "", - "refers": "wp_kses()" - }, - { - "name": "since", - "content": "1.0" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "param", - "content": "Markup to sanitize.", - "types": [ - "string" - ], - "variable": "$markup" - }, - { - "name": "return", - "content": "HTML markup with tags allowed by amp-mustache.", - "types": [ - "string" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "wp_kses", - "line": 1843, - "end_line": 1843 - }, - { - "name": "array_fill_keys", - "line": 1843, - "end_line": 1843 - } - ] - } - }, - { - "name": "amp_add_admin_bar_view_link", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1857, - "end_line": 1908, - "arguments": [ - { - "name": "$wp_admin_bar", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Add \"View AMP\" admin bar item for Transitional\/Reader mode.", - "long_description": "Note that when theme support is present (in Native\/Transitional modes), the admin bar item will be further amended by the `AMP_Validation_Manager::add_admin_bar_menu_items()` method.", - "tags": [ - { - "name": "see", - "content": "", - "refers": "\\AMP_Validation_Manager::add_admin_bar_menu_items()" - }, - { - "name": "internal", - "content": "" - }, - { - "name": "param", - "content": "Admin bar.", - "types": [ - "\\WP_Admin_Bar" - ], - "variable": "$wp_admin_bar" - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "is_admin", - "line": 1858, - "end_line": 1858 - }, - { - "name": "amp_is_canonical", - "line": 1858, - "end_line": 1858 - }, - { - "name": "amp_is_available", - "line": 1858, - "end_line": 1858 - }, - { - "name": "amp_is_request", - "line": 1862, - "end_line": 1862 - }, - { - "name": "amp_remove_endpoint", - "line": 1865, - "end_line": 1865 - }, - { - "name": "amp_get_current_url", - "line": 1865, - "end_line": 1865 - }, - { - "name": "is_singular", - "line": 1866, - "end_line": 1866 - }, - { - "name": "amp_get_permalink", - "line": 1867, - "end_line": 1867 - }, - { - "name": "get_queried_object_id", - "line": 1867, - "end_line": 1867 - }, - { - "name": "add_query_arg", - "line": 1869, - "end_line": 1869 - }, - { - "name": "amp_get_slug", - "line": 1869, - "end_line": 1869 - }, - { - "name": "amp_get_current_url", - "line": 1869, - "end_line": 1869 - }, - { - "name": "remove_query_arg", - "line": 1872, - "end_line": 1872 - }, - { - "name": "esc_html__", - "line": 1883, - "end_line": 1883 - }, - { - "name": "esc_url", - "line": 1884, - "end_line": 1884 - }, - { - "name": "esc_html", - "line": 1892, - "end_line": 1892 - }, - { - "name": "__", - "line": 1892, - "end_line": 1892 - }, - { - "name": "__", - "line": 1892, - "end_line": 1892 - }, - { - "name": "esc_url", - "line": 1893, - "end_line": 1893 - }, - { - "name": "get_object_vars", - "line": 1900, - "end_line": 1900 - }, - { - "name": "amp_is_legacy", - "line": 1901, - "end_line": 1901 - }, - { - "name": "add_query_arg", - "line": 1902, - "end_line": 1902 - }, - { - "name": "add_query_arg", - "line": 1904, - "end_line": 1904 - }, - { - "name": "amp_get_slug", - "line": 1904, - "end_line": 1904 - } - ], - "methods": [ - { - "name": "logo", - "class": "\\AmpProject\\AmpWP\\Icon", - "static": true, - "line": 1874, - "end_line": 1874 - }, - { - "name": "link", - "class": "\\AmpProject\\AmpWP\\Icon", - "static": true, - "line": 1874, - "end_line": 1874 - }, - { - "name": "add_node", - "class": "$wp_admin_bar", - "static": false, - "line": 1880, - "end_line": 1886 - }, - { - "name": "to_html", - "class": "$icon", - "static": false, - "line": 1883, - "end_line": 1883 - }, - { - "name": "add_node", - "class": "$wp_admin_bar", - "static": false, - "line": 1888, - "end_line": 1895 - }, - { - "name": "get_node", - "class": "$wp_admin_bar", - "static": false, - "line": 1898, - "end_line": 1898 - }, - { - "name": "get_option", - "class": "\\AMP_Options_Manager", - "static": true, - "line": 1899, - "end_line": 1899 - }, - { - "name": "add_node", - "class": "$wp_admin_bar", - "static": false, - "line": 1906, - "end_line": 1906 - } - ] - } - }, - { - "name": "amp_generate_script_hash", - "namespace": "global", - "aliases": { - "ReaderThemes": "\\AmpProject\\AmpWP\\Admin\\ReaderThemes", - "AmpWpPluginFactory": "\\AmpProject\\AmpWP\\AmpWpPluginFactory", - "Icon": "\\AmpProject\\AmpWP\\Icon", - "Option": "\\AmpProject\\AmpWP\\Option", - "QueryVar": "\\AmpProject\\AmpWP\\QueryVar" - }, - "line": 1926, - "end_line": 1937, - "arguments": [ - { - "name": "$script", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Generate hash for inline amp-script.", - "long_description": "The sha384 hash used by amp-script is represented not as hexadecimal but as base64url, which is defined in RFC 4648 under section 5, \"Base 64 Encoding with URL and Filename Safe Alphabet\". It is sometimes referred to as \"web safe\".", - "tags": [ - { - "name": "since", - "content": "1.4.0" - }, - { - "name": "link", - "content": "https:\/\/amp.dev\/documentation\/components\/amp-script\/#security-features", - "link": "https:\/\/amp.dev\/documentation\/components\/amp-script\/#security-features" - }, - { - "name": "link", - "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/e8707858895c2af25903af25d396e144e64690ba\/extensions\/amp-script\/0.1\/amp-script.js#L401-L425", - "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/e8707858895c2af25903af25d396e144e64690ba\/extensions\/amp-script\/0.1\/amp-script.js#L401-L425" - }, - { - "name": "link", - "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/27b46b9c8c0fb3711a00376668d808f413d798ed\/src\/service\/crypto-impl.js#L67-L124", - "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/27b46b9c8c0fb3711a00376668d808f413d798ed\/src\/service\/crypto-impl.js#L67-L124" - }, - { - "name": "link", - "content": "https:\/\/github.com\/ampproject\/amphtml\/blob\/c4a663d0ba13d0488c6fe73c55dc8c971ac6ec0d\/src\/utils\/base64.js#L52-L61", - "link": "https:\/\/github.com\/ampproject\/amphtml\/blob\/c4a663d0ba13d0488c6fe73c55dc8c971ac6ec0d\/src\/utils\/base64.js#L52-L61" - }, - { - "name": "link", - "content": "https:\/\/tools.ietf.org\/html\/rfc4648#section-5", - "link": "https:\/\/tools.ietf.org\/html\/rfc4648#section-5" - }, - { - "name": "param", - "content": "Script.", - "types": [ - "string" - ], - "variable": "$script" - }, - { - "name": "return", - "content": "Script hash or null if the sha384 algorithm is not supported.", - "types": [ - "string", - "null" - ] - } - ] - }, - "hooks": [], - "uses": { - "functions": [ - { - "name": "hash", - "line": 1927, - "end_line": 1927 - }, - { - "name": "str_replace", - "line": 1931, - "end_line": 1935 - }, - { - "name": "base64_encode", - "line": 1934, - "end_line": 1934 - } - ] - } - } - ] - }, - "125": { - "file": { - "description": "Class AMP_Base_Embed_Handler", - "long_description": "Used by some children.", - "tags": [ - { - "name": "package", - "content": "AMP" - } - ] - }, - "path": "includes\/embeds\/class-amp-base-embed-handler.php", - "root": "\/app\/public\/content\/plugins\/amp", - "classes": [ - { - "name": "AMP_Base_Embed_Handler", - "namespace": "global", - "line": 15, - "end_line": 112, - "final": false, - "abstract": true, - "extends": "", - "implements": [], - "properties": [ - { - "name": "$DEFAULT_WIDTH", - "line": 21, - "end_line": 21, - "default": "600", - "static": false, - "visibility": "protected", - "doc": { - "description": "Default width.", - "long_description": "", - "tags": [ - { - "name": "var", - "content": "", - "types": [ - "int" - ], - "variable": "" - } - ] - } - }, - { - "name": "$DEFAULT_HEIGHT", - "line": 28, - "end_line": 28, - "default": "480", - "static": false, - "visibility": "protected", - "doc": { - "description": "Default height.", - "long_description": "", - "tags": [ - { - "name": "var", - "content": "", - "types": [ - "int" - ], - "variable": "" - } - ] - } - }, - { - "name": "$args", - "line": 35, - "end_line": 35, - "default": "array()", - "static": false, - "visibility": "protected", - "doc": { - "description": "Default arguments.", - "long_description": "", - "tags": [ - { - "name": "var", - "content": "", - "types": [ - "array" - ], - "variable": "" - } - ] - } - }, - { - "name": "$did_convert_elements", - "line": 42, - "end_line": 42, - "default": "false", - "static": false, - "visibility": "protected", - "doc": { - "description": "Whether or not conversion was completed.", - "long_description": "", - "tags": [ - { - "name": "var", - "content": "", - "types": [ - "boolean" - ], - "variable": "" - } - ] - } - } - ], - "methods": [ - { - "name": "register_embed", - "namespace": "", - "aliases": [], - "line": 47, - "end_line": 47, - "final": false, - "abstract": true, - "static": false, - "visibility": "public", - "arguments": [], - "doc": { - "description": "Registers embed.", - "long_description": "", - "tags": [] - } - }, - { - "name": "unregister_embed", - "namespace": "", - "aliases": [], - "line": 52, - "end_line": 52, - "final": false, - "abstract": true, - "static": false, - "visibility": "public", - "arguments": [], - "doc": { - "description": "Unregisters embed.", - "long_description": "", - "tags": [] - } - }, - { - "name": "__construct", - "namespace": "", - "aliases": [], - "line": 59, - "end_line": 67, - "final": false, - "abstract": false, - "static": false, - "visibility": "public", - "arguments": [ - { - "name": "$args", - "default": "array()", - "type": "" - } - ], - "doc": { - "description": "Constructor.", - "long_description": "", - "tags": [ - { - "name": "param", - "content": "Height and width for embed.", - "types": [ - "array" - ], - "variable": "$args" - } - ] - }, - "uses": { - "functions": [ - { - "name": "wp_parse_args", - "line": 60, - "end_line": 66 - } - ] - } - }, - { - "name": "get_scripts", - "namespace": "", - "aliases": [], - "line": 79, - "end_line": 81, - "final": false, - "abstract": false, - "static": false, - "visibility": "public", - "arguments": [], - "doc": { - "description": "Get mapping of AMP component names to AMP script URLs.", - "long_description": "This is normally no longer needed because the validating sanitizer will automatically detect the need for them via the spec.", - "tags": [ - { - "name": "see", - "content": "", - "refers": "AMP_Tag_And_Attribute_Sanitizer::get_scripts()" - }, - { - "name": "return", - "content": "Scripts.", - "types": [ - "array" - ] - } - ] - } - }, - { - "name": "match_element_attributes", - "namespace": "", - "aliases": [], - "line": 93, - "end_line": 111, - "final": false, - "abstract": false, - "static": false, - "visibility": "protected", - "arguments": [ - { - "name": "$html", - "default": null, - "type": "" - }, - { - "name": "$tag_name", - "default": null, - "type": "" - }, - { - "name": "$attribute_names", - "default": null, - "type": "" - } - ], - "doc": { - "description": "Get regex pattern for matching HTML attributes from a given tag name.", - "long_description": "", - "tags": [ - { - "name": "since", - "content": "1.5.0" - }, - { - "name": "param", - "content": "HTML source haystack.", - "types": [ - "string" - ], - "variable": "$html" - }, - { - "name": "param", - "content": "Tag name.", - "types": [ - "string" - ], - "variable": "$tag_name" - }, - { - "name": "param", - "content": "Attribute names.", - "types": [ - "string[]" - ], - "variable": "$attribute_names" - }, - { - "name": "return", - "content": "Matched attributes, or null if the element was not matched at all.", - "types": [ - "string[]", - "null" - ] - } - ] - }, - "uses": { - "functions": [ - { - "name": "sprintf", - "line": 94, - "end_line": 106 - }, - { - "name": "preg_quote", - "line": 96, - "end_line": 96 - }, - { - "name": "implode", - "line": 97, - "end_line": 105 - }, - { - "name": "array_map", - "line": 99, - "end_line": 104 - }, - { - "name": "sprintf", - "line": 101, - "end_line": 101 - }, + "\\WP_Post", + "int" + ], + "variable": "$post" + }, + { + "name": "global", + "content": "WP_Query $wp_query" + } + ] + }, + "hooks": [ + { + "name": "pre_amp_render_post", + "line": 174, + "end_line": 174, + "type": "action", + "arguments": [ + "$post_id" + ], + "doc": { + "description": "Fires before rendering a post in AMP.", + "long_description": "This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `amp_is_request()`.", + "tags": [ { - "name": "preg_quote", - "line": 101, - "end_line": 101 + "name": "since", + "content": "0.2" }, { - "name": "preg_match", - "line": 107, - "end_line": 107 + "name": "deprecated", + "content": "Check amp_is_request() on the template_redirect action instead.", + "description": "Check amp_is_request() on the template_redirect action instead." }, { - "name": "wp_array_slice_assoc", - "line": 110, - "end_line": 110 + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" } ] } } ], + "uses": { + "functions": [ + { + "name": "_deprecated_function", + "line": 138, + "end_line": 138, + "deprecation_version": "1.5" + }, + { + "name": "get_post", + "line": 142, + "end_line": 142 + }, + { + "name": "amp_get_slug", + "line": 154, + "end_line": 154 + }, + { + "name": "amp_get_slug", + "line": 156, + "end_line": 156 + }, + { + "name": "extension_loaded", + "line": 160, + "end_line": 160 + }, + { + "name": "newrelic_disable_autorum", + "line": 161, + "end_line": 161 + }, + { + "name": "do_action", + "line": 174, + "end_line": 174 + }, + { + "name": "amp_add_post_template_actions", + "line": 176, + "end_line": 176 + }, + { + "name": "amp_get_slug", + "line": 181, + "end_line": 181 + } + ], + "methods": [ + { + "name": "__construct", + "class": "\\AMP_Post_Template", + "static": false, + "line": 177, + "end_line": 177 + }, + { + "name": "load", + "class": "$template", + "static": false, + "line": 178, + "end_line": 178 + } + ] + } + } + }, + "hooks": [ + { + "name": "pre_amp_render_post", + "line": 174, + "end_line": 174, + "type": "action", + "arguments": [ + "$post_id" + ], "doc": { - "description": "Class AMP_Base_Embed_Handler", - "long_description": "", + "description": "Fires before rendering a post in AMP.", + "long_description": "This action is not triggered when 'amp' theme support is present. Instead, you should use 'template_redirect' action and check if `amp_is_request()`.", "tags": [ { "name": "since", "content": "0.2" + }, + { + "name": "deprecated", + "content": "Check amp_is_request() on the template_redirect action instead.", + "description": "Check amp_is_request() on the template_redirect action instead." + }, + { + "name": "param", + "content": "Post ID.", + "types": [ + "int" + ], + "variable": "$post_id" } ] } } ] }, - "156": { + "117": { "file": { - "description": "", + "description": "Functions for managing legacy templates", "long_description": "", - "tags": [] + "tags": [ + { + "name": "package", + "content": "AMP" + } + ] }, - "path": "templates\/html-start.php", + "path": "back-compat\/back-compat.php", "root": "\/app\/public\/content\/plugins\/amp", - "uses": { - "methods": [ - { - "name": "build_attributes_string", - "class": "\\AMP_HTML_Utils", - "static": true, - "line": 22, - "end_line": 22 - }, - { - "name": "get", - "class": "$this", - "static": false, - "line": 22, - "end_line": 22 - }, - { - "name": "load_parts", - "class": "$this", - "static": false, - "line": 41, - "end_line": 41 + "functions": [ + { + "name": "amp_backcompat_use_v03_templates", + "namespace": "global", + "aliases": [], + "line": 20, + "end_line": 24, + "arguments": [], + "doc": { + "description": "Add hooks to use legacy AMP post templates from before v0.4.", + "long_description": "If you want to use the template that shipped with v0.3 and earlier, you can use this to force that. Note that this may not stick around forever, so use caution and `function_exists`.\n Note that the old legacy post templates from AMP plugin v0.3 should no longer be used. Update to using the current AMP legacy post templates or better yet switch to using a full Reader theme.", + "tags": [ + { + "name": "deprecated", + "content": "Use Reader themes instead of old legacy AMP post templates.", + "description": "Use Reader themes instead of old legacy AMP post templates." + }, + { + "name": "since", + "content": "0.4" + } + ] }, - { - "name": "get", - "class": "$this", - "static": false, - "line": 62, - "end_line": 62 + "hooks": [], + "uses": { + "functions": [ + { + "name": "_deprecated_function", + "line": 21, + "end_line": 21, + "deprecation_version": "2.0" + }, + { + "name": "add_filter", + "line": 22, + "end_line": 22 + }, + { + "name": "add_filter", + "line": 23, + "end_line": 23 + } + ] } - ], - "functions": [ - { - "name": "do_action", - "line": 38, - "end_line": 38 - }, - { - "name": "do_action", - "line": 57, - "end_line": 57 - }, - { - "name": "esc_attr", - "line": 62, - "end_line": 62 - }, + } + ], + "hooks": [] + }, + "127": { + "file": { + "description": "Class MobileRedirection.", + "long_description": "", + "tags": [ { - "name": "do_action", - "line": 72, - "end_line": 72 + "name": "package", + "content": "AmpProject\\AmpWP" } ] }, + "path": "src\/MobileRedirection.php", + "root": "\/app\/public\/content\/plugins\/amp", + "classes": [], "hooks": [ { - "name": "amp_post_template_head", - "line": 38, - "end_line": 38, - "type": "action", + "name": "amp_pre_is_mobile", + "line": 207, + "end_line": 207, + "type": "filter", "arguments": [ - "$this" + "null" ], "doc": { - "description": "Fires when rendering in Reader mode templates.", + "description": "Filters whether the current request is from a mobile device. This is provided as a means to short-circuit the normal determination of a mobile request below.", "long_description": "", "tags": [ { "name": "since", - "content": "0.2" + "content": "2.0" }, { "name": "param", - "content": "", + "content": "Whether the current request is from a mobile device.", "types": [ - "\\AMP_Post_Template" + "null" ], - "variable": "$this" + "variable": "$is_mobile" } ] } }, { - "name": "amp_post_template_css", - "line": 57, - "end_line": 57, - "type": "action", + "name": "amp_mobile_client_side_redirection", + "line": 267, + "end_line": 267, + "type": "filter", + "arguments": [ + "true" + ], + "doc": { + "description": "Filters whether mobile redirection should be done client-side (via JavaScript).", + "long_description": "If false, a server-side solution will be used instead (via PHP). It's important to verify that server-side redirection does not conflict with a site's page caching logic. To assist with this, you may need to hook into the `amp_pre_is_mobile` filter.\n Beware that disabling this will result in a cookie being set when the user decides to leave the mobile version. This may require updating the site's privacy policy or getting user consent for GDPR compliance. Nevertheless, since the cookie is not used for tracking this may not be necessary.\n Please note that this does not apply when in the Customizer preview or when in AMP Dev Mode (and thus possible Paired Browsing), since server-side redirects would not be able to be prevented as required.", + "tags": [ + { + "name": "since", + "content": "2.0" + }, + { + "name": "param", + "content": "Whether JS redirection should be used to take mobile visitors to the AMP version.", + "types": [ + "bool" + ], + "variable": "$should_redirect_via_js" + } + ] + } + }, + { + "name": "amp_mobile_user_agents", + "line": 298, + "end_line": 298, + "type": "filter", + "arguments": [ + "$default_user_agents" + ], + "doc": { + "description": "Filters the list of user agents used to determine if the user agent from the current request is a mobile one.", + "long_description": "", + "tags": [ + { + "name": "since", + "content": "2.0" + }, + { + "name": "param", + "content": "List of mobile user agent search strings (and regex patterns).", + "types": [ + "string[]" + ], + "variable": "$user_agents" + } + ] + } + }, + { + "name": "amp_mobile_version_switcher_styles_used", + "line": 415, + "end_line": 415, + "type": "filter", "arguments": [ - "$this" + "true" ], "doc": { - "description": "Fires when printing CSS styles in Reader mode templates.", - "long_description": "Callbacks should print bare CSS without any `