I’m following the Looper docs, but when I add the basic add_filter code to my child theme’s functions.php like instructed, it causes a Critical Error on the Wordpress site.
I’m adding this code to my child theme:
add_filter( 'cs_looper_custom_my_data', function( $result ) {
return [
[ 'text' => 'This is some text for the first item.' ],
[ 'text' => 'This is some text for the second item.' ]
]
});
I just want to use an existing API URL endpoint to pull a basic set of contact records using JSON data into a looper. Nothing fancy. I can’t tell if I need to enumerate each key in the add_filter code, or if I can reference the keys without defining each one in functions.php.