-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add Block, shortcode, and functions that render just the button. #84
Open
benlk
wants to merge
11
commits into
Automattic:master
Choose a base branch
from
benlk:benlk-66-block
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
- 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
Hi @benlk – could you please resolve the conflicts here? |
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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$label
that 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-button
docs/
directoryRepublication_Tracker_Tool_Widget->has_instance
is 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_instance
is 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_instance
moving 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.txt
to replaceTKTK
with this PR number.Additional information
INN Member/Labs Client requesting: Center for Public Integrity