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

Widgets - Google Translate: change a PHP 5.4 array syntax, check if title is defined #5440

Merged

Conversation

eliorivero
Copy link
Contributor

@eliorivero eliorivero commented Oct 28, 2016

Fixes a couple of major issues spotted in https://github.com/Automattic/jetpack/pull/5386/files

Changes proposed in this Pull Request:

  • change a PHP 5.4 array syntax into PHP 5.2
  • check if title is defined to avoid issuing a PHP notice in Customizer
  • add support for Customizer's Selective Refresh
  • prefixes global JS function to avoid conflicts

Testing instructions:

  • make sure you can see PHP errors, go to Customizer, add the Google Translate widget. There should not be a PHP notice

  • when you update the widget in Customizer, make sure it's selectively refreshed, that is, only its portion is refreshed, rather than the whole page.

    @artpi I was concerned about these two changes, so I opened this. You can continue adding other changes here.

@eliorivero eliorivero added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Extra Sidebar Widgets [Status] In Progress labels Oct 28, 2016
@eliorivero eliorivero added this to the 4.3.3 milestone Oct 28, 2016
@artpi artpi mentioned this pull request Oct 28, 2016
@eliorivero eliorivero modified the milestones: 4.4, 4.3.3 Oct 28, 2016
@artpi artpi force-pushed the fix/widgets-translate-undefined-title-array-syntax branch 3 times, most recently from f78298d to a425d19 Compare October 28, 2016 18:57
@artpi artpi added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] In Progress labels Oct 28, 2016
@artpi
Copy link
Contributor

artpi commented Oct 28, 2016

Thank you @eliorivero for these changes.
I added following modifications:

  • add protection aginst direct access
  • Change strip_tags to sanitize_text_field
  • Use wp_enqueue_scripts to register frontend scripts

@eliorivero eliorivero self-assigned this Nov 1, 2016
@artpi artpi force-pushed the fix/widgets-translate-undefined-title-array-syntax branch from a64d6bd to b0f4883 Compare November 3, 2016 19:47
Copy link
Member

@zinigor zinigor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, works good!

@zinigor zinigor added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Nov 8, 2016
@dereksmart dereksmart merged commit 05c3cca into master Nov 8, 2016
@dereksmart dereksmart deleted the fix/widgets-translate-undefined-title-array-syntax branch November 8, 2016 20:28
@kraftbj kraftbj removed the [Status] Ready to Merge Go ahead, you can push that green button! label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extra Sidebar Widgets [Pri] BLOCKER Touches WP.com Files [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants