PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.32.55
E2Pdf – Export Pdf Tool for WordPress v1.32.55
1.32.55 1.32.56 1.32.53 1.32.51 1.32.49 1.32.48 1.32.43 1.32.40 1.32.34 1.32.32 1.32.31 1.32.26 1.32.22 1.32.23 1.32.18 1.32.17 1.32.15 trunk 1.00.00 1.00.13 1.01.01 1.02.02 1.03.07 1.04.07 1.05.03 All 76 releases
← All changes | classes/model/e2pdf-loader.php +45 -7 1.32.26 → 1.32.55 View file →
@@ -69,9 +69,9 @@
69 69 public function load_actions() {
70 70 if (is_admin()) {
71 71 add_action('wpmu_new_blog', [&$this, 'action_wpmu_new_blog']);
72 72 add_action('admin_menu', [&$this, 'action_admin_menu']);
73 - add_action('admin_init', [&$this, 'action_admin_init']);
73 + add_action('admin_init', [&$this, 'action_admin_init'], 9);
74 74 add_action('admin_enqueue_scripts', [&$this, 'action_admin_enqueue_scripts']);
75 75 add_action('current_screen', [&$this, 'action_current_screen']);
76 76 add_action('plugins_loaded', [&$this, 'action_plugins_loaded']);
77 77 }
@@ -501,8 +501,41 @@
501 501
502 502 // settings page
503 503 public function action_admin_init() {
504 504 register_setting('e2pdf-settings', 'e2pdf_debug');
505 +
506 + /**
507 + * Compatibility fix with Gallery : FooGallery
508 + * https://wordpress.org/plugins/foogallery/
509 + */
510 + if (class_exists('FooGallery_Admin_Extensions')) {
511 + if (!wp_doing_ajax()) {
512 + return;
513 + }
514 + $action = isset($_REQUEST['action']) && is_string($_REQUEST['action']) ? $_REQUEST['action'] : '';
515 + if ('e2pdf_upload' !== $action) {
516 + return;
517 + }
518 + global $wp_filter;
519 + if (isset($wp_filter['admin_init']) && $wp_filter['admin_init'] instanceof WP_Hook) {
520 + foreach ($wp_filter['admin_init']->callbacks as $priority => $callbacks) {
521 + if (!is_array($callbacks)) {
522 + continue;
523 + }
524 + foreach ($callbacks as $callback) {
525 + if (
526 + isset($callback['function']) &&
527 + is_array($callback['function']) &&
528 + isset($callback['function'][0], $callback['function'][1]) &&
529 + $callback['function'][0] instanceof FooGallery_Admin_Extensions &&
530 + 'handle_extension_action' === $callback['function'][1]
531 + ) {
532 + remove_action('admin_init', $callback['function'], $priority);
533 + }
534 + }
535 + }
536 + }
537 + }
505 538 }
506 539
507 540 // admin_enqueue_scripts action
508 541 public function action_admin_enqueue_scripts($page) {
@@ -859,8 +892,13 @@
859 892 /* translators: %d: Template ID */
860 893 'This will overwrite the Template ID "%d". Continue?' => __('This will overwrite the Template ID "%d". Continue?', 'e2pdf'),
861 894 'Filter' => __('Filter...', 'e2pdf'),
862 895 'Not linked' => __('Not linked', 'e2pdf'),
896 + 'Inner Radius' => __('Inner Radius', 'e2pdf'),
897 + 'Start Angle' => __('Start Angle', 'e2pdf'),
898 + 'Key Labels' => __('Key Labels', 'e2pdf'),
899 + 'Amount Labels' => __('Amount Labels', 'e2pdf'),
900 + 'Percent Labels' => __('Percent Labels', 'e2pdf'),
863 901 ];
864 902 break;
865 903 case 'params':
866 904 $nonces = [];
@@ -879,15 +917,11 @@
879 917 'extensions' => $model_e2pdf_extension->extensions(),
880 918 'template_sizes' => $controller_e2pdf_templates->get_sizes_list(),
881 919 'css_styles' => array_keys($this->helper->load('properties')->css_styles()),
882 920 'undo_limit' => get_option('e2pdf_undo_limit', '20'),
921 + 'extension_hooks' => apply_filters('e2pdf_extension_hooks', []),
883 922 ];
884 923 break;
885 - case 'frontend_params':
886 - $data = [
887 - 'pdfjs' => plugins_url('assets/pdf.js', $this->helper->get('plugin_file_path')),
888 - ];
889 - break;
890 924 default:
891 925 break;
892 926 }
893 927 return $data;
@@ -925,9 +959,9 @@
925 959 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
926 960 if ($current_screen->id == 'e2pdf_page_e2pdf-templates' && !isset($_GET['action'])) {
927 961 $screen_option = [
928 962 'label' => __('Templates per page', 'e2pdf') . ':',
929 - 'default' => get_option('e2pdf_templates_screen_per_page') ? get_option('e2pdf_templates_screen_per_page') : '20',
963 + 'default' => (int) get_option('e2pdf_templates_screen_per_page', '20'),
930 964 'option' => 'e2pdf_templates_screen_per_page',
931 965 ];
932 966 add_screen_option('per_page', $screen_option);
933 967 }
@@ -1112,8 +1146,12 @@
1112 1146 update_option('e2pdf_adobe_api_version', '0');
1113 1147 } else {
1114 1148 update_option('e2pdf_adobe_api_version', '1');
1115 1149 }
1150 + }
1151 +
1152 + if ((int) get_option('e2pdf_templates_screen_per_page', '20') <= 0) {
1153 + update_option('e2pdf_templates_screen_per_page', '20');
1116 1154 }
1117 1155
1118 1156 delete_option('e2pdf_developer');
1119 1157 delete_option('e2pdf_developer_ips');