- 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
+3 -24
View File
@@ -51,26 +51,24 @@ if ( ! class_exists( 'Admin_Enqueue' ) ) {
/***
*** @enter title placeholder
***/
function enter_title_here( $title ){
function enter_title_here( $title ) {
$screen = get_current_screen();
if ( 'um_directory' == $screen->post_type ){
$title = 'e.g. Member Directory';
}
if ( 'um_role' == $screen->post_type ){
$title = 'e.g. Community Member';
}
if ( 'um_form' == $screen->post_type ){
$title = 'e.g. New Registration Form';
}
return $title;
}
/***
*** @Runs on admin head
***/
function admin_head(){
if ( $this->is_plugin_post_type() ){
if ( UM()->admin()->is_plugin_post_type() ){
?>
@@ -87,25 +85,6 @@ if ( ! class_exists( 'Admin_Enqueue' ) ) {
}
/***
*** @check that we're on a custom post type supported by UM
***/
function is_plugin_post_type(){
if (isset($_REQUEST['post_type'])){
$post_type = $_REQUEST['post_type'];
if ( in_array($post_type, array('um_form','um_role','um_directory'))){
return true;
}
} else if ( isset($_REQUEST['action'] ) && $_REQUEST['action'] == 'edit') {
$post_type = get_post_type();
if ( in_array($post_type, array('um_form','um_role','um_directory'))){
return true;
}
}
return false;
}
/***
*** @Load Form
***/