Skip to content

Instantly share code, notes, and snippets.

@hellofromtonya
Last active November 30, 2023 19:33
Show Gist options
  • Save hellofromtonya/9486c6c7039919aee88f7d9059499175 to your computer and use it in GitHub Desktop.
Save hellofromtonya/9486c6c7039919aee88f7d9059499175 to your computer and use it in GitHub Desktop.
<?php
/**
* Install this file in wp-content/mu-plugins/ directory.
*/
add_action( 'init', function() {
echo '<p>plugin_dir_url( __FILE__ ) : </p>';
var_dump( plugin_dir_url( __FILE__ ) );
echo "<hr>";
echo '<p>plugin_dir_url( \'\' ) : </p>';
var_dump( plugin_dir_url( '' ) );
echo "<hr>";
echo '<p>plugins_url( \'\', \'\' ) : </p>';
var_dump( plugins_url( '', '' ) );
echo "<hr>";
echo '<p>wp_normalize_path( \'\' ) :</p>';
var_dump( wp_normalize_path( '' ) );
echo "<hr>";
echo '<p>plugin_dir_url( null ) : </p>';
var_dump( plugin_dir_url( null ) );
echo "<hr>";
echo '<p>wp_normalize_path( null ) :</p>';
var_dump( wp_normalize_path( null ) );
echo "<hr>";
exit;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment