관리-도구
편집 파일: settings.php
<?php /** * Theme customizer settings. * * @package Arcade Theme * @subpackage Customizer */ defined( 'ABSPATH' ) || die( "Can't access directly" ); // Textdomain. This is required, otherwise strings aren't translateable. load_theme_textdomain( 'arcade' ); /** * Editors DropDown Choices */ function arcade_editors_choice () { $editors = get_users( [ 'role__not_in' => [ 'subscriber' ] ] ); $choices = array(); foreach ( $editors as $user ) { $choices [$user->ID] = $user->display_name; } return $choices; } // Kirki configuration. Kirki::add_config( 'arcade', array( 'capability' => 'edit_theme_options', 'option_type' => 'theme_mod', 'gutenberg_support' => false, 'disable_output' => false, ) ); $config = 'arcade'; $clearcachediv = '<div style="color:#E91E63"><span class="dashicons dashicons-image-rotate"></span> %s <a href="'. home_url("?action=kirki-reset-cache") .'" class="button-secondary" target="_blank">'.__( 'Clear Cache', 'arcade' ).' <span class="dashicons dashicons-external"></span></a></div>'; $infodiv = '<div style="color:#E91E63"><span class="dashicons dashicons-info-outline"></span> %s</div>'; // Premium Add-On. if ( ! arcade_is_premium() ) { Kirki::add_section( 'arcade_premium_addon', array( 'title' => __( 'Premium Features available!', 'arcade' ), 'priority' => 1, 'type' => 'expanded', ) ); $arcade_premium_ad_link = '<span class="dashicons dashicons-superhero"></span> '. sprintf( __( 'Get all features with the <a href="%1s" target="_blank">Premium Add-On</a>!', 'arcade' ), esc_url( 'https://arcadetheme.com/?premium=1&utm_source=repository&utm_medium=customizer&utm_campaign=get_premium' ) ); $setup = '<hr><div style="color:green">Are you confused? 😕 <br> I can do the theme settings for you for just $100. <a target="_blank" href="https://arcadetheme.com/contact-us/?utm_source=repository&utm_medium=customizer&utm_campaign=setup_for_me" class="button button-primaryx"><span class="dashicons dashicons-email" style="vertical-align: text-top;"></span> Message Me</a></div>'; Kirki::add_field( 'wpbf', array( 'type' => 'custom', 'settings' => 'arcade_premium_ad', 'section' => 'arcade_premium_addon', 'default' => $arcade_premium_ad_link . $setup, 'priority' => 1, ) ); } /** * LAYOUT */ Kirki::add_panel( 'panel_layout', array( 'priority' => 10, 'title' => esc_html__( 'Layout', 'arcade' ), ) ); // General Kirki::add_section( 'section_general', array( 'title' => esc_html__( 'General', 'arcade' ), 'panel' => 'panel_layout', 'priority' => 160, ) ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'color_a', 'label' => __( 'Link Color', 'arcade' ), 'section' => 'section_general', 'default' => '#ffd219', ] ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'color_a_hover', 'label' => __( 'Link Mouseover Color', 'arcade' ), 'section' => 'section_general', 'default' => '#FFF', ] ); // Header Kirki::add_section( 'section_header', array( 'title' => esc_html__( 'Header', 'arcade' ), 'panel' => 'panel_layout', 'priority' => 160, ) ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'header_bg_color', 'label' => __( 'Background Color', 'arcade' ), 'description' => __( 'Background Color', 'arcade' ), 'section' => 'section_header', 'default' => '#FACC48', 'choices' => ['alpha' => true], ] ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'header_menu_color', 'label' => __( 'Menu Color', 'arcade' ), 'description' => __( 'Menu Color', 'arcade' ), 'section' => 'section_header', 'default' => '#ffffff', 'choices' => ['alpha' => true], ] ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'header_submenu_color', 'label' => __( 'Submenus Color', 'arcade' ), 'description' => __( 'Submenus Color', 'arcade' ), 'section' => 'section_header', 'default' => '#1e5979', 'choices' => ['alpha' => true], ] ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'header_menu_button_bg_color', 'label' => __( 'Buttons Background Color', 'arcade' ), 'description' => __( 'Buttons Background Color', 'arcade' ), 'section' => 'section_header', 'default' => '#56ad1e', 'choices' => ['alpha' => true], ] ); Kirki::add_field( $config, [ 'type' => 'color', 'settings' => 'header_menu_button_bg_color2', 'label' => __( 'Buttons Shadow Color', 'arcade' ), 'description' => __( 'Buttons Shadow Color', 'arcade' ), 'section' => 'section_header', 'default' => '#408216', 'choices' => ['alpha' => true], ] ); // Typography Kirki::add_section( 'section_typography', array( 'title' => esc_html__( 'Typography', 'arcade' ), 'panel' => 'panel_layout', 'priority' => 160, ) ); Kirki::add_field( $config, [ 'type' => 'radio', 'settings' => 'fonts_server', 'label' => esc_html__( 'Google Fonts Server', 'arcade' ), 'section' => 'section_typography', 'default' => 'local', 'priority' => 1, 'choices' => [ 'local' => [ esc_html__( 'Local', 'arcade' ), esc_html__( "Downloads font-files locally and uses the local files instead of the ones from Google's servers. This addresses any and all GDPR concerns, as well as firewalls that exist in some parts of the world.", 'arcade' ), ], 'google' => [ esc_html__( 'Google', 'arcade' ), esc_html__( 'The Webfont Installer script is used for Google Fonts and the theme connects to Google servers for fonts.', 'arcade' ), ] ], ] ); Kirki::add_field( $config, [ 'type' => 'custom', 'settings' => 'info-01', 'section' => 'section_typography', 'default' => sprintf($clearcachediv, __( "Keep in mind thought that the gfonts CSS gets cached for 24 hours, so if you want to reset the caches and see the changes immediately you'll need to click clear cache button to reset the transients and have the styles get re-generated.", 'arcade' ) ) ] ); Kirki::add_field( $config, [ 'type' => 'custom', 'settings' => 'info-02', 'section' => 'section_typography', 'default' => sprintf($infodiv, __( 'Use same fonts for speed.', 'arcade' ) ) ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography', 'label' => esc_html__( 'Theme Font', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'Oswald', 'variant' => 'regular', 'font-size' => '1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#0f5979', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-headers', 'label' => esc_html__( 'Page Headers', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'Oswald', 'variant' => 'regular', 'font-size' => '1.1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#0f5979', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'header.page-title', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-page-content', 'label' => esc_html__( 'Page Content', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'Oswald', 'variant' => 'regular', 'font-size' => '1.1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#ffffff', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'main .entry-content', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-headers-home', 'label' => __( 'Page Headers', 'arcade' ) .' → ' . __( 'Home Page', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'inherit', 'variant' => 'regular', 'font-size' => '1.1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#0f5979', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'header h1.page-title.home', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-headers-archive', 'label' => __( 'Page Headers', 'arcade' ) .' → ' . __( 'Archive', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'inherit', 'variant' => 'regular', 'font-size' => '1.1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#ffffff', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'header h1.page-title.archive', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-headers-game', 'label' => __( 'Page Headers', 'arcade' ) .' → ' . __( 'Game', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'inherit', 'variant' => 'regular', 'font-size' => '1.1em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#0f5979', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'header h1.page-title.game', ], ], ] ); Kirki::add_field( $config, [ 'type' => 'typography', 'settings' => 'typography-links-related-games', 'label' => __( 'Related Games', 'arcade' ) .' → ' . __( 'Links', 'arcade' ), 'section' => 'section_typography', 'default' => [ 'font-family' => 'inherit', 'variant' => 'regular', 'font-size' => '0.85em', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#ffd51e', 'text-transform' => 'uppercase', 'text-align' => 'center', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => '.rg a', ], ], ] ); /** * SETTINGS */ Kirki::add_panel( 'panel_settings', array( 'priority' => 10, 'title' => __( 'Settings', 'arcade' ), ) ); // Importer Kirki::add_section( 'section_importer', array( 'title' => __( 'Importer', 'arcade' ), 'panel' => 'panel_settings', 'priority' => 2, ) ); Kirki::add_field( $config, [ 'type' => 'switch', 'settings' => 'importer', 'label' => esc_html__( 'Importer', 'arcade' ), 'description' => __( 'Turn this setting on to automatically add games according to the interval time. If games are not added automatically, WordPress cron is not working properly. This is not a Arcade Theme issue.', 'arcade' ), 'section' => 'section_importer', 'default' => '1', 'priority' => 1, 'choices' => [ 'on' => __( 'Enable', 'arcade' ), 'off' => __( 'Disable', 'arcade' ), ], ] ); Kirki::add_field( $config, [ 'type' => 'number', 'settings' => 'interval', 'label' => __( 'Interval', 'arcade' ), 'description' => __( 'Minutes between publish of new games', 'arcade' ), 'section' => 'section_importer', 'default' => 240, 'choices' => [ 'min' => 0, //'max' => 80, 'step' => 1, ], 'priority' => 2, ] ); Kirki::add_field( $config, [ 'priority' => 3, 'type' => 'custom', 'settings' => 'import-manual', 'section' => 'section_importer', 'default' => sprintf('<a href="%s" target="_blank"><span class="iconify" data-icon="dashicons:controls-play"></span> %s</a>', home_url("?importer=".time()), __( 'Run the importer manually', 'arcade' ) ) ] ); Kirki::add_field( $config, [ 'type' => 'multicheck', 'settings' => 'sources', 'label' => __( 'Content Sources', 'arcade' ), 'description' => __( ' To monetize in-game ads or embed games, you need to register your site through the provider`s website.<br> Click for registration: <a href="https://gamemonetize.com/account/websites.php" target="new">GameMonetize.com</a><br> <a href="https://developer.gamedistribution.com/register/publisher/" target="new">GameDistribution.com</a> <br> ', 'arcade' ), 'section' => 'section_importer', 'default' => array('gamedistribution', 'gamemonetize'), 'priority' => 10, 'choices' => [ 'gamedistribution' => __( 'GameDistribution.com', 'arcade' ), 'gamemonetize' => __( 'GameMonetize.com', 'arcade' ), ], ] ); Kirki::add_field( $config, [ 'type' => 'radio', 'settings' => 'post_status', 'label' => esc_html__( 'Post Status', 'arcade' ), 'section' => 'section_importer', 'default' => 'publish', 'priority' => 10, 'choices' => [ 'publish' => [ esc_html__( 'Publish', 'arcade' ), esc_html__( 'The game is published immediately. Just sit back and watch the action.', 'arcade' ), ], 'draft' => [ esc_html__( 'Draft', 'arcade' ), esc_html__( 'Pending and this option requires editor approval to publish the game.', 'arcade' ), ], 'pending' => [ esc_html__( 'Pending', 'arcade' ), esc_html__( 'Original content is important for SEO. Select this to rewrite or enrich the content. ', 'arcade' ), ], ], ] ); Kirki::add_field( $config, array( 'type' => 'select', 'settings' => 'post_author', 'label' => __( 'Author', 'arcade' ), 'description' => __( 'Attribute all posts to the following user', 'arcade' ), 'section' => 'section_importer', 'default' => '1', 'priority' => 10, 'choices' => arcade_editors_choice(), ) ); Kirki::add_field( $config, [ 'type' => 'textarea', 'settings' => 'tags_allowed', 'label' => __( 'Accepted tags', 'arcade' ), 'section' => 'section_importer', 'description' => __( 'Only add games with these comma separated tags. Empty for all.', 'arcade' ), 'default' => '', 'priority' => 3, ] ); Kirki::add_field( $config, [ 'type' => 'textarea', 'settings' => 'tags_blocked', 'label' => __( 'Blocked tags', 'arcade' ), 'section' => 'section_importer', 'description' => __( 'Block games with these comma separated tags. Empty for disable.', 'arcade' ), 'default' => '', 'priority' => 4, ] ); Kirki::add_field( $config, [ 'type' => 'textarea', 'settings' => 'tags_extra', 'label' => __( 'Additional tags', 'arcade' ), 'section' => 'section_importer', 'description' => __( '(separate with commas)', 'arcade' ), 'default' => '', 'priority' => 4, ] ); // GENERAL SETTINGS Kirki::add_section( 'general_settings', array( 'title' => __( 'General Settings', 'arcade' ), 'panel' => 'panel_settings', 'priority' => 1, ) ); Kirki::add_field( $config, [ 'type' => 'dropdown-pages', 'settings' => 'all_categories_page', 'label' => esc_html__( 'All Categories Page', 'arcade' ), 'placeholder' => esc_attr__( 'Select Page', 'arcade' ), 'section' => 'general_settings', 'default' => 0, 'priority' => 10, ] ); Kirki::add_field( $config, [ 'type' => 'text', 'settings' => 'term_title_prefix', 'label' => __( 'Text before tag title', 'arcade' ), 'section' => 'general_settings', 'default' => __( 'Free Online', 'arcade' ), 'priority' => 4, ] ); Kirki::add_field( $config, [ 'type' => 'text', 'settings' => 'term_title_suffix', 'label' => __( 'Text after tag title', 'arcade' ), 'section' => 'general_settings', 'default' => __( 'Games', 'arcade' ), 'priority' => 4, ] ); // ADS SETTINGS Kirki::add_section( 'ads_settings', array( 'title' => __( 'Advertisements', 'arcade' ), 'panel' => 'panel_settings', 'priority' => 1, ) ); $adv_ads_is = __( 'Disabled', 'arcade' ); if(defined('ADVADS_BASE_PATH')) $adv_ads_is = __( 'Enabled', 'arcade' ); Kirki::add_field( $config, [ 'type' => 'switch', 'settings' => 'auto_add_ads_txt_lines', 'label' => esc_html__( 'Automatically insert snippets into Ads.txt', 'arcade' ), 'section' => 'ads_settings', 'default' => '1', 'priority' => 1, 'choices' => [ 'on' => __( 'Enable', 'arcade' ), 'off' => __( 'Disable', 'arcade' ), ], 'description' => __( 'Please add the necessary snippets in ads.txt to protect your earnings. You should also verify these changes in the GameMonetize.com or GameDistribution.com publisher panels. Arcade Theme can make these additions automatically. Please install and activate the <a href="https://wordpress.org/plugins/advanced-ads/" target="new">Advanced Ads</a> plugin for this.', 'arcade') ] ); Kirki::add_field( $config, [ 'priority' => 1, 'type' => 'custom', 'settings' => 'ads_settings_info-01', 'section' => 'ads_settings', 'default' => sprintf("Advanced Ads : %s (%s)", $adv_ads_is, __("Check out this plugin's settings to add new lines in ads.txt.", "arcade") ) ] ); Kirki::add_field( $config, [ 'type' => 'text', 'settings' => 'adSense_pub_ID', 'label' => __( 'AdSense publisher ID', 'arcade' ), 'section' => 'ads_settings', 'default' => '', 'placeholder' => 'ca-pub-1234567891234567', 'priority' => 1, 'description' => __( 'Your publisher ID is the unique identifier for your AdSense account. <a href="https://support.google.com/adsense/answer/105516" target="new">Find your publisher ID</a>.', 'arcade') ] ); Kirki::add_field( $config, [ 'type' => 'code', 'settings' => 'ads_game_embed_L', 'label' => __( 'Left side of the game', 'arcade' ), 'section' => 'ads_settings', 'default' => arcade_ex_ad('120x600'), 'priority' => 1, 'choices' => [ 'language' => 'html', ], ] ); Kirki::add_field( $config, [ 'type' => 'code', 'settings' => 'ads_game_embed_R', 'label' => __( 'Right side of the game', 'arcade' ), 'section' => 'ads_settings', 'default' => arcade_ex_ad('160x600'), 'priority' => 1, 'choices' => [ 'language' => 'html', ], ] ); Kirki::add_field( $config, [ 'type' => 'code', 'settings' => 'ads_game_desc_after', 'label' => __( 'Below the game description', 'arcade' ), 'section' => 'ads_settings', 'default' => arcade_ex_ad('728x90'), 'priority' => 1, 'choices' => [ 'language' => 'html', ], ] ); Kirki::add_field( $config, [ 'type' => 'code', 'settings' => 'ads_game_related_after', 'label' => __( 'Below the related games section', 'arcade' ), 'section' => 'ads_settings', 'default' => arcade_ex_ad('970x90'), 'priority' => 1, 'choices' => [ 'language' => 'html', ], ] ); // SEARCH SETTINGS Kirki::add_section( 'search_settings', array( 'title' => __( 'Search', 'arcade' ), 'panel' => 'panel_settings', 'priority' => 1, ) ); Kirki::add_field( $config, [ 'type' => 'radio', 'settings' => 'search_by', 'label' => esc_html__( 'Search Engine', 'arcade' ), 'section' => 'search_settings', 'default' => 'wp', 'priority' => 1, 'choices' => [ 'wp' => [ esc_html__( 'WordPress', 'arcade' ), esc_html__( 'WordPress’s own internal search feature isn`t of the highest quality. But you can use plugins like Relevanssi.', 'arcade' ), ], 'cse' => [ esc_html__( 'Google Custom Search', 'arcade' ), esc_html__( 'Google Custom Search is not actually a WordPress plugin, but more of a tool that works by integrating with your site.', 'arcade' ), ] ], ] ); Kirki::add_field( $config, [ 'type' => 'text', 'settings' => 'cse_id', 'label' => __( 'Search engine ID', 'arcade' ), 'description' => __( 'Get the ID from this page: <a href="https://cse.google.com/cse/all" target="new">google.com/cse</a>.', 'arcade'), 'section' => 'search_settings', 'priority' => 1, 'active_callback' => [ [ 'setting' => 'search_by', 'operator' => '==', 'value' => 'cse', ] ] ] ); // HOME PAGE SETTINGS Kirki::add_section( 'home_page_settings', array( 'title' => __( 'Home Page Settings', 'arcade' ), 'panel' => 'panel_settings', 'priority' => 1, ) ); Kirki::add_field( $config, [ 'type' => 'text', 'settings' => 'home_page_title', 'label' => __( 'Home page title', 'arcade' ), 'section' => 'home_page_settings', 'default' => __( 'Free Online Games', 'arcade' ), 'priority' => 1, ] ); Kirki::add_field( $config, [ 'type' => 'dropdown-pages', 'settings' => 'footer_content_home', 'label' => esc_html__( 'Content Page', 'arcade' ), 'placeholder' => esc_attr__( 'Select Page', 'arcade' ), 'description' => __( 'Choose a page to appear at the bottom of the page (Important for SEO).', 'arcade'), 'section' => 'home_page_settings', 'default' => '', 'priority' => 1, ] );