Fixed issues with "key => value" fields (dropdown + multiselect) if 'um_select_options_pair' filter is used;

Added JS filters to member directory functionality;
This commit is contained in:
nikitasinelnikov
2020-02-06 14:54:13 +02:00
parent 52dfdb5d54
commit 067f0d6a78
12 changed files with 193 additions and 83 deletions
+3 -3
View File
@@ -37,7 +37,7 @@ function um_admin_new_modal( id, ajax, size ) {
function um_tinymce_init( id, content ) {
var object = jQuery('#' + id);
if ( typeof(tinyMCE) === 'object' && tinyMCE.get( id ) !== null ) {
if ( typeof( tinyMCE ) === 'object' && tinyMCE.get( id ) !== null ) {
tinyMCE.triggerSave();
tinyMCE.EditorManager.execCommand( 'mceRemoveEditor', true, id );
"4" === tinyMCE.majorVersion ? window.tinyMCE.execCommand( "mceRemoveEditor", !0, id ) : window.tinyMCE.execCommand( "mceRemoveControl", !0, id );
@@ -55,7 +55,7 @@ function um_tinymce_init( id, content ) {
QTags( tinyMCEPreInit.qtInit[ id ] );
QTags._buttonsInit();
}
if ( typeof(window.switchEditors) === 'object' ) {
if ( typeof( window.switchEditors ) === 'object' ) {
window.switchEditors.go( id );
}
tinyMCE.init( init );
@@ -79,7 +79,7 @@ function um_tinymce_init( id, content ) {
jQuery( 'body' ).on( 'click', '.wp-switch-editor', function() {
var target = jQuery(this);
if ( target.hasClass( 'wp-switch-editor' ) && typeof(window.switchEditors) === 'object' ) {
if ( target.hasClass( 'wp-switch-editor' ) && typeof( window.switchEditors ) === 'object' ) {
var mode = target.hasClass( 'switch-tmce' ) ? 'tmce' : 'html';
window.switchEditors.go( id, mode );
}
+9 -7
View File
@@ -652,10 +652,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
/**
* Print editor scripts if they are not printed by default
* @return type
*/
function admin_footer_scripts() {
$CLASS = '\_WP_Editors';
/**
* @var $class \_WP_Editors
*/
$class = '\_WP_Editors';
if ( did_action( 'print_default_editor_scripts' ) ) {
return;
@@ -663,17 +665,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Enqueue' ) ) {
if ( did_action( 'wp_tiny_mce_init' ) ) {
return;
}
if ( has_action( 'admin_print_footer_scripts', array( $CLASS, 'editor_js' ) ) ) {
if ( has_action( 'admin_print_footer_scripts', array( $class, 'editor_js' ) ) ) {
return;
}
if ( !class_exists( $CLASS, false ) ) {
if ( ! class_exists( $class, false ) ) {
require_once( ABSPATH . WPINC . '/class-wp-editor.php' );
}
$CLASS::force_uncompressed_tinymce();
$CLASS::enqueue_scripts();
$CLASS::editor_js();
$class::force_uncompressed_tinymce();
$class::enqueue_scripts();
$class::editor_js();
}
}