Skip to content

AMP for WordPress

  • Showcase
  • Ecosystem
  • Documentation
  • Blog
  • Support
  • About
Download
  • Success with WordPress
  • Why the AMP Plugin
    • Page Experience
    • AMP and Page Experience
    • AMP and ROI
    • Means to an End
  • Getting Started
    • Template Modes
    • Standard Mode
    • Transitional Mode
    • Reader Mode
    • Support
    • Reader Mode Themes
    • Mobile Redirection
    • AMP Optimizer
    • Plugin Suppression
    • Analytics
    • Paired URL Structures
    • Developer Tools
      • Toggling Dev Tools
    • Settings Screen
      • Site Scan
      • Other Section
      • Sandboxing (Experimental)
    • WP-CLI Commands
    • Caching
      • Persistent Object Caching
      • Page Caching with AMP and WordPress
  • How the AMP Plugin Works
    • AMP Validator
    • AMP & CSS
  • Playbooks
    • Adding Reader Themes
    • Handling Form Submissions
    • AMP Plugin Troubleshooting Guide
    • Enqueuing Scripts And Using amp-bind
    • Keyboard Accessible Navigation Menus
    • Mobile Nav Menus
    • Navigation Sub-menu Buttons
    • Implementing Interactivity
    • Custom Embed Handlers
    • Handling AMP Legacy Themes
    • Extracting Image Dimensions
    • Custom Sanitizers
  • Extensions & Mini-Plugins
  • Reference
  • FAQ

Methods

Reference Links
  • Classes
  • Functions
  • Hooks
  • Methods

AMP_WordPress_Embed_Handler::sanitize_raw_embeds

Sanitize WordPress embed raw embeds.

AMP_WordPress_Embed_Handler::unregister_embed

Unregister embed.

AMP_WordPress_Embed_Handler::register_embed

Register embed.

AMP_Base_Sanitizer::update_args

Update args.

AMP_Base_Sanitizer::get_args

Get args.

AMP_Base_Sanitizer::get_arg

Get arg.

AMP_Base_Sanitizer::has_light_shadow_dom

Determine whether the resulting AMP element uses a "light" shadow DOM.

AMP_Base_Embed_Handler::create_overflow_button_markup

Create overflow button markup.

AMP_Base_Embed_Handler::create_overflow_button_element

Create overflow button element.

PairedUrlStructure::remove_endpoint

Remove the paired AMP endpoint from a given URL.

PairedUrlStructure::add_endpoint

Turn a given URL into a paired AMP URL.

PairedUrlStructure::has_endpoint

Determine a given URL is for a paired AMP request.

PairedUrlStructure::__construct

PairedUrlStructure constructor.

PairedUrl::add_path_suffix

Get paired AMP URL using a endpoint suffix.

PairedUrl::add_query_var

Get paired AMP URL using query var (?amp=1).

PairedUrl::has_query_var

Determine whether the given URL has the query var.

PairedUrl::remove_path_suffix

Strip paired endpoint suffix.

PairedUrl::has_path_suffix

Determine whether the given URL has the endpoint suffix.

PairedUrl::remove_query_var

Strip paired query var.

AMP_Base_Embed_Handler::maybe_remove_script_sibling

Removes the node's nearest <script> sibling with a src attribute containing the base src URL provided.

AMP_DOM_Utils::copy_attributes

Copy one or more attributes from one element to the other.

AMP_DOM_Utils::merge_amp_actions

Merge two sets of AMP events & actions.

AMP_DOM_Utils::add_amp_action

Register an AMP action to an event on a given element.

AMP_DOM_Utils::get_element_id

Get the ID for an element.

AMP_DOM_Utils::has_class

Check whether a given element has a specific class.

AMP_DOM_Utils::is_node_empty

Determines if a DOMElement's node is empty or not.

AMP_DOM_Utils::add_attributes_to_node

Add one or more HTML element attributes to a node's DOMElement.

AMP_DOM_Utils::get_node_attributes_as_assoc_array

Extract a DOMElement node's HTML element attributes and return as an array.

AMP_DOM_Utils::create_node

Create a new node w/attributes (a DOMElement) and add to the passed Dom\Document.

AMP_DOM_Utils::get_content_from_dom_node

Return valid HTML content extracted from the DOMNode passed as a parameter.

AMP_DOM_Utils::get_content_from_dom

Return valid HTML *body* content extracted from the Dom\Document passed as a parameter.

AMP_DOM_Utils::get_dom_from_content

Return a valid Dom\Document representing arbitrary HTML content passed as a parameter.

AMP_DOM_Utils::get_amp_bind_placeholder_prefix

Get attribute prefix for converted amp-bind attributes.

AMP_DOM_Utils::is_valid_head_node

Determine whether a node can be in the head.

AMP_DOM_Utils::get_dom

Return a valid Dom\Document representing HTML document passed as a parameter.

AMP_Base_Embed_Handler::unwrap_p_element

Replace an element's parent with itself if the parent is a <p> tag which has no attributes and has no other children.

AMP_Base_Embed_Handler::get_child_elements

Get all child elements of the specified element.

AMP_Base_Embed_Handler::match_element_attributes

Get regex pattern for matching HTML attributes from a given tag name.

AMP_Base_Embed_Handler::get_scripts

Get mapping of AMP component names to AMP script URLs.

AMP_Base_Embed_Handler::__construct

Constructor.

AMP_Base_Embed_Handler::unregister_embed

Unregisters embed.

AMP_Base_Embed_Handler::register_embed

Registers embed.

AMP_Base_Sanitizer::get_validate_response_data

Get data that is returned in validate responses.

AMP_Base_Sanitizer::reassemble_style_string

Reassemble a style string that can be used in a 'style' attribute.

AMP_Base_Sanitizer::parse_style_string

Parse a style string into an associative array of style attributes.

AMP_Base_Sanitizer::filter_attachment_layout_attributes

Set attributes to node's parent element according to layout.

AMP_Base_Sanitizer::filter_data_amp_attributes

Set AMP attributes.

AMP_Base_Sanitizer::get_data_amp_attributes

Get data-amp-* values from the parent node 'figure' added by editor block.

AMP_Base_Sanitizer::clean_up_after_attribute_removal

Cleans up artifacts after the removal of an attribute node.

AMP_Base_Sanitizer::prepare_validation_error

Prepare validation error.

AMP_Base_Sanitizer::should_sanitize_validation_error

Check whether or not sanitization should occur in response to validation error.

AMP_Base_Sanitizer::remove_invalid_attribute

Removes an invalid attribute of a node.

AMP_Base_Sanitizer::remove_invalid_child

Removes an invalid child of a node.

AMP_Base_Sanitizer::is_exempt_from_validation

Check whether a certain node should be exempt from validation.

AMP_Base_Sanitizer::has_dev_mode_exemption

Check whether a node is exempt from validation during dev mode.

AMP_Base_Sanitizer::is_document_in_dev_mode

Check whether the document of a given node is in dev mode.

AMP_Base_Sanitizer::maybe_enforce_https_src

Decide if we should remove a src attribute if https is required.

AMP_Base_Sanitizer::add_or_append_attribute

Adds or appends key and value to list of attributes

AMP_Base_Sanitizer::set_layout

Sets the layout, and possibly the 'height' and 'width' attributes.

AMP_Base_Sanitizer::is_empty_attribute_value

Determine if an attribute value is empty.

AMP_Base_Sanitizer::sanitize_dimension

Sanitizes a CSS dimension specifier while being sensitive to dimension context.

AMP_Base_Sanitizer::get_body_node

Get HTML body as DOMElement from Dom\Document received by the constructor.

AMP_Base_Sanitizer::get_stylesheets

Get stylesheets.

AMP_Base_Sanitizer::get_scripts

Return array of values that would be valid as an HTML script element.

AMP_Base_Sanitizer::sanitize

Sanitize the HTML contained in the DOMDocument received by the constructor

AMP_Base_Sanitizer::init

Run logic before any sanitizers are run.

AMP_Base_Sanitizer::get_selector_conversion_mapping

Get mapping of HTML selectors to the AMP component selectors which they may be converted into.

AMP_Base_Sanitizer::add_buffering_hooks

Add filters to manipulate output during output buffering before the DOM is constructed.

AMP_Base_Sanitizer::__construct

AMP_Base_Sanitizer constructor.

Of course, this site is using this official AMP for WordPress plugin in Standard mode.

  • Showcase
  • Ecosystem
  • Documentation
  • Blog
  • Support
  • About
  • Showcase
  • Ecosystem
  • Documentation
  • Blog
  • Support
  • About

© OpenJS Foundation and AMP Project contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

The services available at cdn.ampproject.org are provided by Google and the respective privacy policy applies.

  • Privacy Policy
  • Terms of service