''` part is not totally clear though. * * @see \WPML\TM\Settings\ProcessNewTranslatableFields::getPosts * * @param int $fieldGroupId * * @return int */ public static function getCount( $fieldGroupId ) { /** @var \wpdb $wpdb */ global $wpdb; $fieldKeys = wpml_collect( acf_get_fields( $fieldGroupId ) ) ->map( Obj::prop( 'name' ) ) ->toArray(); if ( $fieldKeys ) { return (int) $wpdb->get_var( "SELECT COUNT(DISTINCT(post_id)) FROM {$wpdb->postmeta} WHERE meta_key IN (" . wpml_prepare_in( $fieldKeys ) . ") AND meta_key <> ''" ); } return 0; } /** * @param int $postCount * * @return string */ public static function getProcessConfirmationMessage( $postCount ) { $totalTimeInSeconds = $postCount * self::PROCESS_TIME_PER_POST; if ( $totalTimeInSeconds <= MINUTE_IN_SECONDS ) { return esc_html__( 'Some posts using this field group have translations. Once you change the translation option, WPML needs to update the translation status of the posts. This can take up to 1 minute.', 'acfml' ); } elseif ( $totalTimeInSeconds > 1.5 * HOUR_IN_SECONDS ) { /* translators: %d is the number of hours. */ return sprintf( esc_html__( 'Some posts using this field group have translations. Once you change the translation option, WPML needs to update the translation status of the posts. This can take up to %d hours.', 'acfml' ), ceil( $totalTimeInSeconds / HOUR_IN_SECONDS ) ); } /* translators: %d is the number of minutes. */ return sprintf( esc_html__( 'Some posts using this field group have translations. Once you change the translation option, WPML needs to update the translation status of the posts. This can take up to %d minutes.', 'acfml' ), ceil( $totalTimeInSeconds / MINUTE_IN_SECONDS ) ); } }