post_type, AMP_QUERY_VAR ) ) { return false; } if ( post_password_required( $post ) ) { return false; } if ( true === apply_filters( 'amp_skip_post', false, $post->ID, $post ) ) { return false; } return true; } /** * Are we currently on an AMP URL? * * Note: will always return `false` if called before the `parse_query` hook. */ function is_amp_endpoint() { if ( 0 === did_action( 'parse_query' ) ) { _doing_it_wrong( __FUNCTION__, sprintf( esc_html__( "is_amp_endpoint() was called before the 'parse_query' hook was called. This function will always return 'false' before the 'parse_query' hook is called.", 'amp' ) ), '0.4.2' ); } return false !== get_query_var( AMP_QUERY_VAR, false ); } function amp_get_asset_url( $file ) { return plugins_url( sprintf( 'assets/%s', $file ), AMP__FILE__ ); }