From 3fdd8430739f943edb9e85ab36e24508765fc47e Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Fri, 24 Mar 2017 18:26:05 +0200 Subject: [PATCH] fixed redirect field for 1 and 2 accessible option --- admin/core/um-admin-actions.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/admin/core/um-admin-actions.php b/admin/core/um-admin-actions.php index b99f9a5e..498aa8ec 100644 --- a/admin/core/um-admin-actions.php +++ b/admin/core/um-admin-actions.php @@ -70,10 +70,10 @@ } } - - function um_category_access_fields_create( $term ) { + + function um_category_access_fields_create( $term ){ global $ultimatemember; - + echo '
'; echo ''; echo ' @@ -88,20 +88,22 @@ echo ''; } echo '

' . __('This is applicable only if you restrict the content to logged-in users.','ultimatemember') . '

'; + echo ''; + echo ''; + echo '

' . __('Users who cannot see content will get redirected to that URL.','ultimatemember') . '

'; echo '
'; echo '
'; echo ''; - echo ''; + echo ''; echo '

' . __('Users who cannot see content will get redirected to that URL.','ultimatemember') . '

'; echo '
'; } - - function um_category_access_fields_edit( $term ) { + function um_category_access_fields_edit( $term ){ global $ultimatemember; - + $termID = $term->term_id; $termMeta = get_option( "category_$termID" ); $_um_accessible= (isset( $termMeta['_um_accessible'] ) )? $termMeta['_um_accessible'] : ''; @@ -127,18 +129,24 @@ } echo '  '; } + echo '

' . __('This is applicable only if you restrict the content to logged-in users.','ultimatemember') . '

'; + echo ""; + echo ""; + echo ""; + echo ''; + echo ''; echo '

' . __('Users who cannot see content will get redirected to that URL.','ultimatemember') . '

'; echo ""; echo ""; echo ""; echo ''; - echo ''; + echo ''; echo '

' . __('Users who cannot see content will get redirected to that URL.','ultimatemember') . '

'; echo ""; + } - function um_category_access_fields_save( $termID ){ if ( isset( $_POST['_um_accessible'] ) ) { @@ -151,6 +159,7 @@ // get value and save it into the database - maybe you have to sanitize your values (urls, etc...) $termMeta['_um_accessible'] = isset( $_POST['_um_accessible'] ) ? $_POST['_um_accessible'] : ''; $termMeta['_um_redirect'] = isset( $_POST['_um_redirect'] ) ? $_POST['_um_redirect'] : ''; + $termMeta['_um_redirect2'] = isset( $_POST['_um_redirect2'] ) ? $_POST['_um_redirect2'] : ''; $termMeta['_um_roles'] = isset( $_POST['_um_roles'] ) ? $_POST['_um_roles'] : ''; update_option( "category_$termID", $termMeta );