Add Block, shortcode, and functions that render just the button.#84
Open
benlk wants to merge 11 commits intoAutomattic:masterfrom
Open
Add Block, shortcode, and functions that render just the button.#84benlk wants to merge 11 commits intoAutomattic:masterfrom
benlk wants to merge 11 commits intoAutomattic:masterfrom
Conversation
- pull the button and modal output out of the main widget() function of the widget and create them as static functions - move the widget's has_instance boolean property to the plugin class, for tracking whether widget/shortcode/block has created a modal - `wp scaffold` a block, using a shortcode as a render callback - add a shortcode to this plugin that outputs the button and enqueues necessary assets like the modal and its CSS and JavaScript files
… the button title
Member
|
Hi @benlk – could you please resolve the conflicts here? |
Collaborator
Author
|
Hi @adekbadek — An Automattician who worked on the AMP compatibility for this plugin should handle the merge conflict here; I'm not familiar with the changes that it introduced and it's been almost two years since I worked on this code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This pull request makes the following changes:
Republication_Tracker_Tool_Widget::button_output( $label = '' );when echoed returns the button of the widget that opens the modal, with the optional parameter$labelthat changes the button text from the defaultRepublication_Tracker_Tool_Widget::maybe_print_modal_content();which, when echoed, if the modal content has not already been output on the page, does so.[republication_modal_button label=""]shortcode that outputs a button that will open the modal, with the optional parameterlabel=""to change the button textbutton.republication-tracker-tool-buttondocs/directoryRepublication_Tracker_Tool_Widget->has_instanceis nowRepublication_Tracker_Tool->has_instance.Why
For #66 and https://github.com/PublicI/umbrella-public-integrity/issues/65
Testing/Questions
Features that this PR affects:
Republication_Tracker_Tool_Widget->has_instanceis nowRepublication_Tracker_Tool->has_instance, which may have effects on third-party code.Questions that need to be answered before merging:
Republication_Tracker_Tool_Widget->has_instancemoving toRepublication_Tracker_Tool->has_instance?Steps to test this PR:
[republication_modal_button label=""][republication_modal_button label="Cheese"][republication_modal_button label="Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch"][republication_modal_button label="The Republication Tracker Tool is designed to make sharing your content easier."][republication_modal_button]Before merging this PR:
readme.txtto replaceTKTKwith this PR number.Additional information
INN Member/Labs Client requesting: Center for Public Integrity