Or does Joomla really need the 1.x version?
Joomla itself may work mostly fine with newer jQuery versions. The reason it ships with such an old version is compatibility for 3rd party extensions.
So if there was some line of php I could use to disable the loading of the jQuery framework?
To disable jQuery loading completely you would have to either make a plugin to override JHtml::_('jquery.framework')
or create overrides for any layouts that end up loading jQuery. The plugin can also be used to load a custom version:
defined('_JEXEC') or exit;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Plugin\CMSPlugin;
class PlgSystemExample extends CMSPlugin
{
// Cache to allow running code only once.
protected static $loaded = false;
public function onAfterInitialise()
{
// Check that the method hasn't been used yet.
if (!HTMLHelper::isRegistered('jquery.framework'))
{
// Register our custom method.
HTMLHelper::register('jquery.framework', [__CLASS__, 'framework']);
}
}
public static function framework($noConflict = true, $debug = null, $migrate = true)
{
// Load only once.
if (static::$loaded)
{
return;
}
// Load the main library
HTMLHelper::_('script', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js');
// Check if we are loading in noConflict.
if ($noConflict)
{
Factory::getApplication()->getDocument()->addScriptDeclaration('jQuery.noConflict();');
}
// Check if we are loading Migrate.
if ($migrate)
{
HTMLHelper::_('script', 'https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.0.1/jquery-migrate.min.js');
}
// Enable cache flag.
static::$loaded = true;
}
}
Or, if you want to override jQuery script at the template level, place your custom script in templates/your_template/js/jui/jquery.min.js
.