Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Define function as static (line 59)
Not defining function on line 59 as static triggers php error: [Strict Notice] call_user_func() expects parameter 1 to be a valid callback, non-static method Page::ShortcodeColumns() should not be called statically

Note: PHP 5.5.12
  • Loading branch information
jakxnz committed Jun 29, 2015
1 parent dcd378c commit 9cb64d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/en/02_Developer_Guides/05_Extending/04_Shortcodes.md
Expand Up @@ -56,7 +56,7 @@ First we need to define a callback for the shortcode.
'MyShortCodeMethod' => 'HTMLText'
);

public function MyShortCodeMethod($arguments, $content = null, $parser = null, $tagName) {
public static function MyShortCodeMethod($arguments, $content = null, $parser = null, $tagName) {
return "<em>" . $tagName . "</em> " . $content . "; " . count($arguments) . " arguments.";
}
}
Expand Down

1 comment on commit 9cb64d4

@jakxnz
Copy link
Contributor Author

@jakxnz jakxnz commented on 9cb64d4 Jun 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See commit message: Page::ShortcodeColumns() should be Page::MyShortCodeMethod() sorry.

Please sign in to comment.