WPML
状态
未解决
报告针对
WPML Multilingual CMS 4.5.9
主题标签
Bug

问题概述

非管理员用户(如编辑或自定义角色)在访问与高级翻译编辑器 (ATE) 任务同步相关的某些 WPML 功能时,会在浏览器控制台中遇到 403 Forbidden 错误。在检查浏览器开发者工具中的控制台选项卡时,可以明显看到此错误。

请注意,此问题不会影响您的网站或其翻译,您可以继续使用 WPML 并翻译您的网站。

临时解决方法

在继续操作之前,请确保对您的站点进行完整备份


  • 打开 …/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Loader.php 文件。

  • 替换:
    			Hooks::onAction( 'wp_loaded' )
    			     ->then( [ self::class, 'getData' ] )
    			     ->then( $maybeLoadStatusBarAndATEConsole )
    			     ->then( Resources::enqueueApp( 'ate-jobs-sync' ) )
    			     ->then( Fns::always( make( \WPML_TM_Scripts_Factory::class ) ) )
    			     ->then( invoke( 'localize_script' )->with( 'wpml-ate-jobs-sync-ui' ) );


  • 替换为:
    		if (current_user_can('translate') || current_user_can('manage_options') || current_user_can('manage_translations')) {
    			Hooks::onAction( 'wp_loaded' )
    			     ->then( [ self::class, 'getData' ] )
    			     ->then( $maybeLoadStatusBarAndATEConsole )
    			     ->then( Resources::enqueueApp( 'ate-jobs-sync' ) )
    			     ->then( Fns::always( make( \WPML_TM_Scripts_Factory::class ) ) )
    			     ->then( invoke( 'localize_script' )->with( 'wpml-ate-jobs-sync-ui' ) );
    		}

所有已知问题 →