You can use the display_names_as
parameter when calling pll_the_languages()
. I tried it on an installation with English and French languages and it returned me en
and fr
respectively.
<?php pll_the_languages( array( 'display_names_as' => 'slug' ) );?>
You can find the function reference for the Polylang plugin on this page.
Related Posts:
- Header Button Chance Polylang Elementor
- Plugin Form Submission Best Practice
- WP 3.3 How to Add Menu Items to the Admin Bar?
- Unit tests – Dealing with dependencies
- Changing Plugin Load Order
- Should I create a theme or a plugin?
- How should you hook a session_start() when authoring a plugin?
- How to sync with plugins update after I have done manual optimizations?
- How to retrieve a value via get_option when the option_value is stored in a multi-dimensional array?
- How to change wordpress post title?
- Add Admin Menu Inside Construct or Init
- How to create a plugin that only operates on the home page?
- Adding callback function for wp_ajax_ has no effect
- How to properly modify get_userdata in plugin to get roles to update in database
- WordPress cron running twice
- How to create thumbnail of different files?
- Admin-ajax.php appending a status code to ajax response
- Create a plugin to change the action to which a function is hooked
- comment_email hook doesn’t seem to work for comment editor field
- Why is the reset password key missing in the reset password email?
- Paging on a future post loop?
- How to pass custom options from widget form to widget update callback?
- How can I add a field to make link nofollow to the WordPress Link Inspector Window?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- How to show large image in checkout page using WP Ecommerce plugin [closed]
- Why do I need to check if wp_nonce_field() exists before using it
- settings_fields() doesn’t work for other roles except admin
- edit_{$taxonomy} | Hook
- Worpdress cannot create directory
- Subscribe to author?
- how to make custom bulk actions for a WP_List_Table (core class)
- Get name and email of current unregistered user, who has recently submitted name and email in comment form?
- How to associate an existing user to a site in a multisite setup programmatically
- Changing upload dir in a plugin regardless of post type
- Set page template programaticlly in plugin
- Auto save permalink setting page with the plugin activation
- creating custom function to log actions in plugin
- How to use output buffering in WordPress hooked functions?
- Howto: Use Custom Post Types as Submenu Items in Admin
- Plugin menu addition in multisite
- Show custom data instead of 404
- How to localize admin.php only once
- What’s the right way to instantiate new blocks and/or the plugin itself in toto when using wppb architecture?
- How can I get a list of CPT inside a plugin file?
- Creating a custom Gutenberg block with columns
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Serve text/html from wp-json API via WPEngine, headers not being set properly
- wp_schedule_event seems to be being added twice
- Add a new confirmation page before saving
- What happens when two or more plugins use the same hook?
- Plugin is not generating title tags on any pages or posts
- Plugin Development/ Stop CSS clashes.
- Adding columns to core tables
- Add Link Category on Activation?
- Add child pages to submenu automatically
- Creating multiple wp_editer() text fields in for loop — the text/visual switch only works for first editor
- Injecting HTML on (arbitrary) admin pages
- Custom Stylesheet instead of Inline CSS for WordPress Customizer API Overrides
- Create page (not the post type) dynamically
- Translate javascript with WordPress built-in localization API for static strings
- Updating transient value frequently
- AJAX button with success callback. (Titan Framework)
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Cannot stop wpautop from messing up my plug-in output
- How can I prevent ‘500 internal server error’ because of a long install process?
- Update product prices from remote file
- Displaying custom content from a plugin within the active theme
- Downloading File via headers doesnt work
- Using wp_mail to send email?
- Which wp plugin can use Create, Edit and Delete Email address from WordPress Dashboard
- product-attribute-slug-is-too-long-28-characters-max
- Custom plugin & calling REST api of wordpress instance the plugins is running on
- Add variables from rewrite rules to query var
- Show list of categories that has posts with different taxonomies
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- How do I specify where to save the debug.log?
- How do I ensure I can loop through every enqueued script and CSS?
- What is the source of the $post_id in a hook argument?
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Plugins Settings page not updating
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- Use content filter on the post that is password-protected
- foreach argument to get specific file types getting too many returns
- How to fetch the post content from the wordpress editor before it can be saved(published)?
- pull data from wordpress database
- How does one set cookies in WordPress without getting the ‘headers not sent’ error? within WP
- Filter the_content() to add custom figure tags
- Glyphicons Dont Show in WordPress Plugin Only
- Return all roles, including custom roles
- Change the search results header from plugin
- Mapping multiple URLs to same page
- Installing plugins on installation/activation
- Tracing dashboard publish settings from input form in WordPress
- Add query string variables to all hyperlinks URL matching a specified domain
- Virtual Page with Registration form
- Is there such a thing as a WordPress console?
- Images not displaying on live server
- Loading jQuery library from WordPress admin
- Forcing the Uninstall Hook to fail
- Programmatically creating posts based on external JSON feed (asynchronously)