| Conditions | 3 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | function jetpack_inline_pdf_embed_handler( $matches, $attr, $url ) { |
||
| 21 | /** This action is documented in modules/widgets/social-media-icons.php */ |
||
| 22 | do_action( 'jetpack_bump_stats_extras', 'embeds', 'inline-pdf' ); |
||
| 23 | |||
| 24 | if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) { |
||
| 25 | return sprintf( |
||
| 26 | '<p><a href="%1$s">%2$s</a></p>', |
||
| 27 | esc_url( $url ), |
||
| 28 | esc_html__( 'PDF Document', 'jetpack' ) |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | return sprintf( |
||
| 32 | '<object data="%1$s" type="application/pdf" width="100%%" height="800"> |
||
| 33 | <p><a href="%1$s">%1$s</a></p> |
||
| 34 | </object>', |
||
| 35 | esc_attr( $url ) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 |