Hello @mariakravchenko,
Our developer prepared code that needs to be changed in WP Property plugin and list of the files to change, so it will stop conflicting with other plugins:
// #############################################
// \wp-property\lib\class_core.php
// Line 527
//From:
function admin_body_class( $content ) {
global $current_screen;
if( $current_screen->id == 'edit-property' ) {
return 'wp-list-table ';
}
if( $current_screen->id == 'property' ) {
return 'wpp_property_edit';
}
}
// To:
function admin_body_class( $content ) {
global $current_screen;
if( $current_screen->id == 'edit-property' ) {
$content .= ' wp-list-table ';
}
if( $current_screen->id == 'property' ) {
$content .= ' wpp_property_edit ';
}
return $content;
}
// #############################################
// \wp-property\lib\classes\class-admin.php
// Line 164
// From:
public function admin_body_class() {
global $current_screen, $wp_properties;
// Do nothing.
if( !isset( $current_screen->base ) || !isset( $current_screen->post_type ) || !isset( $current_screen->taxonomy ) || $current_screen->post_type !== 'property' ) {
return;
}
// When developer mode is enabeld, allow editing.
if( isset( $wp_properties['configuration'] ) && isset( $wp_properties['configuration']['developer_mode'] ) && $wp_properties['configuration']['developer_mode'] === 'true' ) {
return;
}
$_readonly_taxonomies = array();
foreach( $wp_properties['taxonomies'] as $_tax => $_tax_detail ) {
if( isset( $_tax_detail['readonly'] ) && ( $_tax_detail['readonly'] === 'true' || $_tax_detail['readonly'] == 1 || $_tax_detail['readonly'] === '1' ) ) {
$_readonly_taxonomies[] = $_tax;
}
}
// Hide term editing UI.
if( $current_screen->base === 'edit-tags' && in_array($current_screen->taxonomy, $_readonly_taxonomies ) ) {
return 'wpp-disable-term-editing wpp-readonly-taxonomy';
}
}
// To:
public function admin_body_class( $classes ) {
global $current_screen, $wp_properties;
// Do nothing.
if( !isset( $current_screen->base ) || !isset( $current_screen->post_type ) || !isset( $current_screen->taxonomy ) || $current_screen->post_type !== 'property' ) {
return $classes;
}
// When developer mode is enabeld, allow editing.
if( isset( $wp_properties['configuration'] ) && isset( $wp_properties['configuration']['developer_mode'] ) && $wp_properties['configuration']['developer_mode'] === 'true' ) {
return $classes;
}
$_readonly_taxonomies = array();
foreach( $wp_properties['taxonomies'] as $_tax => $_tax_detail ) {
if( isset( $_tax_detail['readonly'] ) && ( $_tax_detail['readonly'] === 'true' || $_tax_detail['readonly'] == 1 || $_tax_detail['readonly'] === '1' ) ) {
$_readonly_taxonomies[] = $_tax;
}
}
// Hide term editing UI.
if( $current_screen->base === 'edit-tags' && in_array($current_screen->taxonomy, $_readonly_taxonomies ) ) {
return $classes .= ' wpp-disable-term-editing wpp-readonly-taxonomy ';
}
}
// #############################################
// \wp-property-importer\lib\class-wpp-property-import.php
// Line 527
// From:
static public function admin_body_class( $id ) {
global $current_screen, $post;
if( $current_screen->id == 'property' ) {
$wpp_import_schedule_id = get_post_meta( $post->ID, 'wpp_import_schedule_id', true );
if( $wpp_import_schedule_id ) {
return 'wpp_property_edit wpp_imported_property';
} else {
return 'wpp_property_edit';
}
}
}
// To:
static public function admin_body_class( $classes ) {
global $current_screen, $post;
if( $current_screen->id == 'property' ) {
$wpp_import_schedule_id = get_post_meta( $post->ID, 'wpp_import_schedule_id', true );
if( $wpp_import_schedule_id ) {
return $classes .= ' wpp_property_edit wpp_imported_property ';
} else {
return $classes .= ' wpp_property_edit ';
}
}
return $classes;
}
You can easily spot differences. Your plugin do return 'wpp_property_edit';
so it returns only its class. But you should do return $classes .= ' wpp_property_edit ';
to append it’s classes instead if needed.
Let us know if you have more questions.
kind regards,
Kasia