Added back the Toggle Post Details option to the Story Budget page#504
Closed
raduconst wants to merge 1 commit intoAutomattic:developfrom
Closed
Added back the Toggle Post Details option to the Story Budget page#504raduconst wants to merge 1 commit intoAutomattic:developfrom
raduconst wants to merge 1 commit intoAutomattic:developfrom
Conversation
Contributor
|
Closing in favor of PR #846, which has been merged. The Toggle Post Details functionality from this PR was incorporated into #846 with the following enhancements:
Thank you @raduconst for the original implementation approach - the excerpt generation logic was used as the foundation for this feature. |
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.
This PR is a fix for #25
The
Toggle Post Detailsbutton was removed here 95c6874#diff-9163f1310b94e41b397251a77e18ec5a but thesetup_postadatais still not working so I couldn't use thethe_excerptfunction.What I did instead is try to replicate the functionality that's used on the Dashboard → Pages area and take care of these three cases:
There is no excerpt because this is a protected post.message is displayed (ref https://core.trac.wordpress.org/browser/tags/5.1.1/src/wp-includes/post-template.php#L400);wp_trim_wordslike explained here: https://developer.wordpress.org/reference/functions/get_the_excerpt/#comment-content-2457 Basically, this will generate automatically a text from the post content (ref. https://core.trac.wordpress.org/browser/tags/5.1.1/src/wp-includes/formatting.php#L3713).I also made a little change on L474 and add the
post-titleclass to the title column since the JS code that's adding thehiddenclass is still available.