Comments (4)
@congkun-ck thank you for reporting this. I agree that this isn't the best way to do things and I've already developed a fix for this.
The reason why this is currently isn't causing too many issues I think is because most WordPress sites store roles in the database and therefore they would already be accessible when we create that instance of the WP_Roles
class. But it is possible to prevent the WP_Roles
class from pulling data from the database and instead only use what's dynamically registered.
In any case, I wanted to check if you would like a beta build for this? If so, I'll generate one and post it here down below.
from all-in-one-seo-pack.
@arnaudbroes thanks for the quick response, Arnaud.
I made a quick mitigation on my website with a small plugin which just resets $current_user
on setup_theme
, so I am now not blocked. However I am happy to help try the beta fix.
from all-in-one-seo-pack.
@congkun-ck I've made some other changes but to fix this I basically just assigned our instance to a variable instead of the global like this -
public function getUserRoles() {
global $wp_roles;
$wpRoles = $wp_roles;
if ( ! is_object( $wpRoles ) ) {
// Don't assign this to the global because otherwise WordPress won't override it.
$wpRoles = new \WP_Roles();
}
$roleNames = $wpRoles->get_names();
asort( $roleNames );
return $roleNames;
}
from all-in-one-seo-pack.
@congkun-ck we fixed this some months ago in version 4.1.5 so I'll close the issue now.
from all-in-one-seo-pack.
Related Issues (20)
- Bug: AIOSEO removes the "dashicons" stylesheet from WP frontend HOT 2
- The editor has encountered an unexpected error. HOT 2
- meta og:site_name generated despite being left blank HOT 2
- Robots.php error with PHP 8.1 HOT 2
- Call to Undefined Method - When saving a menu HOT 2
- Ping not working HOT 1
- The aiosp_opengraph_meta filter isn't working – cannot re-write og:url... HOT 2
- Updating link editor modal styles for WordPress 6.1 HOT 2
- Remove version number from generator meta tag HOT 1
- Version 4.3.3 broke query loop to cpt, pages, post after updating to WordPress 6.2 HOT 3
- Person/sameAs invalid type issue HOT 1
- Custom Archive and Polylang HOT 1
- Please remove "table.wp-list-table .column-name" css rule HOT 2
- Warning: Undefined array key "dashboardWidgets" after plugin update HOT 1
- Deprecated: Function print_emoji_styles in /wp-admin/index.php?page=aioseo-setup-wizard HOT 1
- TypeError in custom robots.txt editor HOT 2
- High number of deprecated notices HOT 2
- Does aioseo_options_internal need to be autoloaded? HOT 2
- aioseo_save_post filter not saving/persisting data HOT 3
- while activating got JS error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from all-in-one-seo-pack.