ayudawp_acs_sanitize_signal_value( $settings['global_search'] ?? '' ), 'ai_input' => ayudawp_acs_sanitize_signal_value( $settings['global_ai_input'] ?? '' ), 'ai_train' => ayudawp_acs_sanitize_signal_value( $settings['global_ai_train'] ?? '' ), ); // Per-entry override (written by the metabox module). if ( ! empty( $context['post_id'] ) ) { $override = get_post_meta( (int) $context['post_id'], '_ayudawp_acs_signals', true ); if ( is_array( $override ) ) { foreach ( array( 'search', 'ai_input', 'ai_train' ) as $key ) { $value = ayudawp_acs_sanitize_signal_value( $override[ $key ] ?? '' ); if ( '' !== $value ) { $signals[ $key ] = $value; } } } } return $signals; } /** * Translate resolved signals into opt-out directives for HTML meta and HTTP headers. * * Only opt-out tokens are emitted, so nothing is returned unless the user has * reserved training rights. noai and noimageai map to ai-train=no. * * @param array $signals Resolved signals from ayudawp_acs_get_effective_signals(). * @return array List of directive tokens, e.g. array( 'noai', 'noimageai' ). */ function ayudawp_acs_signals_to_directives( $signals ) { $directives = array(); if ( isset( $signals['ai_train'] ) && 'no' === $signals['ai_train'] ) { $directives[] = 'noai'; $directives[] = 'noimageai'; } return $directives; }