Editing Source Code in WordPress

You don’t want to edit core WordPress code. You don’t need to edit core WordPress code to do what you need to implement. First, you need to study the WordPress templating (i.e. Theme) functionality. Then, you need to study Plugins and the WordPress Hooks API, including its Action Hooks and its Filter Hooks. To do … Read more

Load multiple Javascript scripts

I formatted that code as best I could, and once formatted it is obviously very broken. wp_enqueue_script takes 5 parameters. You have 9. And several of the first five are wrong. I expect that you would see errors if you had debugging enabled. You seem to be trying to enqueue all of your scripts in … Read more

How to get the ToggleControl Gutenberg component working for a PHP Block

The issue is that in ToggleControl you are using the wrong prop for the value. It should be checked instead of value. Also use the blockEditor package instead of editor for InspectorControls as it will be deprecated. el( ToggleControl, { label: ‘Toogle’, checked: props.attributes.toggle, // here onChange: ( value ) => { props.setAttributes( { toggle: … Read more

Get loading state of wp data selector

Yes, it’s possible and you’d use wp.data.select( ‘core/data’ ).isResolving(). Example based on your code: const MyComponent = withSelect(select => { const { isResolving } = select( ‘core/data’ ); const query = { _fields: ‘id,name,slug’ }; return { terms: select(‘core’).getEntityRecords(“taxonomy”, “my_taxonomy”, query), isRequesting: isResolving( ‘core’, ‘getEntityRecords’, [ ‘taxonomy’, ‘my_taxonomy’, query ] ) }; })(props => { … Read more