uo_public_transcript_arg
Filters the argument used to retrieve public transcripts, allowing modification before data fetching.
add_filter( 'uo_public_transcript_arg', $callback, 10, 1 );
Description
Fires after the initial value for the public transcript argument is set. Developers can use this filter to modify or sanitize the argument, which is a key parameter for accessing public transcript data. It's essential to ensure the returned value is a valid, sanitized key.
Usage
add_filter( 'uo_public_transcript_arg', 'your_function_name', 10, 1 );
Parameters
-
$public_transcript_arg(mixed) - This parameter holds the sanitized key that determines how public transcript data is accessed or displayed.
Return Value
The filtered value.
Examples
// Example of how to modify the public transcript argument.
// This filter allows developers to alter the key used to identify the public transcript parameter.
function my_custom_transcript_arg( $public_transcript_arg ) {
// Let's change the argument to 'transcript_view' if the original is 'transcript'.
if ( 'transcript' === $public_transcript_arg ) {
return 'transcript_view';
}
// Otherwise, return the original argument.
return $public_transcript_arg;
}
add_filter( 'uo_public_transcript_arg', 'my_custom_transcript_arg', 10, 1 );
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
src/classes/learn-dash-transcript.php:25
public function __construct() {
add_action( 'plugins_loaded', array( __CLASS__, 'run_frontend_hooks' ) );
self::$public_transcript_arg = sanitize_key ( apply_filters( 'uo_public_transcript_arg', self::$public_transcript_arg ) );
}