Skip to content

Commit 1f8cdf0

Browse files
committed
added: support for post_as plugin
1 parent 91baa09 commit 1f8cdf0

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace ColdTrick\StaticPages\Plugins;
4+
5+
/**
6+
* Support for the post_as plugin
7+
*/
8+
class PostAs {
9+
10+
/**
11+
* Register post_as support for static
12+
*
13+
* @param \Elgg\Event $event 'config', 'post_as'
14+
*
15+
* @return array
16+
*/
17+
public static function addConfig(\Elgg\Event $event): array {
18+
$result = $event->getValue();
19+
20+
$result['static/edit'] = [
21+
'type' => 'object',
22+
'subtype' => \StaticPage::SUBTYPE,
23+
];
24+
25+
return $result;
26+
}
27+
}

elgg-plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@
141141
'\ColdTrick\StaticPages\Plugins\SearchAdvanced::searchAdvancedAutocomplete' => [],
142142
],
143143
],
144+
'config' => [
145+
'post_as' => [
146+
'\ColdTrick\StaticPages\Plugins\PostAs::addConfig' => [],
147+
],
148+
],
144149
'container_logic_check' => [
145150
'object' => [
146151
\ColdTrick\StaticPages\GroupToolContainerLogicCheck::class => [],

0 commit comments

Comments
 (0)