Use get_post_types( ['public' => TRUE ], 'objects' );
. This will return the already translated post type labels and other information.
Example for tests:
add_action( 'wp_footer', function() {
$post_types = get_post_types(
[ 'public' => TRUE, '_builtin' => TRUE ],
'objects' // complete information, not just the name
);
foreach ( $post_types as $slug => $arguments )
print "$slug: {$arguments->labels->singular_name}<br>";
print '<pre>' . print_r( $post_types, 1 ) . '</pre>';
});
Related Posts:
- How to get a translated string from a language other than the current one?
- How to get a localized version of WordPress from a repository?
- Working with l10n contexts (_x etc)
- How to escape the single quote character in i18n translation strings?
- How to escape single and plural i18n text strings?
- What are the most used WordPress localization?
- Difference between 2 internationalization (i18n) functions __() & _e()
- Localization works but still get “This plugin is not properly prepared for localization” msg in directory
- How to load theme textdomain from plugin?
- get_the_date() for translating date format
- Should i use _n for pronouns in translation?
- POEdit with Custom mu-plugins code
- How does WordPress choose which translation file to use?
- Proper way to create / manage gettext (.po, .pot) files?
- Should I include colon in my msgid in PO file?
- How to display get_post_type() translated?
- _e() function get text_string from function
- Translations not returning translated strings
- Force translated language on front
- Translating dynamic strings
- WordPress translation loading english file
- Easy export/import of data for Translation
- WordPress Theme .mo-file won’t load
- How to become a translator on wordpress.org?
- Translation from .mo file not working in theme
- Localization, escape html elements mid-sentence
- WordPress localization – gettext and git
- Can I set WordPress to display languages based on system language without a plugin?
- /languages/ folder missing in default themes
- How to translate functions.php?
- WordPress Translations
- Translate arguments of a user added custom code [closed]
- Internationalize plugin so strings can be translated in WPML [closed]
- localization of theme and plugins to English (originally in another language)
- Interface translation without plugins
- Plugin localization persistance (woocommerce)
- WordPress Localization error within return value
- Custom theme .mo translation file not working
- Plugin translation not displaying
- WordPress translation
- Tweak the loop for translation
- Translating form labels shortcode output
- Website Language/Locale Switching
- .po file is loaded but changes are not appearing
- How to make a WordPress plugin translation ready?
- Different Language for Frontend vs Backend
- Custom strings for translation using Polylang plugin
- Localization: I want the backend: english and frontend in defined language
- How-to: Translate plural forms for themes/plugins with PoEdit
- Disabling Translation Update
- Set language per post
- What is the purpose of an extra file for translation?
- Problems with localization
- Why should I escape translatable strings? and how shall i do that?
- Custom translation of Month names
- I can’t translate text in my plugin using a .mo file, load_plugin_textdomain() function is always false
- How to add translation for a string
- How to translate a WordPress.org plugin?
- How do I translate this string – PHP syntax question
- New plugin translation does not work
- Make changes to translation?
- Adding another arg to comments_popup_link
- Gutenberg not all editor text translated
- WPML Translated Term
- How to i18n text coming from the db or from an external source
- How to translate functions like get_the_date()?
- translating wordpress with poedit
- variables in translatable text
- How to add LTR to a custom theme which in RTL by default
- Generate PO File
- Updating WordPress Theme/Plugin POT file without losing line numbers consistency
- Use translated taxonomy labels in plugin
- Translation for frontend
- Translate pages and URLs without duplicating
- How can you locate the .po file used for translation of a page?
- Single translation for many locales
- Is there a way to test that readme looks in other language before submitting translation?
- Using _e() or __() to translate text with div
- How to solve a translation function issue with no arguments and missing a text-domain?
- Translation is not being output in one instance
- Why translations?
- Translation issue with global variables
- How to ignore extra whitespaces in translation functions like _e?
- Fix Problem With Textdomain Translation
- POEDIT – Continue with translations
- Plugin not properly prepared for localization
- WPML icl_register_string() throws fatal error but works [closed]
- Problem with Language translation
- How to translate user added content in a plugin
- POT file generated using WP-CLI does not retrieve strings from translation functions with FQN (Qualifier)
- Using wp-cli to create a .pot file that interprets .twig files as well
- Changing text for “Continue reading…” translation
- Can’t translate child theme
- Translate wordpress without duplicate custom post
- How to Convert Date to Thai
- How to use translation functions inside WordPress page
- String translation with or without po file
- Can’t load text domain in a mu-plugin
- multisite same language different translation
- Save translation file of third party plugin in a custom plugin?