WPML
SignaturePHP
do_action( 'wpml_show_package_language_ui', array $package, array $args )

Description

Outputs the UI to display a language information box in admin screens of content that was registered for translation as a string package*. It also shows the current state of any translations.

*String translation packages are registered with wpml_register_string and their translations retrieved with wpml_translate_string

Note: This hook requires the WPML String Translation module

Arguments

  • $packagearrayRequired

    The package object. Array keys must match the following WPML_Package fields and will be the same for all texts sent to translation for an object:
    • kind

      A free text to identify the package object. Must be the same for all packages of the same type. i.e. ‘Gravity Form’ or ‘Layout’
    • name

      A name to identify the set of strings with. Must be unique for each package of the same type such as an ID
    • title

      A humanly readable title for the package. Must be different for each package of the same type.
    • edit_link

      Link to edit this set of strings (it can be an empty string)
    • view_link

      Link to view this set of strings (it can be an empty string)
  • $argsarrayOptional

    Arguments to control the output
    • $show_titlebool

      Will hide/show the “WPML Translation” title in the box. Defaults to TRUE
    • $show_descriptionbool

      Will hide/show the “Language of this {package_kind} is {language_name}” Defaults to TRUE
    • $show_statusbool

      Will hide/show the translation status” Defaults to TRUE
    • $show_linkbool

      Will hide/show the link which leads to the translation dashboard. Defaults to TRUE
    • $title_tagstring

      The HTML Tag to use for the box title. Defaults to ‘h2’
    • $status_container_tagstring

      The HTML Tag to use for translation status container. Defaults to ‘p’
    • $main_container_attributesarray

      Array of keys->values to add to the main container (for CSS and/or js) Defaults to an empty array
    • $status_container_attributesarray

      Array of keys->values to add to the status container (for CSS and/or js) Defaults to array( 'style' => 'padding-left: 10px' )

Example Usage

Simple Example using LayoutsPHP
$package = array(
        'kind' => 'Layout',
        'name' => 'contact-us');

do_action('wpml_show_package_language_ui', $package);