File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,19 @@ public function enqueue_assets() {
115115 $ this ->asset_manager ->enqueue_style ( 'adminbar ' );
116116 }
117117
118+ /**
119+ * Filter the XPaths for which elements should get the data-ampdevmode attribute.
120+ *
121+ * Note that the data-ampdevmode attribute could alternatively be added via the style_loader_tag filter.
122+ *
123+ * @param string[] $xpaths XPaths.
124+ * @return string[] XPaths.
125+ */
126+ public function filter_amp_dev_mode_element_xpaths ( $ xpaths ) {
127+ $ xpaths [] = '//link[ @id = "yoast-seo-adminbar-css" ] ' ;
128+ return $ xpaths ;
129+ }
130+
118131 /**
119132 * Registers the hooks.
120133 *
@@ -129,6 +142,8 @@ public function register_hooks() {
129142
130143 add_action ( 'wp_enqueue_scripts ' , array ( $ this , 'enqueue_assets ' ) );
131144 add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'enqueue_assets ' ) );
145+
146+ add_filter ( 'amp_dev_mode_element_xpaths ' , array ( $ this , 'filter_amp_dev_mode_element_xpaths ' ) );
132147 }
133148
134149 /**
You can’t perform that action at this time.
0 commit comments