__( 'Translation (TranslatePlus)', 'translateplus' ), 'instructions' => __( 'Translate sends the value for translation. Copy keeps the same value in every language.', 'translateplus' ), 'name' => 'translateplus', 'type' => 'select', 'choices' => array( '' => __( 'Automatic (by field type)', 'translateplus' ), 'translate' => __( 'Translate', 'translateplus' ), 'copy' => __( 'Copy', 'translateplus' ), 'ignore' => __( 'Ignore (do not copy)', 'translateplus' ), ), ), true ); } /** * Options pages are global, so their text values go through the string layer. * * @param mixed $value Value. * @param int|string $post_id ACF post ID. * @param array $field Field. * @return mixed */ public function options_value( $value, $post_id, $field ) { if ( ! is_string( $value ) || '' === $value || Languages::is_source_current() || is_admin() ) { return $value; } if ( ! in_array( $post_id, array( 'options', 'option' ), true ) && 0 !== strpos( (string) $post_id, 'options_' ) ) { return $value; } if ( ! in_array( $field['type'] ?? '', self::TEXT_TYPES, true ) || 'copy' === ( $field['translateplus'] ?? '' ) || 'ignore' === ( $field['translateplus'] ?? '' ) ) { return $value; } return Plugin::instance()->strings()->get( 'acf-options', (string) ( $field['name'] ?? '' ), $value ); } }