Created
August 29, 2023 12:22
-
-
Save himanipanchal/32794e99f8e2f470dabc2051bbd64773 to your computer and use it in GitHub Desktop.
is_local_attachment( string $url) function example
This file contains hidden or 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 | |
if ( is_local_attachment( $url ) ) { | |
echo esc_url( $url ) . ' ' . esc_html__( 'is a local attachment.', 'your-text-domain' ); | |
} else { | |
echo esc_url( $url ) . ' ' . esc_html__( 'is not a local attachment.', 'your-text-domain' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment