- fixed PHP notices when there aren't UM custom roles and we get bool variable from get_option( 'um_roles' );

This commit is contained in:
nikitasinelnikov
2020-12-16 13:37:13 +02:00
parent 0ee8878f90
commit 41350e1391
10 changed files with 28 additions and 24 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
*/
function load_role_wrapper() {
wp_register_script( 'um_admin_role_wrapper', $this->js_url . 'um-admin-role-wrapper.js', array( 'jquery' ), ultimatemember_version, true );
$localize_roles_data = get_option( 'um_roles' );
$localize_roles_data = get_option( 'um_roles', array() );
wp_localize_script( 'um_admin_role_wrapper', 'um_roles', (array) $localize_roles_data );
wp_enqueue_script( 'um_admin_role_wrapper' );
}