Unanswered Questions
1,566 questions with no upvoted or accepted answers
2
votes
0
answers
48
views
configure additonal build files in the @wordpress/create-block
I'm using the @wordpress/create-block package to create my block plugin. It comes with preconfigured webpack settings to build all the assets. By default as js in the src/ folder is built in the build/...
2
votes
0
answers
78
views
Is there any halfway decent documentation on the wp.media JS class?
Sorry for the somewhat rambly question, but has anyone ever seen any good piece of documentation, or maybe even a tutorial on the wp.media JS class?
All that i could find documentation-wise is this ...
2
votes
0
answers
158
views
How to add more elements to an already existing <PanelBody> section in Gutenberg
I am filtering core blocks to add more functionality and I know how I can create a new section in the sidebar that is opened by default like this:
return (
<>
...
2
votes
0
answers
130
views
Prevent posts from being published if the 'Uncategorized'-category or no category is selected
I do not want a user to be able to publish a post if no category is selected. This exact solution from a similar question is exactly what i want to do:
jQuery(document).ready(function ($) {
// ...
2
votes
0
answers
597
views
Wordpress Gutenberg: Attribute overwritten by block duplicate
For a custom wordpress gutenberg block I've created a list of buttons so that users can add/remove as many as needed. While this works pretty fine one issue occurs: When duplicating a block the ...
2
votes
0
answers
608
views
Get Required Assets (JS, CSS etc) for post using REST API
I'm using the REST API to access WordPress data and publish it on a custom frontend as part of an integration.
This works great because the shortcodes are parsed and rendered by WordPress so the ...
2
votes
0
answers
292
views
Passing RichText attributes to function onChange
I have four RichText elements in a custom Gutenberg block I am developing, and they are all very similar except for the "name" attribute, which is currently hard-coded. What I need to do is ...
2
votes
0
answers
346
views
Including dependencies using @wordpress/dependency-extraction-webpack-plugin
I would like to add include additional script handles to the dependencies in assets.php using @wordpress/dependency-extraction-webpack-plugin.
An example for this would be a script that extends ...
2
votes
0
answers
347
views
Gutenberg - Add align controls to a custom block
I want to add align controls to a custom block.
I wrote this code thad adds the code that adds the default block alignment toolbar to the block, but I select and change the align, I get an the ...
2
votes
0
answers
779
views
Nonces, AJAX, script variables & security in WordPress
Alright, so let's say you develop a website where you enqueue a js script on a page X of your frontend, using:
wp_enqueue_script(
'script_handle',
PATH_TO_SCRIPT,
array(),
'1.0.0',
true
);
...
2
votes
0
answers
266
views
Override Plugin Script Fucnction in Wordpress
I don't know how to remove a specific function from a plugin.
My plugin is Photo-gallery.
I want to remove this function:
function spider_createpopup(url, current_view, width, height, duration, ...
2
votes
0
answers
97
views
Hook all http requests
How do I hook all http requests in wordpress? More specifically I am interested in examining an http header in the request and then potentially modifying headers in the request so that other plugins ...
2
votes
1
answer
2k
views
Uncaught TypeError: Cannot read property 'firstChild' of null after upgrading to WordPress 5.5
I am getting the following error from comment-reply.min.js (which seems to be a WordPress file):
Uncaught TypeError: Cannot read property 'firstChild' of null
at comment-reply.min.js?ver=...
2
votes
0
answers
871
views
What is the correct way to import the blocks-editor?
I was following a blocks tutorial that was using @wordpress/editor to import some components and everything was working correctly but I was getting tons of deprecation warnings in the browser all ...
2
votes
1
answer
97
views
How do I store information in a dynamic block in WordPress?
I am trying to develop a dynamic block plugin where I store up to 7 links using Gutenberg and so far here is part of my code:
edit: props => {
const {
attributes: {
links = [],
...