You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
Actually the image does add, and if you look with inspector the value of the input field will change, its just that the thumbnail is not being displayed anymore because the container was deleted, and there was nothing written to handle re-adding it.
The changes need to happen in the /assets/settings.js file, but then this file should be minified, and the /assets/settings.min.js contents replaced (if you don't do this step it won't work!).
So, in /assets/settings.js change:
Line: 52 jQuery("#"+preview_id).attr('src',attachment.sizes.thumbnail.url);
To: jQuery("#"+preview_id).attr('src',attachment.sizes.thumbnail.url).show();
Line: 67 jQuery(this).closest('td').find( '.image_preview' ).remove();
To: jQuery(this).closest('td').find( '.image_preview' ).hide();
Please note that wordpress caches admin javascript files, so it is advisable to add some cache busting for a development of a wordpress plugin, i.e. in /includes/class-your-plugin.php
around 190, change: public function admin_enqueue_scripts ( $hook = '' ) { wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin' . $this->script_suffix . '.js', array( 'jquery' ), $this->_version ); wp_enqueue_script( $this->_token . '-admin' ); } // End admin_enqueue_scripts ()
to: public function admin_enqueue_scripts ( $hook = '' ) { wp_register_script( $this->_token . '-admin', esc_url( $this->assets_url ) . 'js/admin' . $this->script_suffix . '.js?t='.time(), array( 'jquery' ), $this->_version ); wp_enqueue_script( $this->_token . '-admin' ); } // End admin_enqueue_scripts ()
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First of all, go in the plugin's settings page.
The following steps are to reproduce the issue:
The text was updated successfully, but these errors were encountered: