
如何在不同操作系统上安装phpMyAdmin
wp_check_widget_editor_deps ( No parameters )
wp_check_widget_editor_deps: 这是一个检查WordPress小工具编辑器所需依赖性的函数。它可以用来确保在使用小工具编辑器时,所有必要的脚本和样式都被加载。
显示一个_doing_it_wrong()的信息,用于冲突的小工具编辑器脚本。
wp-editor”脚本模块被暴露为window.wp.editor。这覆盖了传统的TinyMCE编辑器模块,它是小工具编辑器所需要的。因为这个冲突,这两者不应该被排在一起。见https://core.trac.wordpress.org/ticket/53569。
还有一个与样式有关的冲突,如果一个区块引用了”wp-edit-post”样式表,那么区块小工具编辑器就会被隐藏。见https://core.trac.wordpress.org/ticket/53569。
function wp_check_widget_editor_deps() { global $wp_scripts, $wp_styles; if ( $wp_scripts->query( 'wp-edit-widgets', 'enqueued' ) || $wp_scripts->query( 'wp-customize-widgets', 'enqueued' ) ) { if ( $wp_scripts->query( 'wp-editor', 'enqueued' ) ) { _doing_it_wrong( 'wp_enqueue_script()', sprintf( /* translators: 1: 'wp-editor', 2: 'wp-edit-widgets', 3: 'wp-customize-widgets'. */ __( '"%1$s" script should not be enqueued together with the new widgets editor (%2$s or %3$s).' ), 'wp-editor', 'wp-edit-widgets', 'wp-customize-widgets' ), '5.8.0' ); } if ( $wp_styles->query( 'wp-edit-post', 'enqueued' ) ) { _doing_it_wrong( 'wp_enqueue_style()', sprintf( /* translators: 1: 'wp-edit-post', 2: 'wp-edit-widgets', 3: 'wp-customize-widgets'. */ __( '"%1$s" style should not be enqueued together with the new widgets editor (%2$s or %3$s).' ), 'wp-edit-post', 'wp-edit-widgets', 'wp-customize-widgets' ), '5.8.0' ); } } }