Added back the Toggle Post Details option to the Story Budget page #504
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 Details
button was removed here 95c6874#diff-9163f1310b94e41b397251a77e18ec5a but thesetup_postadata
is still not working so I couldn't use thethe_excerpt
function.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_words
like 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-title
class to the title column since the JS code that's adding thehidden
class is still available.