Created
September 15, 2023 00:34
-
-
Save westonruter/faccfac310645d0c922f1c56d9ec1fbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Insert Random Initial Image With the_content Filter | |
*/ | |
add_filter( | |
'the_content', | |
static function ( string $content ): string { | |
$content = '<p><img src="https://source.unsplash.com/featured/1600x900" style="max-width:100%; height:auto" width="1600" height="900"></p>' . $content; | |
return $content; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment