jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

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

Open s-a-s-k-i-a opened this issue 11 years ago • 10 comments

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

s-a-s-k-i-a avatar Jun 01 '15 10:06 s-a-s-k-i-a

cc @michaeldcain

jeherve avatar Jun 01 '15 10:06 jeherve

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:

GLWalker avatar Jan 15 '16 21:01 GLWalker

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

jeherve avatar Aug 19 '16 13:08 jeherve

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 avatar Nov 02 '18 04:11 whimsyniche

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 avatar Sep 02 '20 22:09 whimsyniche

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

Any status update on this?

whimsyniche avatar Sep 08 '20 23:09 whimsyniche

@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!

jeherve avatar Sep 09 '20 06:09 jeherve

@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?

whimsyniche avatar Sep 09 '20 12:09 whimsyniche

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

jeherve avatar Sep 09 '20 13:09 jeherve

Thank you @jeherve 😁

whimsyniche avatar Sep 09 '20 18:09 whimsyniche