コード例 #1
0
ファイル: index.php プロジェクト: johnleesw/mustardseedwp
                        $obj_role = get_role($role);
                        // add the custom capability to this role object
                        $obj_role->add_cap('wp_power_stats_admin');
                    }
                } else {
                    PowerStatsAdmin::$faulty_fields[] = __('some roles in "Statistics Admin Roles" were not found', 'wp-power-stats');
                }
            } else {
                // Remove the capability from all roles
                foreach ($wp_roles->roles as $role) {
                    $role = get_role(strtolower($role['name']));
                    $role->remove_cap('wp_power_stats_admin');
                }
                PowerStats::$options['admin_roles'] = '';
            }
        }
        break;
    case __('Advanced', 'wp-power-stats'):
        $options_on_this_page = array('session_duration' => array('description' => __('Visit Duration', 'wp-power-stats'), 'type' => 'integer', 'long_description' => __('Period of time, during which requests from the same uniquely identified client are considered a unique visit.', 'wp-power-stats'), 'after_input_field' => __('seconds', 'wp-power-stats')), 'extend_session' => array('description' => __('Extend Visit', 'wp-power-stats'), 'type' => 'yesno', 'long_description' => __('Extend the duration of a visit each time the user visits a new page.', 'wp-power-stats')));
        break;
    default:
        break;
}
if (has_filter('power_stats_options_on_page') && $config_tabs[$current_tab - 1] == __('Add-ons', 'wp-power-stats')) {
    $options_on_this_page = apply_filters('power_stats_options_on_page', $options_on_this_page);
}
if (isset($options_on_this_page)) {
    PowerStatsAdmin::update_options($options_on_this_page);
    PowerStatsAdmin::display_options($options_on_this_page, $current_tab);
}
echo '</div>';