From 65d3c65ac2d7bb10017330925331183a80778ba6 Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Thu, 5 Dec 2024 15:01:10 +0530 Subject: [PATCH 1/2] `gpnf-detach-child-entry-from-parent.php`: Added snippet to display a metabox on Entry details for nested entries to detach from Parent Entry. --- .../gpnf-detach-child-entry-from-parent.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 gp-nested-forms/gpnf-detach-child-entry-from-parent.php diff --git a/gp-nested-forms/gpnf-detach-child-entry-from-parent.php b/gp-nested-forms/gpnf-detach-child-entry-from-parent.php new file mode 100644 index 000000000..29cced244 --- /dev/null +++ b/gp-nested-forms/gpnf-detach-child-entry-from-parent.php @@ -0,0 +1,41 @@ + 'Nested Forms', + 'callback' => 'detach_parent_entry_from_child', + 'context' => 'side', + ); + } + + } + + return $meta_boxes; +}, 10, 3 ); + +// Callback method +function detach_parent_entry_from_child( $args ) { + $action = 'gpnf_detach_parent_entry'; + $html = sprintf( '', 'Detach from Parent', $action ); + + echo $html; +} From 6c4b26eed8f0745ac704bb76d723c56107bdc736 Mon Sep 17 00:00:00 2001 From: Saif Sultan Date: Thu, 5 Dec 2024 15:17:58 +0530 Subject: [PATCH 2/2] `gpnf-detach-child-entry-from-parent.php`: Added snippet to display a metabox on Entry details for nested entries to detach from Parent Entry. --- gp-nested-forms/gpnf-detach-child-entry-from-parent.php | 1 - 1 file changed, 1 deletion(-) diff --git a/gp-nested-forms/gpnf-detach-child-entry-from-parent.php b/gp-nested-forms/gpnf-detach-child-entry-from-parent.php index 29cced244..79c1e6aa9 100644 --- a/gp-nested-forms/gpnf-detach-child-entry-from-parent.php +++ b/gp-nested-forms/gpnf-detach-child-entry-from-parent.php @@ -26,7 +26,6 @@ 'context' => 'side', ); } - } return $meta_boxes;