-
-
Save tommcfarlin/d588e0c45cf96bcd5f10614ccf432339 to your computer and use it in GitHub Desktop.
[WordPress] On Immutable Values in WordPress Plugins
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 | |
class Main_Plugin { | |
const ACME_API_KEY = '123456789'; | |
public function init() { | |
$helper = new Helper_Class(); | |
$helper->render_acme_data( self::ACME_API_KEY ); | |
} | |
} |
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 | |
class Helper_Class { | |
public function render_acme_data( string $api_key ) { | |
$canvas_url = 'https://url-for-canvas.com?api_key=' . $api_key; | |
$canvas = new Canvas( $canvas_url ); | |
$canvas->draw(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment