global $wpdb;
-
Hi,
When there is a reference to
$wpdb
in an Action or Filter, you must add theglobal $wpdb;
before the Action/Filter when using the “Code Snippets” Plugin but it’s not required in PHP when you add the code snippet to the child-theme’s functions.php file.Example:
add_action( "update_option_{$wpdb->prefix}user_roles", 'my_um_role_update_name', 10, 3 );
Would be nice if this can be fixed in the Plugin to be 100% compatible with using child-theme functions.php file.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘global $wpdb;’ is closed to new replies.