weeblrAMP filters and actions reference
Actions
Group: Config
weeblramp_config_after_render
Config action
Hook into the user configuration after_render event.
Allows performing checks on the configuration values for instance.
@param string $settingsPage Name of settings page being rendered
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/system/config.php @ line 728
Group: Display
weeblramp_after_content_footer_process
Display action
After processing the post footer content.
@param array $pageData The full page information data array.
@since 1.8.3
in /wp-content/plugins/weeblramp/view/amp/amp.php @ line 95
weeblramp_after_main_content_process
Display action
After processing the main post content.
@param array $pageData The full page information data array.
@since 1.8.3
in /wp-content/plugins/weeblramp/view/amp/amp.php @ line 63
weeblramp_before_content_footer_process
Display action
Before processing the post footer content.
@param array $pageData The full page information data array.
@since 1.8.3
in /wp-content/plugins/weeblramp/view/amp/amp.php @ line 80
weeblramp_before_main_content_process
Display action
Before processing the main post content.
@param s array $pageData The full page information data array.
@since 1.8.3
in /wp-content/plugins/weeblramp/view/amp/amp.php @ line 48
Group: Output
weeblramp_after_menu_items
Output action
Hook after displaying menu items
Output any HTML you want displayed at the bottom of the sidebar/drop down menu
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/tags/menu_items.php @ line 65
weeblramp_before_menu_items
Output action
Hook before displaying menu items
Output any HTML you want displayed at the top of the sidebar/drop down menu
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/tags/menu_items.php @ line 23
Group: Seo
weeblramp_print_meta_data
Seo action
Let 3rd parties output custom meta data on AMP pages
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/head.php @ line 51
Group: System
weeblramp_export_globals
System action
Action when exporting all data to globals before rendering an AMP page.
@param array $globals Value of globals before weeblrAMP exported its own values @param array $postRecord Array of global data for the current page post/page
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/wordpress/html.php @ line 173
weeblramp_init
System action
Hook into the 'init' weeblrAMP event
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/boot.php @ line 264
weeblramp_reset_globals
System action
Action when restoring all data exported to globals before rendering an AMP page.
@param array $globals Array of data stored before exporting, will be restored to globals
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/wordpress/html.php @ line 193
Filters
Group: Ads
autoinsert_ads_is_short_paragraph
Ads filter
Filter whether a paragraph of HTML text is deemed short for automatic ads display.
Short paragraphs will not be counted when applying user rules for automatically inserted ads. They won't received ads either.
@param bool $isShortParagraph If true, the paragraph is considered a short one. @param string $paragraph The paragraph html content.
@return bool
@since 1.2.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 304
autoinsert_ads_min_paragraph_length
Ads filter
Filter the minimal number of characters (UTF-8) in a paragraph text for it to be deemed short.
This number is used to check the text length, but only after spaces and strings have been removed.
The comparison is strict, ie: if you set this number to 10, then a paragraph of 10 characters will be considered short.
Only paragraphs 11 characters in lenght or more will be considered "long".
@param int $minParagraphLength Min number of characters to be deemed short. Defaults to 20.
@return int
@since 1.2.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 340
autoinsert_ads_rules
Ads filter
Filter the rules used to automatically insert ads in a page.
The rules are build based on user settings in admin. There are 2 sets of rules, one for pages, and one for posts.
The incoming array is formatted as follow:
$autoInsertRules = array(
'page' => array(
'type' => 'repeat',
'positions' => '/2'
),
'post' => array(
'type' => 'list',
'positions' => '1,3,5'
)
);
Position of the ads will be either a list of paragraph numbers, or a repeat command.
/2 means an ad inserted after every 2 paragraphs.
1,3,5 means an ad inserted after paragraphs 1, 3 and 5.
@param array $autoInsertRules List of rules to be filtered.
@return array
@since 1.2.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 392
weeblramp_autoinsert_ads_if_shortcode
Ads filter
Filter whether to show automatically inserted ads on pages that already contains a manual ad shortcode.
@param bool $shouldShow If true, ads are displayed on the page.
@return bool
@since 1.2.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 136
weeblramp_autoinsert_ads_on_post
Ads filter
Filter whether to show automatically inserted ads on a given page, bypassing the user set rules.
@param bool $shouldShow If true, ads are displayed on the page. @param WP_Post $post The post object for the current request.
@return bool
@since 1.2.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 174
weeblramp_show_ads
Ads filter
Filter whether to show ads on current AMP request.
Note: user can also enable/disable ads showing by using the [wbamp-no-ads] shortcode anywhere in a post content.
@param bool $shouldShow If true, ads are displayed on the page @param string $requestType Request type descriptor: page, post, home, search,... @param WP_Post $post The global post object for the request
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/full/ads.php @ line 61
Group: Comment
weeblramp_comments_avatar_size
Comment filter
Filter the size of avatars displayed on comments.
@param int $avatarSize Avatar size in pixels.
@return int
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_comments_wp.php @ line 51
weeblramp_comments_location_id
Comment filter
Filter the id used to uniquely identify a page when associating it with its comments.
We use the same convention as Disqus: post_id + a space + post_guid
@param string $id Current page id used for commenting
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/content.php @ line 173
weeblramp_comments_show
Comment filter
Filter whether to display comments on a page.
Note: this can be set by user in settings
@param bool $showComments If true, comments are displayed on the page @param string $requestType Request type descriptor: page, post, home, search,... @param WP_Post $post The global post object
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 84
weeblramp_comments_show_avatar
Comment filter
Filter whether to display user avatars on comments.
@param bool $useAvatar If true, commenter avatars are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_comments_wp.php @ line 37
weeblramp_comments_show_on_home_page
Comment filter
Filter whether to display comments on the home page.
Note: this can be set by user in settings
@param bool $showComments If true, comments are displayed on the page @param string $requestType Request type descriptor: page, post, home, search,... @param WP_Post $post The global post object @param string $commentType The comment provider name (built-in, Disqus, ...)
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/home_item.php @ line 31
weeblramp_comments_show_reply_to
Comment filter
Filter whether to display comments reply_to link.
Note: reply_to links are not AMPlified, they will take back user to regular version of the site.
@param bool $showReplyTo If true, comments reply_to links are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_comments_wp.php @ line 21
Group: Config
weeblramp_allow_taxonomy_select'
Config filter
Allow/disallow taxonomy elements selection in control panel, per post type.
@param bool $selectTaxonomy True to allow user selection of elements from this taxonomy. @param string $postType Name of the post type of this taxonomy. @param string $taxonomyName Taxonomy name.
@return bool
@since 1.9.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/system/config.php @ line 1453
weeblramp_config_set_defaults
Config filter
Modify defaults values for a configuration object
@param WblSystem_Config $config The configuration object @param String $name The name of the current config object (unique ID)
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/config/user.php @ line 305
weeblramp_integrations_list
Config filter
Filter the list of integrations that will be loaded on any AMP page.
This is a key => value array, where key is the plugin file (ie weeblramp/weeblr.php) and the value is a human-readable integration title.
@param array $integrations Current list of integrations
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/integrations.php @ line 81
weeblramp_option
Config filter
Filter weeblrAMP configuration options. Allows overriding any setting set by user.
@param string $value The current value of the option @param string $key The option name @param string $subKey If option is an array, an optional index key in the array
@return mixed Updated config value
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/system/config.php @ line 1159
weeblramp_prevent_activation_plugins
Config filter
Filter a list of plugins that will be prevented from running on any AMP page.
Receives a key => value array, where key is the plugin file (ie: weeblramp/weeblramp.php) and the value is a human-readable title for the plugin. Plugins on that list will be blocked by weeblrAMP on AMP pages.
@param array $incompatiblePlugins List of plugins to block on AMP pages.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/compat.php @ line 59
weeblramp_query_var
Config filter
Filter the query var used to identify AMP requests.
Default to amp. Value can be changed by user in weeblrAMP settings.
@param string $queryVar The current query var used to distinguish AMP requests
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 132
weeblramp_should_amplify_page
Config filter
Filter whether to AMPlify the current request. Default to true.
@param bool $shouldAmplifyPage Whether to AMPlify the current request @param WP_Query $wp_query The current global WordPress query object @param int $page The current global WordPress page number
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 235
weeblramp_should_amplify_url
Config filter
Filter whether to AMPlify a link. Default to true.
@param string $canonicalUrl The full URL to amplify
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 525
weeblramp_user_selectable_taxonomies
Config filter
Filter the list of taxonomies displayed to a user to select pages to AMPlify.
Plugins or integrations with plugins (see Jetpack integration) should add the taxonomies they manage to that list so that user can select to AMPlify content from them.
@param array $allowedTaxonomies Current list of taxonomies
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/class/taxonomy.php @ line 227
Group: Layout
weeblramp_layouts_page_body
Layout filter
Filter the descriptor of the layout file used to render the page body.
Use a dot notation. Default to weeblramp.frontend.amp.body
@param string $bodyLayout The dot separated descriptor of the layout file
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/class/dispatcher.php @ line 357
weeblramp_layouts_page_main
Layout filter
Filter the descriptor of the layout file used to render the page.
Use a dot notation. Default to weeblramp.frontend.amp.template
@param string $mainLayout The dot separated descriptor of the layout file
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/class/dispatcher.php @ line 386
Group: Multilingual
weeblramp_get_available_languages
Multilingual filter
Filter the list of languages available on the site frontend.
@param array $languagesData List of languages, indexed on language slug.
@return array
@since 1.1.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/layouts/wblib/settings/setting_menus.php @ line 82
weeblramp_multilingual_flag_dimensions
Multilingual filter
Filter multilingual switcher flags width and height
@param array $flagsDimensions Pixel width and height to use when displaying flags. Defaults to 16x11. Array has two keys, witdh and height.
@return array
@since 1.1.0
in /wp-content/plugins/weeblramp/integration/full/polylang.php @ line 451
Group: Output
weeblamp_should_scrub_regular_html_page
Output filter
Filter whether standard (ie non-AMP) page should be scrubbed of all weeblrAMP shortcodes.
@param boolean $shouldScrub Whether the standard page should be scrubbed of all weeblrAMP shortcodes.
@return string
@since 1.9.0
in /wp-content/plugins/weeblramp/helper/content.php @ line 28
weeblramp_assets_path_supplemental
Output filter
Filter a list of directories to search for CSS overrides.
You can provide directories where weeblrAMP should look for CSS or javascript overrides for its own CSS and javascript files. Those assets should bear the same names as the originals to be picked up.
@param array $supplementalFilePaths An array of directories full path
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/html/manager.php @ line 105
weeblramp_autoembed
Output filter
Filter proxy for autoembed. Applied to AMP content only.
@param string $text The text to autoembed
@return string
@since 1.10.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 791
weeblramp_autoembed_function
Output filter
Filter the function to use when applying autoembed to AMP content. Returning an empty function
will disable autoembed altogether for AMP content.
@param callable $autoembedFunction Name of function - or function - to use to apply autoembed to AMP content.
@return callable
@since 1.10.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 757
weeblramp_css_customizers
Output filter
Filter list of CSS customizers.
A customizer is a WeeblrampClass_Customize object, used to process a CSS string, replacing agreed upon tags with values provided by the user in the control panel
@param array $customizers List of WeeblrampClass_Customize customizers
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/assetscollector.php @ line 225
weeblramp_final_request_data
Output filter
Filter data used to render the current AMP page.
This is an array of all data before the page rendering process starts.
@param array $data The full array of data collected, before being passed to rendering
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 360
weeblramp_get_nav_menus
Output filter
Filter the list of menus to be displayed on AMP pages.
Identical to WordPress wp_get_nav_menus filter, but only run on AMP pages.
@param array $menuDetails List of WordPress menu objects
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/element/navigation.php @ line 110
weeblramp_get_page_bottom_content
Output filter
Filter content appended to the page bottom.
Raw content output after the page main content, accepts raw HTML.
@param string $content Content to output
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 296
weeblramp_get_request_data
Output filter
Filter (almost the) data used to render the current AMP page.
This is an array of (almost) all data before the page rendering process starts. Only Structured data are missing, as they are built using some of the filtered data.
@param array $data The full array of data collected, before being passed to rendering
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 323
weeblramp_get_scripts
Output filter
Filter the list of (AMP) scripts collected to be inserted on AMP pages
@param array $scripts The list of scripts
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/assetscollector.php @ line 70
weeblramp_get_styles
Output filter
Filter the list of (AMP) styles collected to be inserted on AMP pages
@param array $styles The list of styles to include in the page. Each style is the name of CSS module, as available in the /assets/dist/css folder: ads, amp, carousel, comments, content, core, etc
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/assetscollector.php @ line 129
weeblramp_get_templates
Output filter
Filter the list of (AMP) mustache templates collected to be inserted on AMP pages
@param array $templates The list of templates
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/assetscollector.php @ line 92
weeblramp_item_author_bio_avatar_size
Output filter
Filter the size of the author avatar displayed on an author bio.
@param int $avatarSize In pixels, size of bio author avatar
@return int
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_author_bio.php @ line 45
weeblramp_item_author_bio_show_avatar
Output filter
Filter whether to display an author avatar on their bio.
@param bool $useAvatar If true, avatar is displayed in bio
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_author_bio.php @ line 29
weeblramp_item_featured_image_size
Output filter
Filter the size of the featured image to use on posts and pages.
@see https://codex.wordpress.org/Post_Thumbnails
@param string $size The name of the WordPress image size to use
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/archive_item.php @ line 28
weeblramp_item_header_author_avatar_size
Output filter
Filter the size of the author avatar displayed in an item info block.
@param int $avatarSize In pixels, size of default author avatar
@return int
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_author.php @ line 53
weeblramp_item_header_author_show_avatar
Output filter
Filter whether to show author avatars on item info blocks.
@param bool $useAvatar If true, author avatar will be displayed
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_author.php @ line 36
weeblramp_item_header_author_show_bio
Output filter
Filter whether to display the author bio on the info block.
@param bool $showBio If true, author bio is displayed on the info block
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 56
weeblramp_item_header_author_use_moments
Output filter
Filter whether to use "times ago" style of displaying dates for items info block.
@param bool $useMoments If true, approximate moments are used for dates
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/item_author.php @ line 22
weeblramp_item_header_show_excerpt
Output filter
Filter whether to display an item excerpt, if it exists.
@param bool $showExcerpt If true, excerpt are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 28
weeblramp_item_header_show_info_block
Output filter
Filter whether to display an item info block (author, date,...).
@param bool $showInfoBlock If true, info block is displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 42
weeblramp_item_show_featured_image
Output filter
Filter whether to display an item featured image.
Note: this can be set by user in settings
@param bool $showFeaturedImage If true, featured image is displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/page_item.php @ line 29
weeblramp_item_show_linked_posts
Output filter
Filter whether to display an item linked posts (next/previous posts).
@param bool $showLinkedPosts If true, linked posts are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 70
weeblramp_response_headers
Output filter
Filter the list of HTTP headers included in an AMP page response
@param array $headers Name => Value indexed array of headers ready to be sent
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/class/view.php @ line 146
weeblramp_sharing_buttons_dimensions
Output filter
Filter width and height of social buttons to display.
@param array $socialButtonsDimensions Array of integer dimensions, indexed with 'width' and 'height'.
@return bool
@since 1.3.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/full/social_buttons_static.php @ line 20
weeblramp_shortcodes_disable_list
Output filter
Filter the list of WordPress shortcodes to be disabled on AMP pages before rendering
@param array $codes Array of shortcodes names
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/content.php @ line 326
weeblramp_should_display_widget_area
Output filter
Filter whether to display the AMP widgets for a given AMP widgets area ('before_content', 'after_content',...) on the current AMP page.
@param bool $shouldDisplay If true, AMP widgets are displayed on the page @param string $widgetAreaName One of the AMP widget areas name @param string $requestType Request type descriptor: page, post, home, search,...
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/full/widget.php @ line 37
weeblramp_show_sharing_buttons
Output filter
Filter whether to display social sharing button on current AMP request.
@param bool $showSharingButtons If true, buttons are displayed on page @param string $requestType Request type descriptor: page, post, home, search,... @param WP_Post $post The global post object for the request
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/single_item.php @ line 147
weeblramp_show_sharing_buttons_category
Output filter
Filter whether to display social sharing button on a category page.
@param bool $showSharingButtons If true, buttons are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/archive.php @ line 25
weeblramp_show_sharing_buttons_home
Output filter
Filter whether to display social sharing button on the home page.
@param bool $showSharingButtons If true, buttons are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/home.php @ line 29
weeblramp_show_sharing_buttons_search
Output filter
Filter whether to display social sharing button on the search results page.
@param bool $showSharingButtons If true, buttons are displayed on the page
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/layouts/weeblramp/frontend/amp/contents/search.php @ line 22
weeblramp_template_dir
Output filter
Filter a list of supplemental directories where weeblrAMP should look for possible layouts files
Provide full absolute directories path.
@param array $supplementalBasePaths Array of supplemental full path
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/mvc/layout/file.php @ line 77
weeblramp_the_content
Output filter
Let others add/process raw content extracted from post (ie pagebuilders for instance).
@param string $content Raw content from the post. @param WP_Post $post Current post for the page. @param array $pageData Full array of data available about the current page.
@return string
@since 1.9.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 511
weeblramp_theme_css
Output filter
Filter CSS to be included in AMP pages.
Provide valid AMP CSS to be included in the currently rendered AMP page. Will be added to the CSS provided by weeblrAMP built-in CSS and the CSS provided by user through the control panel.
CSS is collected in the following order:
- from the built-in template
- from the theme, through the weeblramp_theme_css filter
- set by user in the admin custom_css option
@param string $themeCSS Raw CSS to be included in AMP page
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/view/amp/amp.php @ line 210
weeblramp_wc_review_author_html
Output filter
Filter HTML output displaying a single comment author.
@param string $authorHtml The rendered HTML to display a comment/review. @param WP_Comment $comment The comment/review being rendered.
@return string
@since 1.12.1
in /wp-content/plugins/weeblramp/integration/woocommerce/commentwalker.php @ line 58
weeblramp_wc_review_date_time_html
Output filter
Filter HTML output displaying a single comment date and time.
@param string $datetimeHtml The rendered HTML to display a comment/review date and time. @param WP_Comment $comment The comment/review being rendered.
@return string
@since 1.12.1
in /wp-content/plugins/weeblramp/integration/woocommerce/commentwalker.php @ line 82
weeblramp_wpautop
Output filter
Filter proxy for wpautop. Applied to AMP content only.
@param string $text The text to wpautop
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 848
weeblramp_wpautop_function
Output filter
Filter the function to use when applying autop to AMP content. Returning an empty function
will disable autop altogether for AMP content.
@param callable $autopFunction Name of function - or function - to use to apply autop to AMP content.
@return callable
@since 1.9.1
in /wp-content/plugins/weeblramp/model/renderer.php @ line 818
Group: Route
weeblramp_get_amp_permalink
Route filter
Filter the AMP URL generated by weeblrAMP for an item. If the item is a WP_POST, its id is also provided.
@param string $ampUrl AMP url as generated by weeblrAMP @param int $post_id Id of the WP_Post which is linked to, if any
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 488
weeblramp_home_action_url
Route filter
Filter the site home page URL for an action.
This differs from the "default" home URL in that
a filter allows multilingual plugins integrations to
modify it to match the current language home URL
@param string $homeActionUrl The fully qualified home URL to use in a form action @param string $language Optional. The desired language as a 2 letters code. If not supplied, current language is used.
@return string
@since 1.0.4
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/wordpress/helper.php @ line 126
weeblramp_skip_item
Route filter
Filter whether an item (post, page, custom) should be amplified or not.
This filter is run after weeblrAMP has already applied user set rules for AMPlification, so it can only disable AMPlification for an item, not enable it
@param bool $skipItem Whether the item should be AMPlified or not @param int $item_id Id of the WP_Post which is linked to, if any @param mixed $item the item itself
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/class/taxonomy.php @ line 108
weeblramp_standalone_mode
Route filter
Filter whether weeblrAMP standalone mode is enabled
@param bool $isStandaloneMode
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 93
weeblramp_url_is_internal
Route filter
Filter whether a URL is internal to the site.
@param bool $urlIsInternal Whether the URL is internal @param string $url The fully qualified URL we want to find about @param string $canonicalRootUrl The root URL of the site, as reported by WP
@return string
@since 1.0.4
in /wp-content/plugins/weeblramp/vendor/weeblr/wblib/packages/system/route.php @ line 137
Group: Seo
amp_post_template_metadata
Seo filter
Runs the Automattic plugin json-ld filter.
Filter the AMP Json+ld manifest, an associative array of values to be output as the json+ld manifest of the AMP page. weeblrAMP will convert it to Json before output.
@param array $jsonld An array of structured data @param WP_Post $post The post being displayed.
@return array
@since 1.8.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 964
weeblramp_get_jsonld_data
Seo filter
Filter the AMP manifest Json+LD data.
This is an array of page and author data. It will be later on json_encoded when rendered.
@param array $jsonld The full array of json+ld data collected/built. @param array $pageData The full array of data available about the current page being rendered.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 1036
weeblramp_get_metadata
Seo filter
Filter the page meta data
This is an array of page meta data. Includes: meta (title, description,...), Open Graph, Twitter Cards, Facebook App id, Tweet Via, Publisher Id
@param array $data The full array of meta data collected/built
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/metadata.php @ line 70
weeblramp_get_ogp
Seo filter
Filter the page OpenGraph data, as an associative array of values.
@param array $ogp An array of OGP data @param array $pageData Full array of page data collected up to now.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/metadata.php @ line 164
weeblramp_get_structured_data
Seo filter
Filter the page schema.org structured data.
This is an array of all schema.org structured data built/collected. It will be later on json_encoded when rendering the page.
@param array $data The full array of structured data. @param array $pageData The full array of data available about the current page being rendered.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/structureddata.php @ line 72
weeblramp_get_tcards
Seo filter
Filter the page Twitter Cards data, as an associative array of values.
@param array $tcards An array of Twitter Cards data @param array $pageData Full array of page data collected up to now.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/metadata.php @ line 208
weeblramp_json_manifest
Seo filter
Filter the AMP Json+ld manifest, an associative array of values to be output as the json+ld manifest of the AMP page. weeblrAMP will convert it to Json before output.
@param array $jsonld An array of structured data @param array $data Full array of page data collected up to now.
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 981
Group: System
weeblramp_custom_rewrite_rules
System filter
Filter list of custom rewrite rules added for AMP support
Rules are listed using the following format (example from system config)
Priority 200
// categories
'200.categories' => array(
'rule' => '{CATEGORY_BASE}/(.+?)/{PAGINATION_BASE}/([0-9]{1,})/{AMP_SUFFIX}/?$',
'rewrite' => 'index.php?category_name=$matches[1]&paged=$matches[2]&{AMP_SUFFIX}=1',
'permalink_structure' => '',
'position' => 'top'
),
'200.categories.numeric' => array(
'rule' => 'archives/{CATEGORY_BASE}/(.+?)/{PAGINATION_BASE}/([0-9]{1,})/{AMP_SUFFIX}/?$',
'rewrite' => 'index.php?category_name=$matches[1]&paged=$matches[2]&{AMP_SUFFIX}=1',
'permalink_structure' => WeeblrampClass_Route::PERMALINK_NUMERIC,
'position' => 'top'
),
Notes:
- the identifier (200.categories.numeric) is prepended with an integer to control the order in which rules are added to WordPress rewrite rules list.
naming: NN.jetpack.project-type (example)
NN is an integer, standard rules have NN = 100
Higher number have higher precedence
- 'rule' and 'rewrite" are same as WordPress
- 'permalink_structure", if provided, will cause the rule to only be injected if WordPress current user-selected permalink structure is the one specified
- 'position' is used when calling "add_rewrite_rules"
@param array $rules List of rewrite rules used on current request
@return array
@since 1.0.0
in /wp-content/plugins/weeblramp/class/route.php @ line 675
weeblramp_disable_newrelic
System filter
Filter whether to disable NewRelic extension when rendering an AMP page. NewRelic can cause AMP pages to invalidate.
@param bool $disable If true, Newrelic will be disabled
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/environment.php @ line 41
weeblramp_disable_pagespeed
System filter
Filter whether to disable PageSpeed when rendering an AMP page. PageSpeed can cause AMP pages to invalidate. PageSpeed is disabled by sending out appropriate headers
@param bool $disable If true, PageSpeed will be disabled
@return bool
@since 1.0.0
in /wp-content/plugins/weeblramp/helper/environment.php @ line 73
weeblramp_request_type
System filter
Filter the name of the current request type
Built-in types are:
home
error
archive
search
archive
page
single
One can add more request types (see WooCommerce plugin for instance), but suitable models and layouts should be provided for rendering.
@param string $type Current request type @param WP_Query $wp_query Current global WordPress query object
@return string
@since 1.0.0
in /wp-content/plugins/weeblramp/model/renderer.php @ line 432