Created
September 15, 2023 15:35
-
-
Save ryandemmer/fb85a09544e999b69ac59be86ccf9318 to your computer and use it in GitHub Desktop.
Sample system plugin
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 | |
/** | |
* @copyright Copyright (C) 2023 Joe Public. All rights reserved | |
* @license GNU General Public License version 2 or later | |
*/ | |
defined('JPATH_BASE') or die; | |
use Joomla\CMS\Factory; | |
use Joomla\CMS\Plugin\CMSPlugin; | |
class PlgSystemMy_Plugin extends CMSPlugin | |
{ | |
public function onContentAfterSave($context, $article, $isNew): void | |
{ | |
// Check we are handling the frontend edit form. | |
if ($context !== 'com_content.form') { | |
return; | |
} | |
// Check this is a new article. | |
if (!$isNew) { | |
return; | |
} | |
$app = Factory::getApplication(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment