This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $amp_blacklist_sanitizer = realpath( AMP__VENDOR__DIR__ . '/includes/sanitizers/class-amp-blacklist-sanitizer.php' ); | |
| if ( $amp_blacklist_sanitizer ) { | |
| include_once $amp_blacklist_sanitizer; | |
| } | |
| if ( class_exists( 'AMPforWP\\AMPVendor\\AMP_Blacklist_Sanitizer' ) ) { | |
| class AMP_New_Blacklist extends AMPforWP\AMPVendor\AMP_Blacklist_Sanitizer { | |
| const PATTERN_REL_WP_ATTACHMENT = '#wp-att-([\d]+)#'; | |
| protected $DEFAULT_ARGS = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Custom Plugin for AMP | |
| Description: Extension to add more functionality in AMPforWP | |
| Version: 1.0 | |
| Author: Marqas | |
| */ | |
| // Exit if accessed directly. | |
| if ( ! defined( 'ABSPATH' ) ) exit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Hello World!</title> | |
| </head> | |
| <body> | |
| <p>Example Gist to show in AMP</p> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'amp_skip_post', 'ampforwp_skip_amp_post', 10, 3 ); | |
| function ampforwp_skip_amp_post( $skip, $post_id, $post ) { | |
| $ampforwp_skip_posts_in = array(postid1, postid2, postid3, ....,postidn); | |
| if( in_array( $post_id, $ampforwp_skip_posts_in ) ) { | |
| $skip = true; | |
| } | |
| return $skip; | |
| } |