| @@ -288,17 +288,8 @@ | ||
| 288 | 288 | if ( empty( $table['id'] ) ) { |
| 289 | 289 | return new WP_Error( 'table_save_empty_table_id' ); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | - /** | |
| 293 | - * Fires before a table is saved. | |
| 294 | - * | |
| 295 | - * @since 3.1.0 | |
| 296 | - * | |
| 297 | - * @param string $table_id ID of the table to be saved. | |
| 298 | - */ | |
| 299 | - do_action( 'tablepress_event_pre_save_table', $table['id'] ); | |
| 300 | - | |
| 301 | 292 | $post_id = $this->_get_post_id( $table['id'] ); |
| 302 | 293 | if ( false === $post_id ) { |
| 303 | 294 | return new WP_Error( 'table_save_no_post_id_for_table_id', '', $table['id'] ); |
| 304 | 295 | } |
| @@ -335,9 +326,9 @@ | ||
| 335 | 326 | * Fires after a table has been saved. |
| 336 | 327 | * |
| 337 | 328 | * @since 1.5.0 |
| 338 | 329 | * |
| 339 | - * @param string $table_id ID of the saved table. | |
| 330 | + * @param string $table_id ID of the added table. | |
| 340 | 331 | */ |
| 341 | 332 | do_action( 'tablepress_event_saved_table', $table['id'] ); |
| 342 | 333 | |
| 343 | 334 | return $table['id']; |
| @@ -453,17 +444,8 @@ | ||
| 453 | 444 | if ( ! $this->table_exists( $table_id ) ) { |
| 454 | 445 | return new WP_Error( 'table_delete_table_does_not_exist', '', $table_id ); |
| 455 | 446 | } |
| 456 | 447 | |
| 457 | - /** | |
| 458 | - * Fires before a table is deleted. | |
| 459 | - * | |
| 460 | - * @since 3.1.0 | |
| 461 | - * | |
| 462 | - * @param string $table_id ID of the table to be deleted. | |
| 463 | - */ | |
| 464 | - do_action( 'tablepress_event_pre_delete_table', $table_id ); | |
| 465 | - | |
| 466 | 448 | $post_id = $this->_get_post_id( $table_id ); // No ! false check necessary, as this is covered by table_exists() check above. |
| 467 | 449 | |
| 468 | 450 | // @phpstan-ignore argument.type |
| 469 | 451 | $deleted = $this->model_post->delete( $post_id ); // Post Meta fields will be deleted automatically by that function. |
| @@ -626,15 +608,8 @@ | ||
| 626 | 608 | foreach ( $cache_flush_hooks as $cache_flush_hook ) { |
| 627 | 609 | do_action( $cache_flush_hook ); |
| 628 | 610 | } |
| 629 | 611 | |
| 630 | - // Cloudflare APO. | |
| 631 | - if ( class_exists( '\Cloudflare\APO\WordPress\Hooks' ) ) { | |
| 632 | - $_cloudflare = new \Cloudflare\APO\WordPress\Hooks(); | |
| 633 | - if ( is_callable( array( $_cloudflare, 'purgeCacheEverything' ) ) ) { | |
| 634 | - $_cloudflare->purgeCacheEverything(); | |
| 635 | - } | |
| 636 | - } | |
| 637 | 612 | // Kinsta. |
| 638 | 613 | if ( isset( $GLOBALS['kinsta_cache'] ) && ! empty( $GLOBALS['kinsta_cache']->kinsta_cache_purge ) && is_callable( array( $GLOBALS['kinsta_cache']->kinsta_cache_purge, 'purge_complete_caches' ) ) ) { |
| 639 | 614 | $GLOBALS['kinsta_cache']->kinsta_cache_purge->purge_complete_caches(); // @phpstan-ignore method.nonObject |
| 640 | 615 | } |
| @@ -648,9 +623,9 @@ | ||
| 648 | 623 | if ( is_callable( array( $_pagely, 'purgeAll' ) ) ) { |
| 649 | 624 | $_pagely->purgeAll(); |
| 650 | 625 | } |
| 651 | 626 | } |
| 652 | - // Pressidium. | |
| 627 | + // Pressidum. | |
| 653 | 628 | if ( is_callable( array( 'Ninukis_Plugin', 'get_instance' ) ) ) { |
| 654 | 629 | $_pressidum = Ninukis_Plugin::get_instance(); // @phpstan-ignore class.notFound |
| 655 | 630 | if ( is_callable( array( $_pressidum, 'purgeAllCaches' ) ) ) { |
| 656 | 631 | $_pressidum->purgeAllCaches(); // @phpstan-ignore method.nonObject |
| @@ -815,9 +790,9 @@ | ||
| 815 | 790 | 'datatables_scrollx' => false, |
| 816 | 791 | 'datatables_custom_commands' => '', |
| 817 | 792 | ), |
| 818 | 793 | 'visibility' => array( |
| 819 | - 'rows' => array( 1 ), // One visible row. | |
| 794 | + 'rows' => array( 1 ), // One visbile row. | |
| 820 | 795 | 'columns' => array( 1 ), // One visible column. |
| 821 | 796 | ), |
| 822 | 797 | ); |
| 823 | 798 | /** |
| @@ -934,13 +909,8 @@ | ||
| 934 | 909 | // $table['created'] = wp_date( 'Y-m-d H:i:s' ); // We don't want this, as it would override the original datetime. |
| 935 | 910 | $table['last_modified'] = wp_date( 'Y-m-d H:i:s' ); |
| 936 | 911 | $table['options']['last_editor'] = get_current_user_id(); |
| 937 | 912 | |
| 938 | - // Prevent issues if the "Custom Commands" field is not set, e.g. when non-admins have previously edited the table. | |
| 939 | - if ( ! isset( $table['options']['datatables_custom_commands'] ) ) { | |
| 940 | - $table['options']['datatables_custom_commands'] = ''; | |
| 941 | - } | |
| 942 | - | |
| 943 | 913 | // Convert CSS classes and some DataTables 1.x parameters to the DataTables 2 variants. |
| 944 | 914 | if ( '' !== $table['options']['datatables_custom_commands'] ) { |
| 945 | 915 | $table['options']['datatables_custom_commands'] = TablePress::convert_datatables_api_data( $table['options']['datatables_custom_commands'] ); |
| 946 | 916 | } |
| @@ -1109,15 +1079,8 @@ | ||
| 1109 | 1079 | |
| 1110 | 1080 | foreach ( $table_post as $table_id => $post_id ) { |
| 1111 | 1081 | $table_options = $this->_get_table_options( $post_id ); |
| 1112 | 1082 | |
| 1113 | - // Fix tables where the "Custom Commands" entry is missing entirely. | |
| 1114 | - if ( ! isset( $table_options['datatables_custom_commands'] ) ) { | |
| 1115 | - $table_options['datatables_custom_commands'] = ''; | |
| 1116 | - $this->_update_table_options( $post_id, $table_options ); | |
| 1117 | - continue; | |
| 1118 | - } | |
| 1119 | - | |
| 1120 | 1083 | // Nothing to do if there are no "Custom Commands". |
| 1121 | 1084 | if ( '' === $table_options['datatables_custom_commands'] ) { |
| 1122 | 1085 | continue; |
| 1123 | 1086 | } |
| @@ -1264,14 +1227,9 @@ | ||
| 1264 | 1227 | } |
| 1265 | 1228 | |
| 1266 | 1229 | // Pretend that there is a `_tablepress_export_table_id` post meta field with the list of table IDs. |
| 1267 | 1230 | $key = '_tablepress_export_table_id'; |
| 1268 | - | |
| 1269 | - /** | |
| 1270 | - * Load WP export functions. | |
| 1271 | - */ | |
| 1272 | - require_once ABSPATH . 'wp-admin/includes/export.php'; | |
| 1273 | - $value = wxr_cdata( implode( ',', $table_ids ) ); | |
| 1231 | + $value = wxr_cdata( implode( ',', $table_ids ) ); // @phpstan-ignore function.notFound | |
| 1274 | 1232 | |
| 1275 | 1233 | // Hijack the filter and print extra XML code for our faked post meta field. |
| 1276 | 1234 | // phpcs:disable WordPress.Security.EscapeOutput.HeredocOutputNotEscaped |
| 1277 | 1235 | echo <<<WXR |