예제 #1
0
 function drop_alpha_indexes()
 {
     global $wpdb;
     require_once dirname(__FILE__) . '/admin/update_pp.php';
     // note: these indexes only existed with PP2 alpha code
     $arr_sql = array("DROP INDEX `pp_exc2agent` ON {$wpdb->ppc_exceptions}", "DROP INDEX `pp_exc2item` ON {$wpdb->ppc_exceptions}", "DROP INDEX `pp_inherited` ON {$wpdb->ppc_exception_items}", "DROP INDEX `pp_exception_item` ON {$wpdb->ppc_exception_items}");
     PP_Updated::do_index_drop($arr_sql, 'pp_dropped_ppc_idx');
 }
예제 #2
0
 public static function activate()
 {
     global $pp_db_setup_done;
     // set_current_user may have triggered DB setup already
     if (empty($pp_db_setup_done)) {
         $ver = (array) get_option('pp_c_version');
         $db_ver = isset($ver['db_version']) ? $ver['db_version'] : '';
         require_once dirname(__FILE__) . '/db-setup_pp.php';
         PP_DB_Setup::db_setup($db_ver);
     }
     require_once dirname(__FILE__) . '/admin/update_pp.php';
     PP_Updated::sync_wproles();
     update_option('pp_activation', true);
     do_action('pp_activate');
 }
예제 #3
0
 function act_sync_wproles($user_ids = '', $role_name = '', $blog_id_arg = '')
 {
     require_once dirname(__FILE__) . '/update_pp.php';
     PP_Updated::sync_wproles($user_ids, $role_name, $blog_id_arg);
 }
예제 #4
0
 function update_page_options($args)
 {
     global $pp_default_options;
     do_action('pp_update_options', $args);
     $default_prefix = apply_filters('pp_options_apply_default_prefix', '', $args);
     foreach (explode(',', $_POST['all_options']) as $option_basename) {
         $value = isset($_POST[$option_basename]) ? $_POST[$option_basename] : '';
         if (!is_array($value)) {
             $value = trim($value);
         }
         if ('beta_updates' == $option_basename) {
             if (stripslashes_deep($value) != pp_get_option('beta_updates')) {
                 // force regeneration and buffering of file update urls
                 delete_site_transient('update_plugins');
                 pp_get_version_info(true, false, true);
                 wp_update_plugins();
             }
         }
         pp_update_option($default_prefix . $option_basename, stripslashes_deep($value), $args);
     }
     foreach (explode(',', $_POST['all_otype_options']) as $option_basename) {
         // support stored default values (to apply to any post type which does not have an explicit setting)
         if (isset($_POST[$option_basename][0])) {
             $_POST[$option_basename][''] = $_POST[$option_basename][0];
             unset($_POST[$option_basename][0]);
         }
         $value = isset($pp_default_options[$option_basename]) ? $pp_default_options[$option_basename] : array();
         if ($current = pp_get_option($option_basename)) {
             // retain setting for any types which were previously enabled for filtering but are currently not registered
             $value = array_merge($value, $current);
         }
         if (isset($_POST[$option_basename])) {
             $value = array_merge($value, $_POST[$option_basename]);
         }
         foreach (array_keys($value) as $key) {
             $value[$key] = stripslashes_deep($value[$key]);
         }
         pp_update_option($default_prefix . $option_basename, $value, $args);
     }
     if (!empty($_POST['post_blockage_priority'])) {
         // once this is switched on manually, don't ever default-disable it again
         if (get_option('ppperm_legacy_exception_handling')) {
             delete_option('ppperm_legacy_exception_handling');
             require_once dirname(__FILE__) . '/admin/admin-load_pp.php';
             _pp_dashboard_dismiss_msg();
         }
     }
     if (!empty($_POST['do_group_index_drop'])) {
         if (get_option('pp_need_group_index_drop')) {
             require_once dirname(__FILE__) . '/admin/update_pp.php';
             PP_Updated::do_index_drop(PP_Updated::drop_group_indexes_sql(), 'pp_did_group_index_drop');
             delete_option('pp_need_group_index_drop');
         }
     }
 }
예제 #5
0
function pp_populate_roles()
{
    require_once dirname(__FILE__) . '/admin/update_pp.php';
    PP_Updated::populate_roles(true);
}