getAllModuleData(); // Run filters if( has_filter( 'layerslider_override_defaults' ) ) { $newDefaults = apply_filters( 'layerslider_override_defaults', $lsDefaults ); if( ! empty( $newDefaults ) && is_array( $newDefaults ) ) { $lsDefaults = $newDefaults; unset($newDefaults); } } // Get global Google Fonts $googleFonts = get_option('ls-google-fonts', [] ); $googleFontsEnabled = (int) get_option('layerslider-google-fonts-enabled', true); // Get post types $postTypes = LS_Posts::getPostTypes(); $postCategories = get_categories(); $postTags = get_tags(); $postTaxonomies = get_taxonomies( ['_builtin' => false ], 'objects'); // Editor Settings $editorSettings = get_user_meta( $userID, 'ls-editor-settings', true ); $editorSettings = json_decode( $editorSettings, true ); $editorSettings = ! empty( $editorSettings ) ? $editorSettings : []; $editorSettings = array_merge([ 'showTooltips' => true, 'useKeyboardShortcuts' => true, 'undoNotifyOSD' => true ], $editorSettings ); wp_localize_script('ls-project-editor', 'LS_editorSettings', $editorSettings ); // Editor Modules wp_localize_script('ls-project-editor', 'LS_editorModules', $modules); // Editor Meta wp_localize_script('ls-project-editor', 'LS_editorMeta', [ 'isActivatedSite' => $lsActivated, 'googleFontsEnabled' => (bool) $googleFontsEnabled, 'editorNonce' => wp_create_nonce('ls-editor-nonce'), 'exportURL' => wp_nonce_url( admin_url('admin.php?page=layerslider&action=export&id='.$id.''), 'export-sliders' ) ]); // Global Settings wp_localize_script('ls-project-editor', 'LS_pluginSettings', [ 'performanceMode' => (bool) get_option('ls_performance_mode', true ) ]); // Icons wp_localize_script('ls-project-editor', 'LS_InterfaceIcons', [ 'layerTypes' => [ 'img' => lsGetSVGIcon('image-polaroid', 'regular'), 'text' => lsGetSVGIcon('align-left'), 'media' => lsGetSVGIcon('play-circle'), 'button' => lsGetSVGIcon('dot-circle'), 'icon' => lsGetSVGIcon('icons'), 'asset' => lsGetSVGIcon('photo-video'), 'shape' => lsGetSVGIcon('shapes'), 'svg' => lsGetSVGIcon('stars'), 'html' => lsGetSVGIcon('code'), 'post' => lsGetSVGIcon('database'), 'import' => lsGetSVGIcon('file-import'), 'audio' => lsGetSVGIcon('volume') ], 'notifications' => [ 'save' => lsGetSVGIcon('save'), 'check' => lsGetSVGIcon('check'), 'camera' => lsGetSVGIcon('camera'), 'images' => lsGetSVGIcon('images'), 'upload' => lsGetSVGIcon('cloud-upload-alt'), 'font-case' => lsGetSVGIcon('font-case'), 'play-circle' => lsGetSVGIcon('play-circle'), 'window-maximize' => lsGetSVGIcon('window-maximize', 'regular'), 'undo' => lsGetSVGIcon('undo-alt'), 'redo' => lsGetSVGIcon('redo-alt') ], 'search' => [ 'circle' => lsGetSVGIcon('circle', 'regular'), 'fullscreen' => lsGetSVGIcon('expand-alt'), 'clone' => lsGetSVGIcon('clone'), 'eye' => lsGetSVGIcon('eye'), 'trash' => lsGetSVGIcon('trash-alt'), 'camera' => lsGetSVGIcon('camera'), 'undo' => lsGetSVGIcon('undo-alt'), 'redo' => lsGetSVGIcon('redo-alt'), 'film' => lsGetSVGIcon('film'), 'lock' => lsGetSVGIcon('lock'), 'copy' => lsGetSVGIcon('copy'), 'clipboard' => lsGetSVGIcon('clipboard'), 'plus' => lsGetSVGIcon('plus'), 'cog' => lsGetSVGIcon('cog'), 'save' => lsGetSVGIcon('save'), 'publish' => lsGetSVGIcon('cloud-upload-alt'), 'wrench' => lsGetSVGIcon('wrench'), 'retweet' => lsGetSVGIcon('retweet'), 'globe' => lsGetSVGIcon('globe-americas'), 'book' => lsGetSVGIcon('book'), 'help' => lsGetSVGIcon('question-circle'), 'export' => lsGetSVGIcon('file-export'), 'history' => lsGetSVGIcon('history'), 'keyboard' => lsGetSVGIcon('keyboard'), 'facebook' => lsGetSVGIcon('facebook-f', 'brands'), 'twitter' => lsGetSVGIcon('twitter', 'brands'), 'youtube' => lsGetSVGIcon('youtube', 'brands'), 'chevronRight' => lsGetSVGIcon('chevron-right') ] ]); include LS_ROOT_PATH . '/includes/ls_global.php'; // Load project-specific Google Fonts if( $googleFontsEnabled && ! empty( $slider['googlefonts'] ) && is_array( $slider['googlefonts'] ) ) { $fontFragments = []; foreach( $slider['googlefonts'] as $font ) { $fontParams = explode(':', $font['param']); $fontName = urlencode( urldecode( $fontParams[0] ) ); $fontFragments[] = $fontName.':100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i'; } $fontsURL = implode('%7C', $fontFragments); echo ''; } // Editor state classes $lseEditorClasses = []; if( ! $lsActivated ) { $lseEditorClasses[] = 'lse-unregistered-plugin'; } if( (int) $sliderItem['flag_dirty'] && ! isset( $_GET['ignore-drafts'] ) ) { $lseEditorClasses[] = 'lse-slider-is-dirty'; } if( isset( $_GET['ignore-drafts'] ) && ! empty( $sliderDraft['data'] ) ) { $lseEditorClasses[] = 'lse-editor-is-dirty'; $lseEditorClasses[] = 'lse-draft-available'; $lseEditorClasses[] = 'lse-menu-more-badge'; } if( (int) $sliderItem['flag_dirty'] && ! empty( $lsSliderDraftLoaded ) ) { $lseEditorClasses[] = 'lse-draft-edit'; //$lseEditorClasses[] = 'lse-menu-more-badge'; } $lseEditorClasses = implode(' ', $lseEditorClasses); $lseProjectUsesPlayByScroll = ! empty( $slider['properties']['playByScroll'] ); $lsePlayByScrollEnabled = get_option('ls_enable_play_by_scroll', false); include LS_ROOT_PATH . '/classes/class.ls.transitionpresets.php'; $transitionPresets = LS_TransitionPresets::get(); ?>