Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大神请教一个问题 #6

Open
shiguangxiaotou3 opened this issue Feb 16, 2023 · 1 comment
Open

大神请教一个问题 #6

shiguangxiaotou3 opened this issue Feb 16, 2023 · 1 comment

Comments

@shiguangxiaotou3
Copy link

大神请教一个问题,关于wp 媒体的问题


我在自己写的mvc插件框架上传媒体库时 wp.media is not a function

这是商城子模块源码,在子模块所有控制器上执行,之前加载js文件

这是控制器源码

这是视图源码

报错页面


@ericandrewlewis
Copy link
Owner

ericandrewlewis commented Feb 18, 2023

Hi @shiguangxiaotou3,

Do you see a <script> tag for any of the media JS files in the HTML? I wonder when your bootstrap() method is invoked. If it is after admin_enqueue_scripts hook has fired, then the callback registerMedia() will not be called.

I don't typically provide general WordPress support, you may want to ask a question on a forum like WordPress Development Stack Exchange or the Official WordPress forum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants