php - "__(" in custom post types -
i'm building custom post types wordpress project, not understand why in examples on internet it's possbile find this:
register_post_type('omb_prodotti', array( 'labels' => array( 'name' => __( 'customposttype' ), 'singular_name' => __( 'customposttype' ) )
what "__(" used for? related translations? wouldn't possible write instead:
register_post_type('omb_prodotti', array( 'labels' => array( 'name' => 'customposttype', 'singular_name' => 'customposttype' )
sorry i'm beginner in both php , building custom wp themes.
thank much.
it's impossible search __
in search engine wordpress double underscore
found answer in wordpress documentation:
description
retrieves translated string translate().
usage
<?php $translated_text = __( $text, $domain ); ?>
as wrote, function translate content. question, if don't call __()
function string won't translated, display customposttype
. __('customposttype')
, load translation instead, relevant string. have @ code find corresponding string.
Thanks for give us valuable information
ReplyDeleteWordPress Support
WP Support
Very Helpful. Thanks for such Information
ReplyDelete24x7 WP Support
WP Tech Support