“wp-editor” script should not be enqueued together with the new widgets editor
-
Notice: Trying to get property 'post_status' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2298 Notice: Trying to get property 'post_status' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2302 Notice: Trying to get property 'post_status' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2308 Notice: Trying to get property 'post_status' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2312 Notice: Trying to get property 'ID' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2316 Notice: Trying to get property 'post_status' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2320 Notice: Trying to get property 'ID' of non-object in /home/kaztokyo/www/wordpress/wp-admin/includes/template.php on line 2334
This code is shown in Customize
Notice: Function wp_enqueue_script() was called incorrectly. "wp-editor" script should not be enqueued together with the new widgets editor (wp-edit-widgets or wp-customize-widgets). Please see Debugging in WordPress for more information. (This message was added in version 5.8.0.) in /home/kaztokyo/www/wordpress/wp-includes/functions.php on line 6031
This code is shown in Widget
Error is about “wp-editor”
New Widget and class widget is about.
<?php /**************************************** functions.php テーマ内で利用する関数を定義したり、 テーマの設定を行うためのファイルです。 functions.php のコードに関しては、 CHAPTER 11, 12 で詳しく解説しています。 *****************************************/ // テーマの機能をサポート // Theme support add_theme_support('menus'); add_theme_support('wp-block-styles'); add_theme_support('responsive-embeds'); add_theme_support('align-wide'); // Block editor styles add_action('after_setup_theme', function () { add_theme_support('editor-styles'); add_editor_style('css/editor-style.css'); }); // Admin styles add_action('admin_enqueue_scripts', function () { $admin_style_path = get_template_directory() . "/css/admin-style.css"; if (file_exists($admin_style_path)) { $admin_style_version = filemtime($admin_style_path); wp_enqueue_style("admin-style", get_template_directory_uri() . "/css/admin-style.css", array(), $admin_style_version); } }); // Block editor assets add_action('enqueue_block_editor_assets', function () { $editor_style_path = get_template_directory() . "/css/editor-style.css"; $editor_script_path = get_template_directory() . "/js/editor-style.js"; $editor_style_version = file_exists($editor_style_path) ? filemtime($editor_style_path) : null; $editor_script_version = file_exists($editor_script_path) ? filemtime($editor_script_path) : null; wp_enqueue_style("editor-style", get_template_directory_uri() . "/css/editor-style.css", array(), $editor_style_version); wp_enqueue_script('editor-script', get_template_directory_uri() . "/js/editor-style.js", array('wp-blocks'), $editor_script_version, true); }); // Google Fonts // function add_google_fonts() { // wp_enqueue_style('google_fonts_open_sans', 'https://fonts.googleapis.com/css2?family=Inter:wght@100;400&display=swap', array(), null); // } // add_action('wp_enqueue_scripts', 'add_google_fonts'); // Awesome Fonts function add_awesome_fonts() { wp_enqueue_script('awesome_fonts', 'https://kit.fontawesome.com/653858111e.js'); } add_action('wp_enqueue_scripts', 'add_awesome_fonts'); // CSS Cache update function themebs_enqueue_styles() { $version = filemtime(get_template_directory() . '/style.css'); $style_files = array( 'bootstrap_css' => '/css/bootstrap.css', 'bootstrap_custom' => '/css/bootstrap.custom.css', 'editor_style' => '/css/editor-style.css', 'lite-yt-embed' => '/css/lite-yt-embed.css', 'lite-vimeo-embed' => '/css/lite-vimeo-embed.css', 'style' => '/style.css', 'swiper-style' => '/css/swiper-bundle.css', 'slicknav-custom' => '/css/slicknav.css', 'slick-slider' => '/css/slick.css', 'admin-style' => '/css/admin-style.css', 'lightbox_css' => '/css/lightbox.css', ); foreach ($style_files as $handle => $file_path) { wp_enqueue_style($handle, get_template_directory_uri() . $file_path, array(), $version); } } add_action('wp_enqueue_scripts', 'themebs_enqueue_styles'); // JS scripts function themebs_enqueue_scripts() { $version = filemtime(get_template_directory() . '/js/scripts.js'); $script_files = array( 'jquery-migrate' => '/js/jquery-migrate-3.3.2.js', 'bootstrap_min' => '/js/bootstrap.min.js', 'swiper-slider' => '/js/swiper-bundle.min.js', 'slicknav' => '/js/jquery.slicknav.min.js', 'slick-slider' => '/js/slick.min.js', 'isotope' => '/js/isotope.pkgd.min.js', 'dotdot' => '/js/jquery.dotdotdot.min.js', 'imagesloaded' => '/js/imagesloaded.pkgd.min.js', 'js-script' => '/js/scripts.js', 'lite-yt-embed' => '/js/lite-yt-embed.js', 'lite-vimeo-embed' => '/js/lite-vimeo-embed.js', // 'lightbox_js' => '/js/lightbox.js', 'lightbox_min_js' => '/js/lightbox.min.js', ); foreach ($script_files as $handle => $file_path) { wp_enqueue_script($handle, get_template_directory_uri() . $file_path, array('jquery'), $version, true); } } add_action('wp_enqueue_scripts', 'themebs_enqueue_scripts', 11); // Priority 11, load before wp-editor // wp-editorスクリプトを除外 function exclude_wp_editor_script() { /* $screen = get_current_screen(); // Check if we are on the widgets or customize screen if ($screen && ($screen->id == 'widgets' || $screen->id == 'customize')) { // 新しいウィジェットエディターが表示されている場合は 'wp-editor' スクリプトを除外 if (function_exists('wp_edit_widgets') || function_exists('wp_customize_widgets')) { wp_dequeue_script('wp-editor'); } } */ } // add_action('wp_enqueue_scripts', 'exclude_wp_editor_script', 12); // 優先度12、wp-editorの後に読み込む
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘“wp-editor” script should not be enqueued together with the new widgets editor’ is closed to new replies.