Last active
December 20, 2015 00:48
-
-
Save davidkryzaniak/6043945 to your computer and use it in GitHub Desktop.
Generic WP ShortCode Boilerplate (OOP)
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: ShortCode | |
* | |
* Usage: [MyShortcode] | |
*/ | |
class myShortCode { | |
public function __construct(){ | |
add_shortcode('MyShortcode', array($this, 'shortCodeFunction')); | |
} | |
public function shortCodeFunction(){ | |
return 'Hello, World'; | |
} | |
} | |
$doShortCode = new myShortCode(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment