Automattic / jetpack

Security, performance, marketing, and design tools — Jetpack is made by WordPress experts to make WP sites safer and faster, and help you grow your traffic.
https://jetpack.com/
Other
1.58k stars 797 forks source link

Feature request: Add filter for [portfolio]-Shortcode output #2194

Open s-a-s-k-i-a opened 9 years ago

s-a-s-k-i-a commented 9 years ago

Hello there!

It would be nice to have a filter for the shortcode function output of [portfolio]. I was searching the jetpack plugin files, but could not find any filter.. so after Jeremy's suggestion I figured I'd open a github issue for this matter. The related wordpress.org-support thread is the following: https://wordpress.org/support/topic/customizing-jetpack-portfolio-shortcode

I'd like to control the html output of the shortcode to be able to add a div if needed or implement a custom field I might have registered for my portfolio post types. For example I set up a custom field which allows me to insert a client logo. I would like to have this client logo (added via custom field in portfolio cpt) to be displayed with the portfolio item's title. I would like to be able to control where exactly this custom field shows up and which css classes are spread out.

A filter would allow such for the [portfolio] output.

Thanks

jeherve commented 9 years ago

cc @michaeldcain

GLWalker commented 8 years ago

I agree a filter should be in place, unless I'm missing the obvious. I know the short code is very robust in terms of displaying what we need, but the issue lies in where we want it to display. Presently the output is in order of:

Image Title Project Type Project Tags Content

Though it can be manipulated with some jQuery, it would be nice to filter in to do something as:

Image New Element Content Title Tags Comment Link

ETC: ETC:

jeherve commented 8 years ago

Also suggested here: https://wordpress.org/support/topic/problem-with-sharing-buttons-on-projects-not-portfolio-page?replies=2

whimsyniche commented 5 years ago

I'm putting in my +1 for this and also URL change from /portfolio when not using [shortcode].

I provide you with relative links on how-to do this:

https://webdevstudios.com/2015/01/27/create-a-filterable-portfolio-with-wordpress-and-jetpack/

https://danny.care/creating-a-responsive-filterable-portfolio-with-wordpress-and-jetpack-in-foundationpress/

https://ageorgiev.com/blog/isotope-with-wordpress-portfolio/

https://stackoverflow.com/questions/31462906/wordpress-and-jetpack-filterable-portfolio

Reference from WordPress on the shortcode:

https://en.support.wordpress.com/portfolios/portfolio-shortcode/

whimsyniche commented 4 years ago

At WP's core SVN a ticket was started https://core.trac.wordpress.org/ticket/51210

To including additional reference for my previous comment.

I found this neat stackoverflow question Lightweight alternative to isotope.js

I found Muuri to be an interesting alternative to isotope.

Here's another article how to add filters to your CPT (and maybe JetPack Portfolio). https://getflywheel.com/layout/how-to-add-filters-to-your-wordpress-portfolio/

whimsyniche commented 4 years ago

Hi @s-a-s-k-i-a and @jeherve

Any status update on this?

jeherve commented 4 years ago

@whimsyniche There are no patches to add that filter to the Jetpack plugin yet, but you're welcome to create one, we'll be happy to review it!

whimsyniche commented 4 years ago

@jeherve thank you for the response and suggestion.

Where exactly is portfolio shortcode referenced in jetpack repo? What's the best practice for plugin or extension development for jetpack?

jeherve commented 4 years ago

Where exactly is portfolio shortcode referenced in jetpack repo?

It lives here: https://github.com/Automattic/jetpack/blob/4b85be883b3c584c64eeb2fb0f3fcc15dabe2d30/modules/custom-post-types/portfolios.php#L552-L558

What's the best practice for plugin or extension development for jetpack?

This should help: https://github.com/Automattic/jetpack/blob/b7229b4ef78c4f8a389b340a7e25debfc20ee5bb/docs/CONTRIBUTING.md#L17-L21

whimsyniche commented 4 years ago

Thank you @jeherve 😁