PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.3.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.3.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
← All changes | includes/Config/CPT/VirtualPostBuilder.php +28 -0 2.2.11 → 2.3.0 View file →
@@ -33,8 +33,36 @@
33 33 * @param InlineTableScanner $scanner Scanner used to locate inline table blocks.
34 34 */
35 35 public function __construct( InlineTableScanner $scanner ) {
36 36 $this->scanner = $scanner;
37 + add_filter( 'post_row_actions', array( $this, 'strip_incompatible_row_actions' ), 1, 2 );
38 + }
39 +
40 + /**
41 + * @param array $actions Row action links, keyed by action name.
42 + * @param WP_Post $post The row's post (real or virtual).
43 + * @return array Unmodified row actions (only third-party hook state is changed).
44 + */
45 + public function strip_incompatible_row_actions( array $actions, WP_Post $post ): array {
46 + if ( empty( $post->tablekit_is_virtual ) ) {
47 + return $actions;
48 + }
49 +
50 + global $wp_filter;
51 + if ( ! isset( $wp_filter['post_row_actions'] ) || ! ( $wp_filter['post_row_actions'] instanceof \WP_Hook ) ) {
52 + return $actions;
53 + }
54 +
55 + foreach ( $wp_filter['post_row_actions']->callbacks as $priority => $callbacks ) {
56 + foreach ( $callbacks as $callback ) {
57 + $fn = $callback['function'];
58 + if ( is_string( $fn ) && false !== strpos( $fn, '_collaboration_row_actions' ) ) {
59 + remove_filter( 'post_row_actions', $fn, $priority );
60 + }
61 + }
62 + }
63 +
64 + return $actions;
37 65 }
38 66
39 67 /**
40 68 * Append synthetic "virtual" WP_Post rows to a query's results — one per