diff --git a/inc/utility-functions.php b/inc/utility-functions.php index ac4305bd..9d5c7980 100644 --- a/inc/utility-functions.php +++ b/inc/utility-functions.php @@ -73,22 +73,33 @@ function ppseries_settings_template_tabbed_callback(){ //activation functions/codes function pp_series_upgrade_function() { + $version = get_option('pp_series_version'); - if ( !$version || $version < '2.7.1') { - /** - * add newly introduced manage_publishpress_series for administrator - *#https://github.com/publishpress/publishpress-series/issues/313 - **/ - // Init roles - if ( function_exists( 'get_role' ) ) { - $role = get_role( 'administrator' ); - if ( null !== $role && ! $role->has_cap( 'manage_publishpress_series' ) ) { - $role->add_cap( 'manage_publishpress_series' ); - } - } - update_option('pp_series_version', ORG_SERIES_VERSION); - } + if ( !$version || $version < '2.7.1') { + /** + * add newly introduced manage_publishpress_series for administrator + *#https://github.com/publishpress/publishpress-series/issues/313 + **/ + // Init roles + if ( function_exists( 'get_role' ) ) { + $role = get_role( 'administrator' ); + if ( null !== $role && ! $role->has_cap( 'manage_publishpress_series' ) ) { + $role->add_cap( 'manage_publishpress_series' ); + } + } + update_option('pp_series_version', ORG_SERIES_VERSION); + } + + if (!get_option('pp_series_2_7_5_upgraded')) { + $settings = get_option('org_series_options'); + $settings = apply_filters('org_series_settings', $settings); + //add new series settings + $settings['automatic_series_part'] = 1; + update_option('org_series_options', $settings); + update_option('pp_series_2_7_5_upgraded', true); + } + } } diff --git a/orgSeries-options.php b/orgSeries-options.php index 58920f65..36891b5a 100644 --- a/orgSeries-options.php +++ b/orgSeries-options.php @@ -140,6 +140,7 @@ function orgseries_validate($input) { $newinput['custom_css'] = ( isset($input['custom_css']) && $input['custom_css'] == 1 ? 1 : 0 ); $newinput['series_css_tougle'] = ( isset($input['series_css_tougle']) ? trim(stripslashes(($input['series_css_tougle'])), 1) : 'default' ); $newinput['kill_on_delete'] = ( isset($input['kill_on_delete']) && $input['kill_on_delete'] == 1 ? 1 : 0 ); + $newinput['automatic_series_part'] = ( isset($input['automatic_series_part']) && $input['automatic_series_part'] == 1 ? 1 : 0 ); $newinput['series_toc_url'] = preg_replace('/(^\/)|(\/$)/', '', ($input['series_toc_url'])); $newinput['series_custom_base'] = preg_replace('/(^\/)|(\/$)/', '', ($input['series_custom_base'])); @@ -223,7 +224,7 @@ function orgseries_options_init() { function ppseries_filter_admin_settings_tabs($settings_tabs){ $settings_tabs['series_taxonomy_base_settings'] = esc_html__('URLs and Taxonomy', 'organize-series'); - $settings_tabs['series_uninstall_settings'] = esc_html__('Uninstall / Reset', 'organize-series'); + $settings_tabs['series_uninstall_settings'] = esc_html__('Advanced', 'organize-series'); return $settings_tabs; } @@ -806,6 +807,19 @@ function series_uninstall_core_fieldset() { ?> + + + + +
+ + +