can't get a basic shortcode to work
-
I can’t get my shortcode plugin to do anything – it doesn’t show the shortcode in the post itself, but it also doesn’t show anything. Here’s my most basic example.
- created a folder “basic” in the plugins folder
- created a file “basic.php” in the basic folder
- activated the plugin
- added the following code to it
-
<?php /* Plugin Name: basic Description: a shortcode. Version: 1.0 License: GPL2 */ add_shortcode('basic', function () { return "the plugin has been executed"; }); add_shortcode("basic2", "basic2_handler"); function basic2_handler() { $foo = "basic 2 handler"; return $foo; } ?> - edited a post and added [basic] and [basic2] to the entry
the text [basic] is missing, so I am presuming that shortcodes are working (other peoples plugins work fine enough). But nothing is returned at all in its place.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘can't get a basic shortcode to work’ is closed to new replies.