From 992e693df778e04f878a0018e1e599a1017dc09d Mon Sep 17 00:00:00 2001 From: Sanketio Date: Mon, 4 Aug 2025 17:37:16 +0530 Subject: [PATCH] Add filter to disable page row actions --- class-simple-page-ordering.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/class-simple-page-ordering.php b/class-simple-page-ordering.php index fa82b05..ea1550c 100644 --- a/class-simple-page-ordering.php +++ b/class-simple-page-ordering.php @@ -400,6 +400,20 @@ public static function page_row_actions( $actions, $post ) { return $actions; } + /** + * Allow or disallow new row actions. + * + * @since 2.7.5 + * + * @param boolean $should_add_actions Whether to add the new row actions. + * @param array $actions An array of row action links. + * @param WP_Post $post The post object. + */ + $should_add_actions = apply_filters( 'simple_page_ordering_allow_row_actions', true, $actions, $post ); + if ( ! $should_add_actions ) { + return $actions; + } + list( 'top_level_pages' => $top_level_pages, 'children_pages' => $children_pages ) = self::get_walked_pages( $post->post_type ); $edit_link = get_edit_post_link( $post->ID, 'raw' );