HEX
Server: Apache
System: Linux webm004.cluster121.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User: grainesdfo (155059)
PHP: 5.4.45
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/grainesdfo/www/wp-content/plugins/LayerSlider/assets/classes/class.ls.transitionpresets.php
<?php

class LS_TransitionPresets {

	public static function get() {

		// Import $presets
		include_once LS_ROOT_PATH.'/config/transition-presets.php';

		$customPresets = get_option('ls-transition-presets', '[]' );
		$customPresets = json_decode( $customPresets, true );
		$customPresets = ! empty( $customPresets ) ? $customPresets : [];

		foreach( $presets as $categoryKey => &$category ) {

			// Add "protected" key to the default presets
			foreach( $category as &$preset) { $preset['protected'] = true; }

			if( ! empty( $customPresets[ $categoryKey ] ) ) {
				$category = array_merge( $category, $customPresets[ $categoryKey ] );
			}
		}

		return $presets;

	}

	public static function save( $data ) {
		return update_option( 'ls-transition-presets', $data, false );
	}
}