meta-box.php
Language Selection Meta Box
Adds a meta box to post edit screens for selecting the frontend language.
Tags
Table of Contents
Functions
- jpkcom_simplelang_render_meta_box() : void
- Render language selection meta box
- jpkcom_simplelang_get_post_language() : string|null
- Get post language
Functions
jpkcom_simplelang_render_meta_box()
Render language selection meta box
jpkcom_simplelang_render_meta_box(WP_Post $post) : void
Displays a dropdown with all available WordPress languages.
Parameters
- $post : WP_Post
-
Current post object.
Tags
jpkcom_simplelang_get_post_language()
Get post language
jpkcom_simplelang_get_post_language([int|null $post_id = null ]) : string|null
Retrieves the language set for a specific post.
Parameters
- $post_id : int|null = null
-
Optional. Post ID. Defaults to current post.
Tags
Return values
string|null —The language locale or null if not set.