JPKCom Simple Lang

meta-box.php

Language Selection Meta Box

Adds a meta box to post edit screens for selecting the frontend language.

Tags
since
1.0.0

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
since
1.0.0

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
since
1.0.0
Return values
string|null

The language locale or null if not set.


        
On this page

Search results