WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#22497 new enhancement

Post type should be able to show on mobile apps

Reported by: markoheijnen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch mobile
Focuses: Cc:

Description

Currently the mobile apps only show Post and Pages. Part of the reason is that the apps can't know if the post type is worth showing in the apps since it's heavily based on several meta-boxes. I think this is a nice add-on for developers to make that decision.

The patch is really simple and is just adding a extra parameter to register post type.

Attachments (1)

show_mobile.diff (1.7 KB) - added by markoheijnen 17 months ago.
show_mobile parameter for register_post_type

Download all attachments as: .zip

Change History (19)

markoheijnen17 months ago

show_mobile parameter for register_post_type

comment:1 mordauk17 months ago

  • Cc pippin@… added

comment:2 koke17 months ago

It's a good start, but the problem is most custom post types would require a custom UI anyway

comment:3 nacin17 months ago

A post type would have to opt into this, so they really only should if they know that the mobile device can properly serve a workable experience. The "supports" arguments can go a long way: Whether the post type supports title, editor, thumbnail, etc.

comment:4 markoheijnen17 months ago

I like this way because of the opt in. We can make assumptions but that is the wrong we to do. WordPress should try to do it's job a good as it can. And with this solution someone can allow a certain post type to show up.

Also till now we didn't come up with a good way to deal with custom post types in a good way. This is a first step.

comment:5 wonderboymusic17 months ago

-1

This is app/theme logic, should not be tightly coupled with component registration.

comment:6 markoheijnen17 months ago

This isn't theme logic at all. This is back-end logic. It's the same as 'show_ui'

comment:7 follow-up: wonderboymusic17 months ago

Changing core code to change what shows up the WordPress app makes no sense to me - the mobile app should just respect the show_ui flag then. Seems like the lack of extensibility of the app is the problem.

comment:8 markoheijnen17 months ago

That is somehow the problem. It's also the lack of extensibility of wp-admin. This solution is however a temporarily solution for now since the app can't know if the mobile device can show the post type properly.

comment:9 in reply to: ↑ 7 mordauk17 months ago

Replying to wonderboymusic:

Changing core code to change what shows up the WordPress app makes no sense to me - the mobile app should just respect the show_ui flag then. Seems like the lack of extensibility of the app is the problem.

Simply respecting the show_ui flag will never work, not unless the app also supports custom meta boxes (which seems far less likely).

I'm all for this. I see no reason why a a simple CPT (with no meta boxes) shouldn't be accessible from the app.

comment:10 follow-up: wonderboymusic17 months ago

If the app doesn't support custom meta boxes, what's the point of opting in a custom post type? then you are only ever providing support for post types that have the same UI as page and post, which means you maybe shouldn't be using custom post type in the first place.

comment:11 in reply to: ↑ 10 mordauk17 months ago

Replying to wonderboymusic:

If the app doesn't support custom meta boxes, what's the point of opting in a custom post type? then you are only ever providing support for post types that have the same UI as page and post, which means you maybe shouldn't be using custom post type in the first place.

There are tons of cases where a CPT will have the exact same UI as posts / pages. Meta boxes are not the only reason to use a CPT.

For example, I might run a site that does reviews and tutorials. Each of them would be there own CPT, even though they share an identical UI (default). Why should these CPTs be excluded from the app? Saying these should be a page/post isn't always valid either, especially as CPTs allow completely separate URL structures for each type.

comment:12 markoheijnen17 months ago

We can't go from 0 to a perfect solution. We need to take steps and this is one step we need to take. Obviously you want to have custom mete box support but that can take forever and most likely never happens. It's not because we don't want to but it's almost impossible to have a great experience.

comment:13 follow-up: wonderboymusic17 months ago

I don't think register_post_type is the place make sure the WordPress.com phone app works the way you want. To me, it's like saying: I don't like the app's nav design, so let's change admin.css.

comment:14 in reply to: ↑ 13 mordauk17 months ago

Replying to wonderboymusic:

I don't think register_post_type is the place make sure the WordPress.com phone app works the way you want. To me, it's like saying: I don't like the app's nav design, so let's change admin.css.

Isn't respecting show_ui really the same thing? The only difference is that it doesn't require an update to core code.

comment:15 wonderboymusic17 months ago

show_ui is already there, so the app maker should find a way to support post types with that flag set to true. Otherwise, what's next, show_tablet? show_xbox?

comment:16 mordauk17 months ago

I can see your point, but I don't see any problem with upgrading core to make it better support an external application. That's one of the reason we make changes in core: to improve support for other systems / integrations. APIs are upgraded to make them easier to use. show_mobile is nothing more than another parameter in the post type API.

And in this case the app is hardly an external / 3rd party application. Further supporting WordPress.com integration is nothing like supporting Xbox integration.

comment:17 markoheijnen17 months ago

In this case app maker are your co-contributors. Who work on the mobile apps to make the WordPress (overall) experience better. This ticket is needed for now because of the lack of other possibilities in WordPress core.

comment:18 koke17 months ago

  • Cc koke added
  • Keywords mobile added
Note: See TracTickets for help on using tickets.