@@ -911,15 +911,15 @@ function update_post_term_count( $terms, $taxonomy ) {
911
911
* belongs to.
912
912
*
913
913
* @param int $target_term_id The term ID to find the translation group for
914
- * @return int The transID the target term belongs to
914
+ * @return int|false The transID the target term belongs to, boolean false on failure
915
915
**/
916
916
public function get_transid ( $ target_term_id ) {
917
- if ( $ transid = wp_cache_get ( $ target_term_id, ' bbl_term_transids ' ) ) {
918
- return $ transid ;
917
+ if ( ! $ target_term_id ) {
918
+ return false ;
919
919
}
920
920
921
- if ( ! $ target_term_id ) {
922
- throw new exception ( " Please specify a target term_id " ) ;
921
+ if ( $ transid = wp_cache_get ( $ target_term_id, ' bbl_term_transids ' ) ) {
922
+ return $ transid ;
923
923
}
924
924
925
925
$ transids = wp_get_object_terms ( $ target_term_id , 'term_translation ' , array ( 'fields ' => 'ids ' ) );
@@ -941,11 +941,11 @@ public function get_transid( $target_term_id ) {
941
941
*
942
942
* @param int $target_term_id The term ID to set the translation group for
943
943
* @param int $translation_group_id The ID of the translation group to add this
944
- * @return int The transID the target term belongs to
944
+ * @return int|false The transID the target term belongs to, false on failure
945
945
**/
946
946
public function set_transid ( $ target_term_id , $ transid = null ) {
947
947
if ( ! $ target_term_id ) {
948
- throw new exception ( " Please specify a target term_id " ) ;
948
+ return false ;
949
949
}
950
950
951
951
if ( ! $ transid ) {
0 commit comments