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

Customizing Default attributes for Posts Inserter block and JS Errors #1207

Open
tnog opened this issue Jun 30, 2023 · 0 comments
Open

Customizing Default attributes for Posts Inserter block and JS Errors #1207

tnog opened this issue Jun 30, 2023 · 0 comments

Comments

@tnog
Copy link

tnog commented Jun 30, 2023

Hi,

We're trying to customize the Posts Inserter block for the following cases:

  • Our site doesn't use the default Post and we wanted to change the default postType block attribute to one of our CPTs.
  • We wanted to also set displayAuthor to true so that the block would always inject the author.

I've tried a few different approaches to try to update the default attributes (theme.json, register_block_type_args filter, but none so far seem to work.

In addition, when trying to modify the block interface using some custom Javascript there appears to be an error that's preventing execution of any additional scripts.

mediaelement-and-player.js?ver=4.2.17:1034 Uncaught TypeError: Cannot set properties of undefined (setting 'mejs')
    at 7.3 (mediaelement-and-player.js?ver=4.2.17:1034:23)
    at s (mediaelement-and-player.js?ver=4.2.17:11:268)
    at mediaelement-and-player.js?ver=4.2.17:11:319
    at 6.2 (mediaelement-and-player.js?ver=4.2.17:570:13)
    at s (mediaelement-and-player.js?ver=4.2.17:11:268)
    at e (mediaelement-and-player.js?ver=4.2.17:11:439)
    at mediaelement-and-player.js?ver=4.2.17:11:468
7.3 @ mediaelement-and-player.js?ver=4.2.17:1034
s @ mediaelement-and-player.js?ver=4.2.17:11
(anonymous) @ mediaelement-and-player.js?ver=4.2.17:11
6.2 @ mediaelement-and-player.js?ver=4.2.17:570
s @ mediaelement-and-player.js?ver=4.2.17:11
e @ mediaelement-and-player.js?ver=4.2.17:11
(anonymous) @ mediaelement-and-player.js?ver=4.2.17:11
mediaelement-migrate.js?ver=6.2.2:4 Uncaught ReferenceError: mejs is not defined
    at mediaelement-migrate.js?ver=6.2.2:4:2
    at mediaelement-migrate.js?ver=6.2.2:84:3
(anonymous) @ mediaelement-migrate.js?ver=6.2.2:4
(anonymous) @ mediaelement-migrate.js?ver=6.2.2:84
jquery.js?ver=3.6.4:4095 Uncaught TypeError: $(...).not(...).filter(...).mediaelementplayer is not a function
    at HTMLDocument.initialize (wp-mediaelement.js?ver=6.2.2:84:6)
    at mightThrow (jquery.js?ver=3.6.4:3802:29)
    at process (jquery.js?ver=3.6.4:3870:12)

We've tested with plugins disabled, and with the default Twenty Twenty-Three theme with the same errors showing up.

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

1 participant