Skip to content

Instantly share code, notes, and snippets.

@angelorocha
Created August 24, 2021 12:57
Show Gist options
  • Save angelorocha/5cba306b6ff14c89dd3ce008dee23084 to your computer and use it in GitHub Desktop.
Save angelorocha/5cba306b6ff14c89dd3ce008dee23084 to your computer and use it in GitHub Desktop.
Problem with assets dir
<?php
if( !class_exists('Redux') ) {
return;
}
$opt_name = 'wpss_option';
$theme = wp_get_theme();
$args = array(
'display_name' => $theme->get('Name'),
'display_version' => $theme->get('Version'),
'menu_icon' => WPSS_IMAGES_DIR . 'default-cpt-icon.png',
'menu_type' => 'menu',
'menu_title' => esc_html__('Site Options', 'wpss'),
//'page_parent' => 'themes.php',
'page_priority' => 9,
'page_permissions' => 'manage_options',
'page_slug' => '_wpss_options_page',
'page_title' => __('Theme Options Page', 'wpss'),
'show_import_export' => true,
'customizer' => true,
'dev_mode' => false,
'update_notice' => false
);
$args['share_icons'][] = array(
'url' => 'https://www.instagram.com/agenciamoustache/',
'title' => 'Follow us on Instagram',
'icon' => 'el el-instagram'
);
$args['share_icons'][] = array(
'url' => 'https://www.facebook.com/agmoustache/',
'title' => 'Follow us on Facebook',
'icon' => 'el el-facebook'
);
$args['share_icons'][] = array(
'url' => 'https://pt.linkedin.com/company/agenciamoustache',
'title' => 'Follow us on Linkedin',
'icon' => 'el el-linkedin'
);
$args['share_icons'][] = array(
'url' => 'https://www.youtube.com/channel/UCVj7LW6-fOBAqgCuxaypZ8g',
'title' => 'Follow us on YouTube',
'icon' => 'el el-youtube'
);
Redux::set_args($opt_name, $args);
/*** Talent Integration */
Redux::set_section($opt_name, array(
'title' => esc_html__('Talent Integration', 'wpss'),
'id' => 'wpss_talent_integration',
'desc' => esc_html__('Input your Talent site url and API Key.', 'wpss'),
'icon' => 'el el-glasses',
'fields' => array(
array(
'id' => 'wpss_talent_site_url',
'type' => 'text',
'title' => __('Site URL', 'wpss'),
'desc' => __('Your Talent site URL', 'wpss'),
'validate' => array(
'url'
),
'placeholder' => __('https://mysite.talentlms.com/', 'wpss'),
'autocomplete' => 'off'
),
array(
'id' => 'wpss_talent_api_key',
'type' => 'text',
'title' => __('API Key', 'wpss'),
'desc' => __('Your Talent API Key', 'wpss'),
'autocomplete' => 'off'
),
)
));
/*** Header options */
Redux::set_section($opt_name, array(
'title' => esc_html__('Social Links', 'wpss'),
'id' => 'wpss_social_links',
'desc' => esc_html__('Configure your social links.', 'wpss'),
'icon' => 'el el-share',
'fields' => array(
array(
'id' => 'wpss_social_ig',
'type' => 'text',
'title' => esc_html__('Instagram', 'wpss'),
'subtitle' => esc_html__('Insert your Instagram link.', 'wpss'),
'validate' => 'url'
),
array(
'id' => 'wpss_social_li',
'type' => 'text',
'title' => esc_html__('Linkedin', 'wpss'),
'subtitle' => esc_html__('Insert your Linkedin link.', 'wpss'),
'validate' => 'url'
),
array(
'id' => 'wpss_social_fb',
'type' => 'text',
'title' => esc_html__('Facebook', 'wpss'),
'subtitle' => esc_html__('Insert your facebook link.', 'wpss'),
'validate' => 'url'
),
array(
'id' => 'wpss_social_tt',
'type' => 'text',
'title' => esc_html__('Twitter', 'wpss'),
'subtitle' => esc_html__('Insert your twitter link.', 'wpss'),
'validate' => 'url'
),
array(
'id' => 'wpss_social_yt',
'type' => 'text',
'title' => esc_html__('YouTube', 'wpss'),
'subtitle' => esc_html__('Insert your Youtube link.', 'wpss'),
'validate' => 'url'
)
)
));
/*** Custom Javascript */
Redux::set_section($opt_name, array(
'title' => esc_html__('Custom Scripts', 'wpss'),
'id' => 'custom_scripts',
'desc' => esc_html__('Insert your custom scripts here.', 'wpss'),
'icon' => 'el el-quote-alt',
'fields' => array(
array(
'id' => 'wpss_header_script',
'type' => 'ace_editor',
'title' => __('Header Javascript Code', 'wpss'),
'subtitle' => __('Paste your javascript code here.', 'wpss'),
'mode' => 'javascript',
'theme' => 'monokai',
'desc' => esc_html__('Your script will be inserted immediately before the </head> tag', 'wpss'),
'options' => array(
'minLines' => 30,
),
'default' => "//$('#your-script-here');"
),
array(
'id' => 'wpss_footer_script',
'type' => 'ace_editor',
'title' => __('Footer Javascript Code', 'wpss'),
'subtitle' => __('Paste your javascript code here.', 'wpss'),
'mode' => 'javascript',
'theme' => 'monokai',
'desc' => esc_html__('Your script will be inserted immediately before the </body> tag', 'wpss'),
'options' => array(
'minLines' => 30,
),
'default' => "//$('#your-script-here');"
)
)
));
/*** Custom CSS */
Redux::set_section($opt_name, array(
'title' => esc_html__('Custom CSS', 'wpss'),
'id' => 'custom_css',
'desc' => esc_html__('Insert your custom CSS here.', 'wpss'),
'icon' => 'el el-css',
'fields' => array(
array(
'id' => 'wpss_custom_css',
'type' => 'ace_editor',
'title' => __('CSS Code', 'wpss'),
'subtitle' => __('Paste your CSS code here.', 'wpss'),
'mode' => 'css',
'theme' => 'monokai',
'desc' => esc_html__('Your css will be inserted immediately before the </head> tag', 'wpss'),
'options' => array(
'minLines' => 30,
),
'default' => "/* Custom CSS Code */"
)
)
));
/*** Site Maintenance */
Redux::set_section($opt_name, array(
'title' => esc_html__('Maintenance Mode', 'wpss'),
'id' => 'maintenance_mode',
'desc' => esc_html__('Enable site maintenance mode.', 'wpss'),
'icon' => 'el el-lock',
'fields' => array(
array(
'id' => 'wpss_maintenance',
'type' => 'switch',
'title' => __('Enable', 'wpss'),
'subtitle' => __('Configure site maintenance mode.', 'wpss'),
'desc' => esc_html__('Enable/Disable Maintenance Mode', 'wpss'),
'on' => 'Enable',
'off' => 'Disable',
'default' => false
),
array(
'id' => 'wpss_maintenance_title',
'type' => 'text',
'title' => __('Site Title', 'wpss'),
'subtitle' => __('Define site title', 'wpss'),
'desc' => __('Site title when maintenance mode is enabled', 'wpss'),
'default' => __('Maintenance mode enabled', 'wpss'),
'required' => array(
array(
'wpss_maintenance',
'=',
true
)
),
'autocomplete' => 'off'
),
array(
'id' => 'wpss_maintenance_description',
'type' => 'editor',
'title' => __('Site Description', 'wpss'),
'subtitle' => __('Type maintenance description', 'wpss'),
'desc' => __('Add a short description to maintenance mode.', 'wpss'),
'default' => __('Our site is undergoing scheduled maintenance', 'wpss'),
'required' => array(
array(
'wpss_maintenance',
'=',
true
)
),
'autocomplete' => 'off'
),
array(
'id' => 'wpss_maintenance_background',
'type' => 'background',
'title' => __('Background Style', 'wpss'),
'subtitle' => __('Set maintenance background.', 'wpss'),
'desc' => __('Pick a color or send a background image to maintenance mode.', 'wpss'),
'default' => array(
'background-color' => '#FAFAFA',
'background-repeat' => 'no-repeat',
'background-attachment' => 'fixed',
'background-position' => 'center top',
'background-size' => 'cover'
),
'required' => array(
array(
'wpss_maintenance',
'=',
true
)
),
),
array(
'id' => 'wpss_maintenance_login',
'type' => 'switch',
'title' => __('Login Box', 'wpss'),
'subtitle' => __('Enable login box.', 'wpss'),
'desc' => esc_html__('Enable/Disable user login box', 'wpss'),
'on' => 'Enable',
'off' => 'Disable',
'default' => false,
'required' => array(
array(
'wpss_maintenance',
'=',
true
)
),
),
array(
'id' => 'wpss_maintenance_login_box_color',
'type' => 'color_gradient',
'title' => __('Login box background color', 'wpss'),
'validate' => array( 'color' ),
'default' => array(
'from' => '#FAFAFA',
'to' => '#EBEBEB',
),
'transparent' => false,
'required' => array(
array(
'wpss_maintenance_login',
'=',
true
)
),
),
array(
'id' => 'wpss_maintenance_login_logo',
'type' => 'media',
'url' => true,
'title' => __('Select the login site logo', 'wpss'),
'default' => array(
'url' => WPSS_IMAGES_DIR . 'joao-cordeiro-logo-black.png'
),
'required' => array(
array(
'wpss_maintenance_login',
'=',
true
)
),
)
)
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment