CoreFiles by mySites.guru
user.php46 lines, 1,219 bytes, from Joomla_4.2.2-Stable-Full_Package.zip
Raw History Compare with 4.2.1
md5
6594d332b18d2c03a6ae3a10bb42006a
sha1
39eb0693b644841f2b3d4808da7008636a85d5f7
sha256
c418c4dcc26a600a2f0c4a6355296029458268d814493cdb923700a6464bd43e
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.User
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt

 * @phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
 */

use Joomla\CMS\Form\Form;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Fields User Plugin
 *
 * @since  3.7.0
 */
class PlgFieldsUser extends \Joomla\Component\Fields\Administrator\Plugin\FieldsPlugin
{
    /**
     * Transforms the field into a DOM XML element and appends it as a child on the given parent.
     *
     * @param   stdClass    $field   The field.
     * @param   DOMElement  $parent  The field node parent.
     * @param   Form        $form    The form.
     *
     * @return  DOMElement
     *
     * @since   3.7.0
     */
    public function onCustomFieldsPrepareDom($field, DOMElement $parent, Form $form)
    {
        if ($this->app->isClient('site')) {
            // The user field is not working on the front end
            return;
        }

        return parent::onCustomFieldsPrepareDom($field, $parent, $form);
    }
}

The same content is in 17 releases, Joomla 4.2.1 to 4.3.0-alpha3. See them all, or every version of this file.