Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert option page function into classes #466

Closed
SteveJonesDev opened this issue Jan 25, 2024 · 0 comments · May be fixed by #507
Closed

Convert option page function into classes #466

SteveJonesDev opened this issue Jan 25, 2024 · 0 comments · May be fixed by #507
Assignees
Labels
enhancement New feature or request

Comments

@SteveJonesDev
Copy link
Member

SteveJonesDev commented Jan 25, 2024

https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/options-page.php

Should be an EDAC\Admin class. Added to the admin folder. Maybe a namespace for settings EDAC\Admin\Settings

edac_user_can_ignore() function could be moved into EDAC\Admin\Helpers. I don't think it needs to be deprecated.

function edac_user_can_ignore() {
if ( current_user_can( 'manage_options' ) ) {
return true;
}
$user = wp_get_current_user();
$user_roles = ( isset( $user->roles ) ) ? $user->roles : array();
$ignore_user_roles = get_option( 'edacp_ignore_user_roles' );
$interset = ( $user_roles && $ignore_user_roles ) ? array_intersect( $user_roles, $ignore_user_roles ) : false;
return ( $interset );
}

Separate classes for edac_add_options_page method.

Separate classes for each setting edac_register_setting possibly with a PHP Interface that requires the add_settings_field, callback, and sanitize methods.

Dev Notes:
Submit a PR to the develop branch, and assign @SteveJonesDev reviewer.

@SteveJonesDev SteveJonesDev added the enhancement New feature or request label Jan 25, 2024
@SteveJonesDev SteveJonesDev added this to the v1.9.0 milestone Jan 25, 2024
@SteveJonesDev SteveJonesDev modified the milestones: v1.9.0, v2.0.0 Feb 2, 2024
@SteveJonesDev SteveJonesDev self-assigned this Feb 2, 2024
@SteveJonesDev SteveJonesDev modified the milestones: v1.10.0, v1.11.0 Mar 15, 2024
@SteveJonesDev SteveJonesDev modified the milestones: v1.11.0, v1.12.0 Mar 27, 2024
@SteveJonesDev SteveJonesDev removed this from the v1.12.0 milestone Apr 30, 2024
@SteveJonesDev SteveJonesDev closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants