| @@ -63,41 +63,16 @@ | ||
| 63 | 63 | return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint(); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * Loads the alternate view of the chart. | |
| 67 | + * Loads the alterview view of the chart. | |
| 68 | 68 | */ |
| 69 | 69 | public function get_chart( $chart, $data, $series, $settings ) { |
| 70 | - // let's check if there is a view parameter in the GET request. | |
| 71 | - $view = isset( $_GET['view'] ) ? $_GET['view'] : null; | |
| 72 | - | |
| 73 | - if ( ! empty( $view ) ) { | |
| 74 | - // attachmend id? | |
| 75 | - if ( is_numeric( $view ) ) { | |
| 76 | - $view = wp_get_attachment_url( $view ); | |
| 77 | - } | |
| 78 | - | |
| 79 | - $attributes = wp_check_filetype( $view ); | |
| 80 | - if ( $attributes && false !== strpos( $attributes['type'], 'image/' ) ) { | |
| 81 | - // absolute url or relative? | |
| 82 | - if ( 0 !== strpos( $view, 'http' ) ) { | |
| 83 | - $view = site_url( $view ); | |
| 84 | - } | |
| 85 | - $view = '<img src="' . $view . '">'; | |
| 86 | - } | |
| 87 | - | |
| 88 | - if ( ! empty( $view ) ) { | |
| 89 | - return $view; | |
| 90 | - } | |
| 91 | - } | |
| 92 | - | |
| 93 | 70 | $view = apply_filters( 'visualizer_amp_view', null, $chart, $data, $series, $settings ); |
| 94 | 71 | if ( ! is_null( $view ) ) { |
| 95 | 72 | return $view; |
| 96 | 73 | } |
| 97 | - $output = $this->_getDataAs( $chart->ID, 'image' ); | |
| 98 | - if ( empty( $output['csv'] ) ) { | |
| 99 | - $output = $this->_getDataAs( $chart->ID, 'print' ); | |
| 100 | - } | |
| 74 | + $output = $this->_getDataAs( $chart->ID, 'print' ); | |
| 101 | 75 | return $output['csv']; |
| 102 | 76 | } |
| 77 | + | |
| 103 | 78 | } |