Skip to content

Conversation

@JiveDig
Copy link

@JiveDig JiveDig commented Jan 31, 2017

New parameter of link_posts => true to optionally disable linking of posts.
New conditional check to see if post_type is public before adding links.

My editor removes whitespace/spaces on save, that's the reason for the extra changes in here. Hopefully not an issue.

New parameter of link_posts => true to optionally disable linking of posts.
New conditional check to see if post_type is public before adding links.
@billerickson
Copy link
Owner

Sorry, I'm a bit swamped at the moment. I'll try to take a look at it over the weekend.

One thing I will change is the parameter name. I'd prefer 'include_link' => true as that will match the naming convention of the other parameters (include_title, include_content...).

@JiveDig
Copy link
Author

JiveDig commented Jan 31, 2017

Cool. Just updated the PR with the new name.
I was also considering adding logic within the read more link stuff, but I think that's unnecessary. A user shouldn't go out of their way to set the more link parameter if they are also setting include_link to false. A conflict could occur if excerpts were used for something else, and/or the_excerpt filter was doing something tricky, but I don't think DPS should worry about it.

@billerickson
Copy link
Owner

I've added the include_link parameter.

Can you explain to me the point of checking whether the post type is public? I didn't include that because I couldn't imagine a use case where you would be publicly querying and displaying a non-public post type and expecting the links to not appear.

If there is some strange situation where you are querying a non-public post type, you can also use the include_link="false" parameter.

@JiveDig
Copy link
Author

JiveDig commented Apr 10, 2017

No prob. Sometimes I register a private post type called Testimonials, but allow it to be publicly queryable. This way I can show random testimonials via the shortcode throughout the site. I'm not sure my PR handled that scenario the best way, and it's possibly not even worth it since anyone skilled enough to register a private CPT should be able to use the shortcode accordingly.

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.

2 participants