| @@ -275,9 +275,9 @@ | ||
| 275 | 275 | /** |
| 276 | 276 | * Get Post Meta Fields |
| 277 | 277 | */ |
| 278 | 278 | public function get_visualizer_data( $post ) { |
| 279 | - if ( ! current_user_can( 'edit_posts' ) ) { | |
| 279 | + if ( ! Visualizer_Module::can_edit_chart( $post['id'] ) ) { | |
| 280 | 280 | return false; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | $data = array(); |
| @@ -306,9 +306,9 @@ | ||
| 306 | 306 | // handle settings filter hooks |
| 307 | 307 | $data['visualizer-settings'] = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_SETTINGS, $data['visualizer-settings'], $post_id, $data['visualizer-chart-type'] ); |
| 308 | 308 | |
| 309 | 309 | // handle data filter hooks |
| 310 | - $data['visualizer-data'] = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, unserialize( html_entity_decode( get_the_content( $post_id ) ) ), $post_id, $data['visualizer-chart-type'] ); | |
| 310 | + $data['visualizer-data'] = apply_filters( Visualizer_Plugin::FILTER_GET_CHART_DATA, Visualizer_Module::decode_content( html_entity_decode( get_post_field( 'post_content', $post_id, 'raw' ) ) ), $post_id, $data['visualizer-chart-type'] ); | |
| 311 | 311 | |
| 312 | 312 | // we are going to format only for tabular charts, because we are not sure of the effect on others. |
| 313 | 313 | // this is to solve the case where boolean data shows up as all-ticks on gutenberg. |
| 314 | 314 | if ( in_array( $data['visualizer-chart-type'], array( 'tabular' ), true ) ) { |