Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using inside WordPress Widget #23

Closed
kallookoo opened this issue Sep 17, 2018 · 9 comments
Closed

Error using inside WordPress Widget #23

kallookoo opened this issue Sep 17, 2018 · 9 comments
Labels
need verification Possible bug that needs to be verified

Comments

@kallookoo
Copy link
Owner

kallookoo commented Sep 17, 2018

HI kallookoo,

thanks on quick answer. Here is the video showing the issue https://www.screencast.com/t/77bakoIH As you can see, problem is that button for save is never in disabled state with saved label. Also, remove label is not shown. Maybe the biggest problem is that when you use colorpicker with alpha on widget page, when you want to navigate off, confirmation dialog is displayed on top of the window and users get confused, everything is saved, but confirmation dialog is displayed. Could you please consider some improvement regarding this?

Thanks in advance,
Uros

Originally posted by @urosmil in #22 (comment)

@kallookoo kallookoo changed the title HI kallookoo, Error using inside WordPress Widget Sep 17, 2018
@kallookoo kallookoo added bug need verification Possible bug that needs to be verified labels Sep 17, 2018
@kallookoo
Copy link
Owner Author

Hi @urosmil
Would it be possible to send me the widget code, so I do not have to do it?

@urosmil
Copy link

urosmil commented Sep 18, 2018

test-color.zip

Hi @kallookoo In the attachment you can find widget php file, js for color picker in admin and alpha script. Add them to theme root and then in functions.php add following code

include_once 'test-color.php';

function load_test_color_script() {
	wp_enqueue_style( 'wp-color-picker' );
	wp_enqueue_script( 'wp-color-picker-alpha',MASTERDS_FRAMEWORK_INC_URL_PATH . '/common/assets/js/plugins/wp-color-picker-alpha.min.js', array( 'wp-color-picker'));
	wp_enqueue_script( 'test-color-js', get_template_directory_uri() . '/test-color.js', array( 'jquery' ), false, true );
}

add_action( 'admin_enqueue_scripts', 'load_test_color_script' );

@kallookoo
Copy link
Owner Author

Thanks @urosmil
I'll use it in the default WordPress theme (Twenty Sixteen) and check what exactly happens.
I guess for the weekend, you will have an answer.

@urosmil
Copy link

urosmil commented Sep 18, 2018

Thanks a lot @kallookoo

@urosmil
Copy link

urosmil commented Sep 28, 2018

Hi @kallookoo Any update on this? Tnx

@kallookoo
Copy link
Owner Author

Hi @urosmil
Sorry, I thought I answered you.
Apparently it's not the script's fault, it's your code.
I recommend you check the Text Widget code and adapt it.
Sources:
/wp-includes/widgets/class-wp-widget-text.php and
/wp-admin/js/widgets/text-widgets.js

@urosmil
Copy link

urosmil commented Oct 1, 2018

Hi @kallookoo thanks for the answer. I must disappoint you but I have just tested the code on 2017 theme. No plugins active, just pure 2017 theme, included scripts and widget, problem still remains. Can you please double check it? :/

@K15Lmk98
Copy link

K15Lmk98 commented Dec 7, 2018

Sorry, this is an automatic translation

Hi kallookoo,
I confirm the urosmil problem, both on my work theme (Genesis child) and on clean installation WP 4.9.8 and Twenty Sixteen theme: 1.6

TEST
WP 4.9.8
Twenty Sixteen themeVersion: 1.6
File: test-color.zip sent by urosmil

Note
I unlike urosmil, I use a different JS code, but the error is the same.
Thanks, Claudio_

@kallookoo kallookoo removed the bug label Aug 27, 2020
@kallookoo
Copy link
Owner Author

I close it. I have created a widget in the plugin and it works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need verification Possible bug that needs to be verified
Projects
None yet
Development

No branches or pull requests

3 participants