@@ -256,22 +256,6 @@ public static function import( $data, $replace = false ) {
256256 }//end foreach
257257 }//end if
258258
259- if ( isset ( $ data ['helpers ' ] ) && is_array ( $ data ['helpers ' ] ) ) {
260- foreach ( $ data ['helpers ' ] as $ helper_data ) {
261- $ helper = self ::import_pod_helper ( $ helper_data , $ replace );
262-
263- if ( ! $ helper ) {
264- continue ;
265- }
266-
267- if ( ! isset ( $ found ['helpers ' ] ) ) {
268- $ found ['helpers ' ] = array ();
269- }
270-
271- $ found ['helpers ' ][ $ helper ['name ' ] ] = $ helper ['name ' ];
272- }//end foreach
273- }//end if
274-
275259 $ found = apply_filters ( 'pods_packages_import ' , $ found , $ data , $ replace );
276260
277261 if ( ! empty ( $ found ) ) {
@@ -817,8 +801,8 @@ public static function import_pod_page( $data, $replace = false ) {
817801 ];
818802
819803 foreach ( $ excluded_args as $ excluded_arg ) {
820- if ( isset ( $ template [ $ excluded_arg ] ) ) {
821- unset( $ template [ $ excluded_arg ] );
804+ if ( isset ( $ page [ $ excluded_arg ] ) ) {
805+ unset( $ page [ $ excluded_arg ] );
822806 }
823807 }
824808 } elseif ( ! empty ( $ page ['options ' ] ) ) {
@@ -841,6 +825,8 @@ public static function import_pod_page( $data, $replace = false ) {
841825 /**
842826 * Handle importing of the pod helper.
843827 *
828+ * @deprecated 3.3.2
829+ *
844830 * @since 2.8.0
845831 *
846832 * @param array $data The import data.
@@ -849,49 +835,7 @@ public static function import_pod_page( $data, $replace = false ) {
849835 * @return array|\Pods\Whatsit|false The imported object or false if failed.
850836 */
851837 public static function import_pod_helper ( $ data , $ replace = false ) {
852- if ( isset ( $ data ['id ' ] ) ) {
853- unset( $ data ['id ' ] );
854- }
855-
856- $ helper = self ::$ api ->load_helper ( [ 'name ' => $ data ['name ' ] ] );
857-
858- if ( ! empty ( $ helper ) ) {
859- // Delete Helper if it exists
860- if ( $ replace ) {
861- self ::$ api ->delete_helper ( [ 'id ' => $ helper ['id ' ] ] );
862-
863- $ helper = [];
864- }
865- } else {
866- $ helper = [];
867- }
868-
869- // Backwards compatibility
870- if ( isset ( $ data ['phpcode ' ] ) ) {
871- $ data ['code ' ] = $ data ['phpcode ' ];
872-
873- unset( $ data ['phpcode ' ] );
874- }
875-
876- if ( isset ( $ data ['type ' ] ) ) {
877- if ( 'before ' === $ data ['type ' ] ) {
878- $ data ['type ' ] = 'pre_save ' ;
879- } elseif ( 'after ' === $ data ['type ' ] ) {
880- $ data ['type ' ] = 'post_save ' ;
881- }
882- }
883-
884- $ helper = pods_config_merge_data ( $ helper , $ data );
885-
886- if ( isset ( $ helper ['type ' ] ) ) {
887- $ helper ['helper_type ' ] = $ helper ['type ' ];
888-
889- unset( $ helper ['helper_type ' ] );
890- }
891-
892- self ::$ api ->save_helper ( $ helper );
893-
894- return $ helper ;
838+ return false ;
895839 }
896840
897841 /**
@@ -1157,28 +1101,6 @@ public static function export( $params ) {
11571101 }
11581102 }
11591103
1160- if ( ! empty ( $ helper_ids ) ) {
1161- $ api_params = array ();
1162-
1163- if ( true !== $ helper_ids ) {
1164- $ api_params ['ids ' ] = (array ) $ helper_ids ;
1165- }
1166-
1167- $ export ['helpers ' ] = array_values ( self ::$ api ->load_helpers ( $ api_params ) );
1168-
1169- foreach ( $ export ['helpers ' ] as $ k => $ helper ) {
1170- $ helper = $ helper ->get_clean_args ();
1171-
1172- foreach ( $ excluded_args as $ excluded_arg ) {
1173- if ( isset ( $ helper [ $ excluded_arg ] ) ) {
1174- unset( $ helper [ $ excluded_arg ] );
1175- }
1176- }
1177-
1178- $ export ['helpers ' ][ $ k ] = $ helper ;
1179- }
1180- }
1181-
11821104 /**
11831105 * Allow filtering the package being exported.
11841106 *
0 commit comments