| @@ -509,5 +509,27 @@ | ||
| 509 | 509 | wp_register_script( 'numeral', VISUALIZER_ABSURL . 'js/lib/numeral.min.js', array(), Visualizer_Plugin::VERSION ); |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | } |
| 513 | + | |
| 514 | + /** | |
| 515 | + * Renders save chart as image setting group. | |
| 516 | + * | |
| 517 | + * @access protected | |
| 518 | + */ | |
| 519 | + protected function _renderChartImageSettings() { | |
| 520 | + // Default enable if amp is active. | |
| 521 | + $is_amp = function_exists( 'amp_is_enabled' ) && amp_is_enabled(); | |
| 522 | + $this->save_chart_image = null === $this->save_chart_image && $is_amp ? true : $this->save_chart_image; | |
| 523 | + | |
| 524 | + self::_renderSectionStart( esc_html__( 'Save chart as an image inside Media Library', 'visualizer' ), false ); | |
| 525 | + self::_renderCheckboxItem( | |
| 526 | + esc_html__( 'Save inside media library?', 'visualizer' ), | |
| 527 | + 'save_chart_image', | |
| 528 | + $this->save_chart_image ? true : false, | |
| 529 | + 'yes', | |
| 530 | + esc_html__( 'To enable save the image as an inside media library.', 'visualizer' ), | |
| 531 | + false | |
| 532 | + ); | |
| 533 | + self::_renderSectionEnd(); | |
| 534 | + } | |
| 513 | 535 | } |