Layout Settings in the new Gutenberg editor

For a very basic implementation of adding a text input to add body classes(would also work for adding a second field for post classes if necessary) to pages/posts, you could do the following: Register a custom field with register_post_meta – I’ll use an empty string for the first param, post_type so it applies to all. … Read more

How to solve react dom ‘removeChild’ on Node error while google translate extension is on and selecting any core block [closed]

This cannot be fixed from the WordPress side, it requires changes from the Google Translate team to work with WordPress’ block editor. Only Google can do that. If you need to translate the content of a post it can’t be done from inside the editor using a browser extension unless that browser extension was specifically … Read more

Using useSelect creates “minified React error”

If you check the URL given with the error message, you will see the full text as: Rendered more hooks than during the previous render. Inspecting the code, I see two uses of hooks: export default function Edit() { const allCPTposts = useSelect(select => { // ^ first hook use return select(“core”).getEntityRecords(“postType”, “post”, {per_page: -1}) … Read more

Unable to see the attributes for the custom block created

Attributes just define a “schema” of sorts which informs WordPress which persistent data is associated with a block, and how WordPress should parse it from the block’s saved markup/block grammar. WordPress makes no assumptions about if or how a UI should be constructed to expose attributes to the end-user – you must construct the UI … Read more

Pullquote Block Styles disappeared?

The solid colour pullquote style had been deprecated and removed in 2021, and was removed in favor of more comprehensive options based on block style options: Given that we can now achieve border and background variations using block supports, we’re removing the existing styles and adding a textAlign attribute to compensate. https://github.com/WordPress/gutenberg/pull/30951 If you really … Read more

wp-scripts start build hangs

Nothing is hanging. It’s just waiting for a change so that it can automatically build again. That’s what start does. If you just want to run a build once use build. The warnings in your second example are self explanatory: You’re using a font asset that is very large and exceeds the recommended maximum size. … Read more

Prevent FormTokenField component to accept random entries

On a recent project I handled this by just filtering out invalid values in the onChange callback: export default () => { const [value, setValue] = useState([]); const suggestions = [‘lorem’, ‘ipsum’, ‘dolor’, ‘sit’, ‘amet’]; const onChange = (tokens) => { const value = tokens.filter((t) => suggestions.includes(t)); setValue(value); }; return <FormTokenField onChange={onChange} suggestions={suggestions} value={value} />; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)