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

Created on 1 Jun 2015  路  10Comments  路  Source: Automattic/jetpack

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

Custom Content Types Good For Community Hacktoberfest [Type] Enhancement [Type] Good First Bug

Most helpful comment

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:

All 10 comments

cc @michaeldcain

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:

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/

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

Any status update on this?

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

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

Thank you @jeherve 馃榿

Was this page helpful?
0 / 5 - 0 ratings