[SOLVED] Echoing a contents of a block without being able to edit it
Posted: Wed Apr 05, 2017 3:21 am
I have a question: if it's possible to just echo the contents of a block without it being wrapped with editable span even in admin mode?
For now I looked into core index file and found these lines:
So I've made my own little function:
I think there is another way of doing it, and you can manage it through custom functions.php file. There was a link provided by you (wiz) - viewtopic.php?f=27&t=756 - but it's non-working. So, the second question is: where to see and example of working functions.php file, that shows an example on how to plug into the core and add something, without modifying index.php file? That would be a good one for starters.
For now I looked into core index file and found these lines:
Code: Select all
public static function block($key)
{
$blocks = self::get('blocks');
return isset($blocks->{$key}) ? (self::$loggedIn ? self::editable($key, $blocks->{$key}->content, 'blocks') : $blocks->{$key}->content) : '';
}
Code: Select all
public static function blockEcho($key)
{
$blocks = self::get('blocks');
return $blocks->{$key}->content;
}