I’m trying to create a function that finds all external CSS files that may be included in the post body (such as for an embed), and do a readfile, and place the CSS it discovers up into the style amp-custom located in the header.
Sort of scratching my head on this one, so all feedback appreciated.
Try this PHP function inside a function, test the result and if the value is is_dir(…) recurse the function. Final result is an array of file with “.css.” file extensions: