ClassicPress PetitionsClassicPress Petitions
This is a read-only archive. Post or comment on the live version of this page on our forums.

Change Posts to Articles or make them editable so they can be changed into anything

October 30, 2018 · 22:14 · Pieter Bos
Description

Articles use a more business-like tone than Posts, which belong to a Blog. A business site can have a News section where it publishes Articles.

Voters
+20 more
Tags
Difficulty: Easy
Difficulty: Moderate
Request: Modify feature
Discussion
Mike Schinkel

When we have created sites for News organizations they did not like the term "Articles"; they always wanted us to call them "Stories."

So I would suggest the name be configurable, and/or the blog post subsystem extracted into a plugin so that site could implement both Articles and Stories (or any other name) and still get all the blog post semantics.

#jmtcw

Code Potent

I think both Articles and Stories sound better than Posts. No strong feeling on it. I've been "configuring" the labels with a few lines of code, as needed.

https://gist.github.com/johnalarcon/3d6d2cdd68399c9e2023c2fedb2490c4

Pieter Bos

Making them editable sounds good to, I have changed the title to reflect that.

Laurence Bahiirwa

Can we work on a filter hook for this? I think it is a good implementation for backward compatibility.

Laurence Bahiirwa

I have made a PR with proof of concept here.

James Nylen
Daniele Scasciafratte

Looking on internet it is possible easily in wordpress to change any post type label also for posts: https://wpbeaches.com/change-the-wordpress-post-type-name-to-something-else/
So I don't think that add a specific filter for this use case is very helpful because affect only one post type.

James Nylen

I didn't think about this until I saw the exploratory PR, but the only way to do this is to require the user to input all of the related "post type label" strings. Otherwise you break translations.

Given that, I think this is plugin territory. Daniele's link is a good one, there are just 2 things I would change about that code snippet:

  • Add __( 'string', 'plugin-slug' ) calls for translation.
  • Change the filter priority to 0 so these modifications run immediately after other hooks which run on init (code reference).