![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/www/wp-content/themes/dt-the7/inc/mods/compatibility/wpml/ |
<?php /** * Returns the translated object ID(post_type or term) or original if missing * * @param $object_id integer|string|array The ID/s of the objects to check and return * @param $type the object type: post, page, {custom post type name}, nav_menu, nav_menu_item, category, tag etc. * @return string or array of object ids */ function presscore_translate_object_id( $object_id, $type ) { if ( !did_action( 'wpml_loaded' ) ) { return $object_id; } // if array if( is_array( $object_id ) ){ $translated_object_ids = array(); foreach ( $object_id as $id ) { $translated_object_ids[] = apply_filters( 'wpml_object_id', $id, $type, true ); } return $translated_object_ids; } // if int else { return apply_filters( 'wpml_object_id', $object_id, $type, true ); } }