jorgelondo
Forum Replies Created
-
Forum: Plugins
In reply to: [Bogo] how to change language names in language switcher?/*This is not my code, I really did not find the source..but here is what you are looking for…in functions.php in template*/
function my_bogo_language_switcher_links( $args = ” ) {
global $wp_query;$args = wp_parse_args( $args, array() );
$locale = get_locale();
$available_languages = bogo_available_languages( array(
‘exclude_enus_if_inactive’ => true ) );$translations = array();
$is_singular = false;if ( is_singular() || ! empty( $wp_query->is_posts_page ) ) {
$translations = bogo_get_post_translations( get_queried_object_id() );
$is_singular = true;
}$links = array();
foreach ( $available_languages as $code => $name ) {
$re_name = ”;
if($code === ‘en_US’){
$re_name = ‘Eng’;//RENAME FOR ENGLISH
}elseif($code === ‘es_ES’){ //ANOTHER LENGUAGE
$re_name = ‘Esp’;//RENAME
}else{
$re_name = bogo_get_language_native_name($code);
}
$link = array(
‘locale’ => $code,
‘lang’ => bogo_language_tag( $code ),
‘title’ => $name,
‘native_name’ => $re_name,
‘href’ => ” );if ( $is_singular ) {
if ( $locale != $code
&& ! empty( $translations[$code] )
&& ‘publish’ == get_post_status( $translations[$code] ) ) {
$link[‘href’] = get_permalink( $translations[$code] );
}
} else {
if ( $locale != $code ) {
$link[‘href’] = bogo_url( null, $code );
}
}$links[] = $link;
}return apply_filters( ‘my_bogo_language_switcher_links’, $links, $args );
}
add_action(‘bogo_language_switcher_links’,’my_bogo_language_switcher_links’,100);- This reply was modified 7 years, 6 months ago by jorgelondo.
Forum: Plugins
In reply to: [Bogo] News about category translations ?Hello, the plugin is great, I am interested in the same, know if the categories can be translated. thanks
Forum: Plugins
In reply to: [Bogo] Solution to hiding or showing different text in the language switcherthe link doesn’t work
Forum: Plugins
In reply to: [Bogo] Change switcher's names of languagesHi, can you share how you solved it?
Forum: Plugins
In reply to: [Bogo] Translation of widgets?Forum: Plugins
In reply to: [OptionTree] Save every filed of option tree in database Separatei have the same problem. Help!
Thanks Derek, so I tried to nest but are not seen as the Metabox when editing a post.
$catargs = array( 'hide_empty' => false, 'depth' => '', 'hierarchical' => true, 'order' => 'ASC', 'orderby'=> array('term_group','name'), 'child_of'=> '', 'parent' => 0 ); $categories = get_categories( apply_filters( 'ot_type_category_checkbox_query', $catargs, $field_id ) );
I tried wp_category_checklist but really something I’m doing wrong … if someone can help me. Thank you very much.
Hello, it is possible in the category checkbox option, list the categories hierarchically as a tree?