- 2.0.1 version;

- small code optimization;
- fix for update user profile role change;
This commit is contained in:
nikitozzzzzzz
2018-02-08 15:27:01 +02:00
parent 9546ac0a6c
commit 54016fdaab
6 changed files with 67 additions and 122 deletions
+23
View File
@@ -21,6 +21,29 @@ if ( ! class_exists( 'Admin' ) ) {
}
/**
* Check if current page load UM post type
*
*
* @return bool
*/
function is_plugin_post_type() {
if ( isset( $_REQUEST['post_type'] ) ) {
$post_type = $_REQUEST['post_type'];
if ( in_array( $post_type, array( 'um_form','um_directory' ) ) ) {
return true;
}
} elseif ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'edit' ) {
$post_type = get_post_type();
if ( in_array( $post_type, array( 'um_form', 'um_directory' ) ) ) {
return true;
}
}
return false;
}
/**
* Check if plugin is installed with correct folder
*/