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

Added back the Toggle Post Details option to the Story Budget page #504

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

raduconst
Copy link
Contributor

This PR is a fix for #25
The Toggle Post Details button was removed here 95c6874#diff-9163f1310b94e41b397251a77e18ec5a but the setup_postadata is still not working so I couldn't use the the_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:

  1. when the post is password protected, the 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);
  2. when there's an excerpt set by the user, display it (ref https://core.trac.wordpress.org/browser/tags/5.1.1/src/wp-includes/post-template.php#L412);
  3. when there's no excerpt set, use 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 the hidden class is still available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant