WooCommerce custom SVG coloring tool [closed]
WooCommerce custom SVG coloring tool [closed]
WooCommerce custom SVG coloring tool [closed]
Ok, so I read up a bit and realized I cannot mix and match (React and pure JS). So, in the new WooCommerce they’ve created so-called slot fills that you can use to create your own react component as a separate plugin that you can then attach in a few places. Once you do that, … Read more
This question isn’t really specific to WordPress since it deals with generic JS, but: instead of attaching your validation to the submit action, do it onblur for each field. That way the user gets instant feedback and can be very helpful if they’re using keyboard navigation because they only have to tab back one field.
Turns out to be quite simple in WordPress 6.5. Use wp_register_script_module to register the imports, and include them as dependencies in wp_enqueue_script_module: add_action(‘wp_enqueue_scripts’, ‘enqueue_three_d_script’); function enqueue_three_d_script() { wp_register_script_module( ‘three’, “https://unpkg.com/[email protected]/build/three.module.js”, array(), null ); wp_register_script_module( ‘three/addons/’, “https://unpkg.com/[email protected]/examples/jsm/”, array(), null ); wp_enqueue_script_module( ‘three-d-script’, SCRIPTS_DIR . ‘threeDTest.js’, array(‘three’, ‘three/addons/’), null ); }
You are a bit unspecific in terms of where you are trying to execute the request. In case you want to GET data from an external point, you need to make sure that you are properly authenticated. In case you want to GET data internally, you need to make sure you are including the correct … Read more
The function wp_enqueue_script takes a parameter $ver that you can use to automatically add an version parameter to the URL. To always load the newest version of your Javascript-File, you can use the php filemtime-function to give the timestamp of the modification date. In a Plugin, use like this: wp_register_script( ‘my-awesome-script’, plugin_dir_url( __FILE__ ). ‘assets/my-awesome-script.js’, … Read more
Extend WordPress Gutenberg core/navigation-link
Rather than binding text with a directive, you could bind a callback with data-wp-watch that sets the inner HTML of the div when it runs: <div data-wp-watch=”callbacks.renderContent”></div> callbacks: { renderContent() { const context = getContext(); const element = getElement(); element.ref.innerHTML = context.randomPost.content.rendered; }, }, Since the callback uses context.randomPost.content.rendered, it should run any time that … Read more
Why Is wp.editor Not Adding the ”Add Media” Button When I Initialize It?
How to add new ACF repeater row after removing all rows using jQuery/Javascript