Import legacy nurinda.co.id website
No files matched your search
@@ -0,0 +1,84 @@
|
||||
/* Custom theme styles for the editor */
|
||||
|
||||
body {
|
||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
||||
margin: 20px;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: normal;
|
||||
line-height: 1.4;
|
||||
margin: 0 0 1.5rem;
|
||||
padding: 1rem 0 0;
|
||||
}
|
||||
h1:first-child,
|
||||
h2:first-child,
|
||||
h3:first-child,
|
||||
h4:first-child,
|
||||
h5:first-child,
|
||||
h6:first-child,
|
||||
h1 + h2, h1 + h3, h1 + h4, h1 + h5, h1 + h6,
|
||||
h2 + h3, h2 + h4, h2 + h5, h2 + h6,
|
||||
h3 + h4, h3 + h5, h3 + h6,
|
||||
h4 + h5, h4 + h6,
|
||||
h5 + h6 {
|
||||
padding-top: 0;
|
||||
}
|
||||
p, ul, ol, dl, address, pre, table, blockquote, fieldset {
|
||||
margin: 0 0 1.5rem;
|
||||
}
|
||||
ul {
|
||||
list-style-type: disc;
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
ol {
|
||||
list-style-type: decimal;
|
||||
padding-left: 2.5rem;
|
||||
}
|
||||
ul li,
|
||||
ol li {
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
li > ul,
|
||||
li > ol {
|
||||
margin-bottom: 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
blockquote {
|
||||
padding-left: 2rem;
|
||||
border-left: 5px solid;
|
||||
}
|
||||
blockquote q,
|
||||
blockquote p {
|
||||
font: inherit;
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
blockquote cite {
|
||||
display: block;
|
||||
font-size: 80%;
|
||||
}
|
||||
.alignleft {
|
||||
margin: 0 2.5em 2.5em 0;
|
||||
}
|
||||
.alignright {
|
||||
margin: 0 0 2.5em 2.5em;
|
||||
}
|
||||
|
||||
body.rtl ul,
|
||||
body.rtl ol {
|
||||
padding-left: 0;
|
||||
padding-right: 2.5rem;
|
||||
}
|
||||
body.rtl blockquote {
|
||||
padding-left: 0;
|
||||
padding-right: 2rem;
|
||||
border-left: none;
|
||||
border-right-width: 5px;
|
||||
border-right-style: solid;
|
||||
}
|
||||
|
||||
h1 { font-size: 36px; }
|
||||
h2 { font-size: 32px; }
|
||||
h3 { font-size: 28px; }
|
||||
h4 { font-size: 24px; }
|
||||
h5 { font-size: 20px; }
|
||||
h6 { font-size: 18px; }
|
||||
@@ -0,0 +1,130 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* About admin page
|
||||
*/
|
||||
|
||||
add_action( 'admin_menu', 'us_add_info_home_page', 50 );
|
||||
function us_add_info_home_page() {
|
||||
add_submenu_page( 'us-theme-options', US_THEMENAME . ': Home', us_translate_x( 'About', 'personal data group label' ), 'manage_options', 'us-home', 'us_welcome_page', 11 );
|
||||
}
|
||||
|
||||
function us_welcome_page() {
|
||||
|
||||
// Predefined URLs
|
||||
$help_portal = 'https://help.us-themes.com';
|
||||
$help_portal_api_url = 'https://help.us-themes.com/envato_auth';
|
||||
|
||||
$urlparts = parse_url( site_url() );
|
||||
$domain = $urlparts['host'];
|
||||
$return_url = admin_url( 'admin.php?page=us-home' );
|
||||
|
||||
|
||||
?>
|
||||
<div class="wrap about-wrap us-home">
|
||||
|
||||
<div class="us-header">
|
||||
<h1><?php echo sprintf( __( 'Welcome to <strong>%s</strong>', 'us' ), US_THEMENAME . ' ' . US_THEMEVERSION ) ?></h1>
|
||||
|
||||
<div class="us-header-links">
|
||||
<div class="us-header-link">
|
||||
<a href="<?php echo $help_portal ?>/<?php echo ( defined( 'US_ACTIVATION_THEMENAME' ) ) ? strtolower( US_ACTIVATION_THEMENAME ) : strtolower( US_THEMENAME ); ?>/" target="_blank"><?php _e( 'Online Documentation', 'us' ) ?></a>
|
||||
</div>
|
||||
<div class="us-header-link">
|
||||
<a href="<?php echo $help_portal ?>/<?php echo ( defined( 'US_ACTIVATION_THEMENAME' ) ) ? strtolower( US_ACTIVATION_THEMENAME ) : strtolower( US_THEMENAME ); ?>/tickets/" target="_blank"><?php _e( 'Support Portal', 'us' ) ?></a>
|
||||
</div>
|
||||
<div class="us-header-link">
|
||||
<a href="<?php echo $help_portal ?>/<?php echo ( defined( 'US_ACTIVATION_THEMENAME' ) ) ? strtolower( US_ACTIVATION_THEMENAME ) : strtolower( US_THEMENAME ); ?>/changelog/" target="_blank"><?php _e( 'Theme Changelog', 'us' ) ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( get_option( 'us_license_activated', 0 ) == 1 ) { ?>
|
||||
<div class="us-activation">
|
||||
<div class="us-activation-status yes"><?php echo sprintf( __( '%s is activated', 'us' ), US_THEMENAME ); ?></div>
|
||||
<p><?php echo sprintf( __( 'You can deactivate it on your %sLicenses%s page.', 'us' ), '<a href="' . $help_portal . '/user/licenses/" target="_blank">', '</a>' ); ?></p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} elseif ( ! defined( 'US_THEME_BETA' ) ) {
|
||||
$host_is_dev = FALSE;
|
||||
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
|
||||
$chunks = explode( '.', $host );
|
||||
|
||||
if ( ( 1 === count( $chunks ) ) OR ( in_array(
|
||||
end( $chunks ), array(
|
||||
'local',
|
||||
'dev',
|
||||
'wp',
|
||||
'test',
|
||||
'example',
|
||||
'localhost',
|
||||
'invalid',
|
||||
)
|
||||
) ) OR preg_match( '/^[0-9\.]+$/', $host )
|
||||
) {
|
||||
$host_is_dev = TRUE;
|
||||
}
|
||||
|
||||
if ( $host_is_dev ) {
|
||||
?>
|
||||
<div class="updated hidden"><p>You are working on localhost development environment</p></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
$config = us_config( 'envato', array( 'purchase_url' => '#' ) );
|
||||
$purchase_url = $config['purchase_url'];
|
||||
|
||||
?>
|
||||
|
||||
<form class="us-activation" id="activation" method="post" action="<?php echo $help_portal_api_url; ?>">
|
||||
<input type="hidden" name="domain" value="<?php echo $domain; ?>">
|
||||
<input type="hidden" name="return_url" value="<?php echo $return_url; ?>">
|
||||
<input type="hidden" name="theme" value="<?php echo ( defined( 'US_ACTIVATION_THEMENAME' ) ) ? US_ACTIVATION_THEMENAME : US_THEMENAME; ?>">
|
||||
|
||||
<div class="us-activation-status no">
|
||||
<span><?php echo sprintf( __( '%s is not activated', 'us' ), US_THEMENAME ); ?></span>
|
||||
<div class="us-activation-desc">
|
||||
<div class="us-activation-desc-sign"></div>
|
||||
<div class="us-activation-desc-text">
|
||||
<p><?php _e( 'By activating theme license you will unlock premium options:', 'us' ) ?></p>
|
||||
<ul>
|
||||
<li><?php _e( 'Theme update notifications and ability to update the theme via one click', 'us' ) ?></li>
|
||||
<li><?php _e( 'Ability to install and update premium addons via one click', 'us' ) ?></li>
|
||||
<li><?php _e( 'Ability to import any of theme demos', 'us' ) ?></li>
|
||||
</ul>
|
||||
<p><?php _e( 'Don\'t have valid license yet?', 'us' ) ?><br><a target="_blank" href="<?php echo $purchase_url; ?>"><?php echo sprintf( __( 'Purchase %s license', 'us' ), US_THEMENAME ); ?></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input class="button button-primary" type="submit" value="<?php echo us_translate( 'Activate' ) ?>" name="activate">
|
||||
</form>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<div class="us-features">
|
||||
<div class="one-third">
|
||||
<h4><i class="dashicons dashicons-screenoptions"></i><?php _e( 'Install Addons', 'us' ) ?></h4>
|
||||
|
||||
<p><?php echo sprintf( __( '%s comes with popular plugins which increase theme abilities, install them via one click.', 'us' ), US_THEMENAME ); ?></p>
|
||||
<a class="button us-button" href="<?php echo admin_url( 'admin.php?page=us-addons' ); ?>"><?php _e( 'Go to Addons page', 'us' ) ?></a>
|
||||
</div>
|
||||
<div class="one-third">
|
||||
<h4><i class="dashicons dashicons-download"></i><?php _e( 'Import Demo Content', 'us' ) ?></h4>
|
||||
|
||||
<p><?php _e( 'Installed this theme for the first time? Import demo content to build your site not from scratch.', 'us' ) ?></p>
|
||||
<a class="button us-button" href="<?php echo admin_url( 'admin.php?page=us-demo-import' ); ?>">
|
||||
<?php _e( 'Go to Demo Import', 'us' ) ?></a>
|
||||
</div>
|
||||
<div class="one-third">
|
||||
<h4><i class="dashicons dashicons-admin-appearance"></i><?php _e( 'Customize Appearance', 'us' ) ?></h4>
|
||||
|
||||
<p><?php _e( 'To customize the look of your site (colors, layouts, fonts) go to the Theme Options panel.', 'us' ) ?></p>
|
||||
<a class="button us-button" href="<?php echo admin_url( 'admin.php?page=us-theme-options' ); ?>"><?php _e( 'Go to Theme Options', 'us' ) ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Addons admin page
|
||||
*/
|
||||
|
||||
if ( ! function_exists( 'get_plugins' ) ) {
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'install_plugins' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$js_composer_path = 'js_composer';
|
||||
$installed_plugins = get_plugins();
|
||||
$keys = array_keys( $installed_plugins );
|
||||
|
||||
foreach ( $keys as $key ) {
|
||||
if ( preg_match( '|^' . $js_composer_path . '/|', $key ) ) {
|
||||
$js_composer_path = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Display admin notice when WPBakery Page Builder is not active
|
||||
if ( ( ! get_option( 'us_dismiss_addons_install_notice' ) ) AND ( ! isset( $installed_plugins[ $js_composer_path ] ) ) ) {
|
||||
add_action( 'admin_notices', 'us_js_composer_install_admin_notice' );
|
||||
}
|
||||
if ( ( ! get_option( 'us_dismiss_addons_activate_notice' ) ) AND ( isset( $installed_plugins[ $js_composer_path ] ) ) AND is_plugin_inactive( $js_composer_path ) ) {
|
||||
add_action( 'admin_notices', 'us_js_composer_activate_admin_notice' );
|
||||
}
|
||||
function us_js_composer_install_admin_notice() {
|
||||
?>
|
||||
<div class="notice notice-warning us-addons-notice for-installing is-dismissible">
|
||||
<p><?php echo sprintf( __( 'This theme recommends to use %s plugin.', 'us' ), '<strong><a href="' . admin_url( 'admin.php?page=us-addons' ) . '">WPBakery Page Builder</a></strong>' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
function us_js_composer_activate_admin_notice() {
|
||||
?>
|
||||
<div class="notice notice-warning us-addons-notice for-activating is-dismissible">
|
||||
<p><?php echo sprintf( __( 'This theme recommends to use %s plugin.', 'us' ), '<strong><a href="' . admin_url( 'admin.php?page=us-addons' ) . '">WPBakery Page Builder</a></strong>' ); ?></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'admin_print_scripts', 'us_admin_addons_assets', 99 );
|
||||
function us_admin_addons_assets() {
|
||||
?>
|
||||
<script>
|
||||
jQuery(document).on('click', '.us-addons-notice .notice-dismiss', function(){
|
||||
var $notice = jQuery(this).closest('.us-addons-notice'),
|
||||
pluginAction = ($notice.hasClass('for-activating')) ? 'activate' : 'install';
|
||||
jQuery.ajax({
|
||||
url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
|
||||
data: {
|
||||
action: 'us_dismiss_addons_notice',
|
||||
pluginAction: pluginAction
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'wp_ajax_us_dismiss_addons_notice', 'us_dismiss_addons_notice' );
|
||||
function us_dismiss_addons_notice() {
|
||||
if ( $_GET['pluginAction'] == 'activate' ) {
|
||||
update_option( 'us_dismiss_addons_activate_notice', 1 );
|
||||
} elseif ( $_GET['pluginAction'] == 'install' ) {
|
||||
update_option( 'us_dismiss_addons_install_notice', 1 );
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'admin_menu', 'us_add_addons_page', 20 );
|
||||
function us_add_addons_page() {
|
||||
add_submenu_page( 'us-theme-options', US_THEMENAME . ': ' . __( 'Addons', 'us' ), __( 'Addons', 'us' ), 'manage_options', 'us-addons', 'us_addons_page', 11 );
|
||||
}
|
||||
|
||||
function us_addons_page() {
|
||||
$plugins = us_config( 'addons', array() );
|
||||
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
if ( isset( $plugins[ $i ]['premium'] ) AND ! isset( $plugins[ $i ]['source'] ) ) {
|
||||
$plugins = us_api_addons( $plugins, TRUE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$installed_plugins = get_plugins();
|
||||
global $us_template_directory_uri;
|
||||
$plugins_html = '';
|
||||
|
||||
foreach ( $plugins as $plugin ) {
|
||||
|
||||
$keys = array_keys( get_plugins() );
|
||||
|
||||
$plugin['file_path'] = $plugin['slug'];
|
||||
foreach ( $keys as $key ) {
|
||||
if ( preg_match( '|^' . $plugin['slug'] . '/|', $key ) ) {
|
||||
$plugin['file_path'] = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$classes = ' ' . $plugin['slug'];
|
||||
if ( ! isset( $plugin['premium'] ) ) {
|
||||
$classes .= ' is_free';
|
||||
} else {
|
||||
$classes .= ' is_premium';
|
||||
}
|
||||
$btn_classes = $btn_atts = $btn_text = $btn_url = '';
|
||||
|
||||
// Separate params for FREE and PREMIUM plugins
|
||||
if ( ! isset( $plugin['premium'] ) ) {
|
||||
$icon_file = isset( $plugin['icon_file'] ) ? $plugin['icon_file'] : 'png';
|
||||
$icon_url = 'https://ps.w.org/' . $plugin['slug'] . '/assets/icon-256x256.' . $icon_file;
|
||||
$plugin['url'] = 'https://wordpress.org/plugins/' . $plugin['slug'] . '/';
|
||||
} else {
|
||||
$icon_url = $us_template_directory_uri . '/framework/admin/img/' . $plugin['slug'] . '.png';
|
||||
}
|
||||
|
||||
if ( is_plugin_active( $plugin['file_path'] ) ) {
|
||||
$classes .= ' status_active';
|
||||
|
||||
} elseif ( ! isset( $installed_plugins[ $plugin['file_path'] ] ) ) {
|
||||
|
||||
if ( isset( $plugin['premium'] ) AND ! get_option( 'us_license_activated', 0 ) ) {
|
||||
$classes .= ' status_locked';
|
||||
} else {
|
||||
$classes .= ' status_notinstalled';
|
||||
$btn_text = us_translate( 'Install Now' );
|
||||
$btn_url = 'javascript:void(0);';
|
||||
$btn_classes .= ' color_primary action-button';
|
||||
$btn_atts = ' data-plugin="' . $plugin['slug'] . '" data-action="install"';
|
||||
}
|
||||
|
||||
} elseif ( is_plugin_inactive( $plugin['file_path'] ) ) {
|
||||
$classes .= ' status_notactive';
|
||||
$btn_text = us_translate( 'Activate Plugin' );
|
||||
$btn_url = 'javascript:void(0);';
|
||||
$btn_classes .= ' color_primary action-button';
|
||||
$btn_atts = ' data-plugin="' . $plugin['slug'] . '" data-action="activate"';
|
||||
}
|
||||
|
||||
ob_start();
|
||||
|
||||
?>
|
||||
<div class="us-addon<?php echo $classes; ?>">
|
||||
<div class="us-addon-content">
|
||||
<a href="<?php echo $plugin['url'] ?>" target="_blank">
|
||||
<img class="us-addon-icon" src="<?php echo $icon_url; ?>" alt="icon">
|
||||
<h2 class="us-addon-title"><?php echo $plugin['name'] ?></h2>
|
||||
</a>
|
||||
<p class="us-addon-desc"><?php echo $plugin['description']; ?></p>
|
||||
</div>
|
||||
<div class="us-addon-control">
|
||||
<div class="us-addon-status"><?php echo us_translate_x( 'Active', 'plugin' ); ?></div>
|
||||
<?php
|
||||
// Screenlock for premium plugins
|
||||
if ( isset( $plugin['premium'] ) AND ! get_option( 'us_license_activated', 0 ) ) {
|
||||
?>
|
||||
<div class="us-addon-lock">
|
||||
<div><?php echo sprintf( __( '<a href="%s">Activate the theme</a> to install premium addons', 'us' ), admin_url( 'admin.php?page=us-home#activation' ) ) ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
if ( $btn_text != '' AND $btn_url != '' ) {
|
||||
?>
|
||||
<a class="usof-button<?php echo $btn_classes; ?>" href="<?php echo $btn_url; ?>" <?php echo $btn_atts; ?>><span><?php echo $btn_text; ?></span></a>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$plugins_html .= ob_get_clean();
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="us-addons">
|
||||
<h1 class="us-admin-title"><?php echo __( 'Recommended Plugins', 'us' ); ?></h1>
|
||||
<p class="us-admin-subtitle"><?php echo sprintf( __( 'Premium and free plugins, compatible with %s', 'us' ), US_THEMENAME ) ?></p>
|
||||
<div class="us-addons-list"><?php echo $plugins_html ?></div>
|
||||
</div>
|
||||
<script>
|
||||
jQuery(function($){
|
||||
var isRunning = false;
|
||||
$('.action-button').click(function(){
|
||||
if (isRunning) return;
|
||||
isRunning = true;
|
||||
$('.us-addons-list').addClass('disable-buttons');
|
||||
var plugin = $(this).attr('data-plugin'),
|
||||
action = $(this).attr('data-action'),
|
||||
$tile = $(this).closest('.us-addon'),
|
||||
$status = $tile.find('.us-addon-status'),
|
||||
$button = $(this);
|
||||
|
||||
$tile.removeClass(function(index, css){
|
||||
return (css.match(/(^|\s)status_\S+/g) || []).join(' ');
|
||||
});
|
||||
if (action == 'install') {
|
||||
$tile.addClass('status_installing');
|
||||
$button.html('<i class="g-preloader type_1"></i><?php echo esc_js( us_translate( 'Installing...' ) ); ?>');
|
||||
} else {
|
||||
$tile.addClass('status_activating');
|
||||
$button.html('<i class="g-preloader type_1"></i><?php esc_js( _e( 'Activating...', 'us' ) ); ?>');
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
|
||||
data: {
|
||||
action: 'us_ajax_addons_' + action,
|
||||
plugin: plugin,
|
||||
security: '<?php echo wp_create_nonce( 'us-addons-actions' ); ?>'
|
||||
},
|
||||
success: function(data){
|
||||
isRunning = false;
|
||||
$('.us-addons-list').removeClass('disable-buttons');
|
||||
$button.hide();
|
||||
$tile.removeClass(function(index, css){
|
||||
return (css.match(/(^|\s)status_\S+/g) || []).join(' ');
|
||||
});
|
||||
if (data != undefined && data.success) {
|
||||
$tile.addClass('status_active');
|
||||
$status.html('<?php echo esc_js( us_translate_x( 'Active', 'plugin' ) ); ?>');
|
||||
} else {
|
||||
$tile.addClass('status_error');
|
||||
if (data != undefined && data.data != undefined && data.data.message != undefined) {
|
||||
$status.html(data.data.message);
|
||||
} else {
|
||||
$status.html('<?php echo esc_js( us_translate( 'An error has occurred. Please reload the page and try again.' ) ); ?>');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
add_action( 'wp_ajax_us_ajax_addons_install', 'us_ajax_addons_install' );
|
||||
add_action( 'wp_ajax_us_ajax_addons_activate', 'us_ajax_addons_activate' );
|
||||
|
||||
function us_ajax_addons_activate() {
|
||||
|
||||
if ( ! check_ajax_referer( 'us-addons-actions', 'security', FALSE ) ) {
|
||||
wp_send_json_error(
|
||||
array(
|
||||
'message' => us_translate( 'An error has occurred. Please reload the page and try again.' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! isset( $_POST['plugin'] ) OR ! $_POST['plugin'] ) {
|
||||
wp_send_json_error( array( 'message' => us_translate( 'An error has occurred. Please reload the page and try again.' ) ) );
|
||||
}
|
||||
|
||||
$result = us_activate_plugin();
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
wp_send_json_error( array( 'message' => $result->get_error_message() ) );
|
||||
}
|
||||
|
||||
wp_send_json_success( array( 'plugin' => $_POST['plugin'] ) );
|
||||
|
||||
}
|
||||
|
||||
function us_activate_plugin() {
|
||||
if ( empty( $_POST['plugin'] ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$plugins = us_config( 'addons', array() );
|
||||
|
||||
if ( empty( $plugins ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$_plugins = array();
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
$_plugins[ $plugin['slug'] ] = $plugin;
|
||||
}
|
||||
|
||||
$plugins = $_plugins;
|
||||
|
||||
$slug = urldecode( $_POST['plugin'] );
|
||||
|
||||
if ( ! isset( $plugins[ $slug ] ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$plugin = $plugins[ $slug ];
|
||||
|
||||
$plugin_data = get_plugins( '/' . $plugin['slug'] ); // Retrieve all plugins.
|
||||
$plugin_file = array_keys( $plugin_data ); // Retrieve all plugin files from installed plugins.
|
||||
|
||||
$plugin_to_activate = trailingslashit( $plugin['slug'] ) . $plugin_file[0]; // Match plugin slug with appropriate plugin file.
|
||||
ob_start();
|
||||
$activate = activate_plugin( $plugin_to_activate ); // Activate the plugin.
|
||||
ob_get_clean();
|
||||
|
||||
if ( is_wp_error( $activate ) ) {
|
||||
return $activate;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
function us_ajax_addons_install() {
|
||||
set_time_limit( 300 );
|
||||
|
||||
if ( ! check_ajax_referer( 'us-addons-actions', 'security', FALSE ) ) {
|
||||
wp_send_json_error(
|
||||
array(
|
||||
'message' => us_translate( 'An error has occurred. Please reload the page and try again.' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( ! isset( $_POST['plugin'] ) OR ! $_POST['plugin'] ) {
|
||||
wp_send_json_error( array( 'message' => us_translate( 'An error has occurred. Please reload the page and try again.' ) ) );
|
||||
}
|
||||
|
||||
$result = us_install_plugin();
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
wp_send_json_error( array( 'message' => $result->get_error_message() ) );
|
||||
}
|
||||
|
||||
wp_send_json_success( array( 'plugin' => $_POST['plugin'] ) );
|
||||
}
|
||||
|
||||
function us_install_plugin() {
|
||||
if ( empty( $_POST['plugin'] ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$plugins = us_config( 'addons', array() );
|
||||
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
if ( ! isset( $plugins[ $i ]['premium'] ) ) {
|
||||
// Define WordPress repository plugin URL based on slug
|
||||
$plugins[ $i ]['source'] = 'https://downloads.wordpress.org/plugin/' . $plugin['slug'] . '.latest-stable.zip';
|
||||
} elseif ( empty( $plugins[ $i ]['source'] ) ) {
|
||||
unset( $plugins[ $i ] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $plugins ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$_plugins = array();
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
$_plugins[ $plugin['slug'] ] = $plugin;
|
||||
}
|
||||
|
||||
$plugins = $_plugins;
|
||||
|
||||
$slug = urldecode( $_POST['plugin'] );
|
||||
|
||||
if ( ! isset( $plugins[ $slug ] ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$plugin = $plugins[ $slug ];
|
||||
|
||||
if ( file_exists( trailingslashit( WP_PLUGIN_DIR ) . $slug ) ) {
|
||||
return us_activate_plugin();
|
||||
}
|
||||
|
||||
if ( ! filesystem_permission_check() ) {
|
||||
return new WP_Error( 'us-addons', __( 'Please adjust file permissions to allow plugins installation', 'us' ) );
|
||||
}
|
||||
|
||||
$us_template_directory = get_template_directory();
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
|
||||
|
||||
$skin = new WP_Ajax_Upgrader_Skin();
|
||||
$upgrader = new Plugin_Upgrader( $skin );
|
||||
|
||||
$install_result = $upgrader->install( $plugin['source'] );
|
||||
|
||||
if ( is_wp_error( $install_result ) ) {
|
||||
return $install_result;
|
||||
}
|
||||
|
||||
if ( ! $install_result ) {
|
||||
return new WP_Error( 'plugin_error', us_translate( 'An error has occurred. Please reload the page and try again.' ) );
|
||||
}
|
||||
|
||||
ob_start();
|
||||
$activate = activate_plugin( $upgrader->plugin_info() );
|
||||
ob_get_clean();
|
||||
if ( is_wp_error( $activate ) ) {
|
||||
return $activate;
|
||||
}
|
||||
|
||||
return $skin->result;
|
||||
}
|
||||
|
||||
function filesystem_permission_check() {
|
||||
ob_start();
|
||||
$creds = request_filesystem_credentials( '', '', FALSE, FALSE, NULL );
|
||||
ob_get_clean();
|
||||
|
||||
// Abort if permissions were not available.
|
||||
if ( ! WP_Filesystem( $creds ) ) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
// Actions after theme activation
|
||||
add_action( 'admin_init', 'us_theme_activation', 99 );
|
||||
function us_theme_activation() {
|
||||
global $pagenow;
|
||||
if ( is_admin() AND $pagenow == 'themes.php' AND isset( $_GET['activated'] ) ) {
|
||||
// Set menu
|
||||
$user = wp_get_current_user();
|
||||
update_user_option( $user->ID, US_THEMENAME . '_cpt_in_menu_set', FALSE, TRUE );
|
||||
|
||||
// Add Default Footer post type if needed
|
||||
us_add_default_footer();
|
||||
|
||||
// Redirect to About the Theme page
|
||||
header( 'Location: ' . admin_url( 'admin.php?page=us-home' ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Show indication for beta versions
|
||||
if ( is_user_logged_in() AND defined( 'US_THEME_BETA' ) ) {
|
||||
add_action( 'admin_bar_menu', 'us_beta_admin_bar_menu', 1000 );
|
||||
}
|
||||
function us_beta_admin_bar_menu( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_node(
|
||||
array(
|
||||
'id' => 'us-beta',
|
||||
'title' => US_THEMENAME . ' BETA',
|
||||
'meta' => array(
|
||||
'html' => '<style>#wp-admin-bar-us-beta>*{background:#e95095!important;color:#fff!important;}</style>',
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Hide some our metaboxes on Menus admin page
|
||||
add_action( 'admin_head', 'us_include_cpt_to_menu', 99 );
|
||||
function us_include_cpt_to_menu() {
|
||||
global $pagenow;
|
||||
if ( is_admin() AND $pagenow == 'nav-menus.php' ) {
|
||||
$already_set = get_user_option( US_THEMENAME . '_cpt_in_menu_set' );
|
||||
|
||||
if ( ! $already_set ) {
|
||||
$hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus' );
|
||||
|
||||
if ( ! is_array( $hidden_meta_boxes ) ) {
|
||||
$hidden_meta_boxes = array();
|
||||
}
|
||||
|
||||
if ( $hidden_meta_boxes !== FALSE ) {
|
||||
if ( ( $key = array_search( 'add-post-type-us_portfolio', $hidden_meta_boxes ) ) !== FALSE AND isset( $hidden_meta_boxes[$key] ) ) {
|
||||
unset( $hidden_meta_boxes[$key] );
|
||||
}
|
||||
if ( ( $key = array_search( 'add-us_portfolio_category', $hidden_meta_boxes ) ) === FALSE ) {
|
||||
$hidden_meta_boxes[] = 'add-us_portfolio_category';
|
||||
}
|
||||
if ( ( $key = array_search( 'add-us_portfolio_tag', $hidden_meta_boxes ) ) === FALSE ) {
|
||||
$hidden_meta_boxes[] = 'add-us_portfolio_tag';
|
||||
}
|
||||
if ( ( $key = array_search( 'add-post-type-us_widget_area', $hidden_meta_boxes ) ) !== FALSE AND isset( $hidden_meta_boxes[$key] ) ) {
|
||||
unset( $hidden_meta_boxes[$key] );
|
||||
}
|
||||
|
||||
$user = wp_get_current_user();
|
||||
update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, TRUE );
|
||||
update_user_option( $user->ID, US_THEMENAME . '_cpt_in_menu_set', TRUE, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Custom CSS for all admin pages
|
||||
add_action( 'admin_print_scripts', 'us_enqueue_admin_css', 12 );
|
||||
function us_enqueue_admin_css() {
|
||||
global $us_template_directory_uri;
|
||||
wp_enqueue_style( 'us-theme-admin', $us_template_directory_uri . '/framework/admin/css/theme-admin.css', array(), US_THEMEVERSION );
|
||||
wp_enqueue_style( 'us-font-awesome', $us_template_directory_uri . '/css/base/fontawesome.css', array(), US_THEMEVERSION );
|
||||
}
|
||||
|
||||
// Custom CSS for visual editor
|
||||
add_action( 'admin_init', 'us_theme_add_editor_styles' );
|
||||
function us_theme_add_editor_styles() {
|
||||
add_editor_style( 'framework/admin/css/editor-style.css' );
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
add_filter( 'usof_container_classes', 'usgb_usof_container_classes' );
|
||||
function usgb_usof_container_classes( $classes ) {
|
||||
return $classes . ' with_gb';
|
||||
}
|
||||
|
||||
add_action( 'init', 'usgb_create_post_types', 7 );
|
||||
function usgb_create_post_types() {
|
||||
|
||||
// Grid Layout post type
|
||||
register_post_type(
|
||||
'us_grid_layout', array(
|
||||
'labels' => array(
|
||||
'name' => __( 'Grid Layouts', 'us' ),
|
||||
'singular_name' => __( 'Grid Layout', 'us' ),
|
||||
'add_new' => __( 'Add Grid Layout', 'us' ),
|
||||
'add_new_item' => __( 'Add Grid Layout', 'us' ),
|
||||
),
|
||||
'public' => TRUE,
|
||||
'show_in_menu' => 'us-theme-options',
|
||||
'exclude_from_search' => TRUE,
|
||||
'show_in_admin_bar' => FALSE,
|
||||
'publicly_queryable' => FALSE,
|
||||
'show_in_nav_menus' => FALSE,
|
||||
'capability_type' => array( 'us_page_block', 'us_page_blocks' ),
|
||||
'map_meta_cap' => TRUE,
|
||||
'supports' => FALSE,
|
||||
'rewrite' => FALSE,
|
||||
'register_meta_box_cb' => 'usgb_us_grid_type_pages',
|
||||
)
|
||||
);
|
||||
|
||||
// Add "Used in" column into Grid Layouts admin page
|
||||
add_filter( 'manage_us_grid_layout_posts_columns', 'ushb_us_grid_layout_columns_head' );
|
||||
add_action( 'manage_us_grid_layout_posts_custom_column', 'ushb_us_grid_layout_columns_content', 10, 2 );
|
||||
function ushb_us_grid_layout_columns_head( $defaults ) {
|
||||
$result = array();
|
||||
foreach ( $defaults as $key => $title ) {
|
||||
if ( $key == 'date' ) {
|
||||
$result['used_in'] = __( 'Used in', 'us' );
|
||||
}
|
||||
$result[$key] = $title;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
function ushb_us_grid_layout_columns_content( $column_name, $post_ID ) {
|
||||
if ( $column_name == 'used_in' ) {
|
||||
echo us_get_used_in_locations( $post_ID );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function usgb_us_grid_type_pages() {
|
||||
global $post;
|
||||
// Dev note: This check is not necessary, but still wanted to make sure this function won't be bound somewhere else
|
||||
if ( ! ( $post instanceof WP_Post ) OR $post->post_type !== 'us_grid_layout' ) {
|
||||
return;
|
||||
}
|
||||
if ( $post->post_status === 'auto-draft' ) {
|
||||
// Page for creating new grid: creating it instantly and proceeding to editing
|
||||
$post_data = array( 'ID' => $post->ID );
|
||||
// Retrieving occupied names to generate new post title properly
|
||||
$existing_grids = usgb_get_existing_grids();
|
||||
if ( isset( $_GET['duplicate_from'] ) AND ( $original_post = get_post( (int) $_GET['duplicate_from'] ) ) !== NULL ) {
|
||||
// Handling post duplication
|
||||
$post_data['post_content'] = $original_post->post_content;
|
||||
$title_pattern = $original_post->post_title . ' (%d)';
|
||||
$cur_index = 2;
|
||||
} else {
|
||||
// Handling creation from scratch
|
||||
$title_pattern = __( 'Layout', 'us' ) . ' %d';
|
||||
$cur_index = count( $existing_grids ) + 1;
|
||||
}
|
||||
// Generating new post title
|
||||
while ( in_array( $post_data['post_title'] = sprintf( $title_pattern, $cur_index ), $existing_grids ) ) {
|
||||
$cur_index ++;
|
||||
}
|
||||
wp_update_post( $post_data );
|
||||
wp_publish_post( $post->ID );
|
||||
// Redirect
|
||||
if ( isset( $_GET['duplicate_from'] ) ) {
|
||||
// When duplicating post, showing posts list next
|
||||
wp_redirect( admin_url( 'edit.php?post_type=us_grid_layout' ) );
|
||||
} else {
|
||||
// When creating from scratch proceeding to post editing next
|
||||
wp_redirect( admin_url( 'post.php?post=' . $post->ID . '&action=edit' ) );
|
||||
}
|
||||
} else {
|
||||
// Page for editing a grid
|
||||
add_action( 'admin_enqueue_scripts', 'usgb_enqueue_scripts' );
|
||||
add_action( 'edit_form_top', 'usgb_edit_form_top' );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available grids
|
||||
* @return array
|
||||
*/
|
||||
function usgb_get_existing_grids() {
|
||||
$result = array();
|
||||
$grids = get_posts(
|
||||
array(
|
||||
'post_type' => 'us_grid_layout',
|
||||
'posts_per_page' => - 1,
|
||||
'post_status' => 'any',
|
||||
'suppress_filters' => 0,
|
||||
)
|
||||
);
|
||||
foreach ( $grids as $grid ) {
|
||||
$result[$grid->ID] = $grid->post_title;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function usgb_enqueue_scripts() {
|
||||
// Appending dependencies
|
||||
usof_print_styles();
|
||||
usof_print_scripts();
|
||||
|
||||
// Appending required assets
|
||||
global $us_template_directory_uri;
|
||||
wp_enqueue_script( 'us-grid-builder', $us_template_directory_uri . '/framework/admin/js/grid-builder.js', array( 'usof-scripts' ), TRUE );
|
||||
|
||||
// Disabling WP auto-save
|
||||
wp_dequeue_script( 'autosave' );
|
||||
}
|
||||
|
||||
function usgb_edit_form_top( $post ) {
|
||||
echo '<div class="usof-container type_builder" data-ajaxurl="' . esc_attr( admin_url( 'admin-ajax.php' ) ) . '" data-id="' . esc_attr( $post->ID ) . '">';
|
||||
echo '<form class="usof-form" method="post" action="#" autocomplete="off">';
|
||||
// Output _nonce and _wp_http_referer hidden fields for ajax secuirity checks
|
||||
wp_nonce_field( 'usgb-update' );
|
||||
echo '<div class="usof-header">';
|
||||
echo '<div class="usof-header-title">' . __( 'Grid Layout', 'us' ) . '</div>';
|
||||
|
||||
us_load_template(
|
||||
'vendor/usof/templates/field', array(
|
||||
'name' => 'post_title',
|
||||
'id' => 'usof_header_title',
|
||||
'field' => array(
|
||||
'type' => 'text',
|
||||
'placeholder' => __( 'Grid Layout Name', 'us' ),
|
||||
'classes' => 'desc_0', // Reset desc position of global GB field
|
||||
),
|
||||
'values' => array(
|
||||
'post_title' => $post->post_title,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
echo '<div class="usof-control for_help"><a href="https://help.us-themes.com/' . strtolower( US_THEMENAME ) . '/grid/" target="_blank" title="' . us_translate( 'Help' ) . '"></a></div>';
|
||||
echo '<div class="usof-control for_import"><a href="#" title="' . __( 'Export / Import', 'us' ) . '"></a></div>';
|
||||
echo '<div class="usof-control for_templates">';
|
||||
echo '<a href="#" title="' . __( 'Grid Layout Templates', 'us' ) . '"></a>';
|
||||
echo '<div class="usof-control-desc"><span>' . __( 'Choose Grid Layout Template to start with', 'us' ) . '</span></div>';
|
||||
echo '</div>';
|
||||
echo '<div class="usof-control for_save status_clear">';
|
||||
echo '<button class="usof-button type_save" type="button"><span>' . us_translate( 'Save Changes' ) . '</span>';
|
||||
echo '<span class="usof-preloader"></span></button>';
|
||||
echo '<div class="usof-control-message"></div></div></div>';
|
||||
|
||||
us_load_template(
|
||||
'vendor/usof/templates/field', array(
|
||||
'name' => 'post_content',
|
||||
'id' => 'usof_header',
|
||||
'field' => array(
|
||||
'type' => 'grid_builder',
|
||||
'classes' => 'desc_0', // Reset desc position of global GB field
|
||||
),
|
||||
'values' => array(
|
||||
'post_content' => $post->post_content,
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
// Add "Duplicate" link for Grid Layouts admin page
|
||||
add_filter( 'post_row_actions', 'usgb_post_row_actions', 10, 2 );
|
||||
function usgb_post_row_actions( $actions, $post ) {
|
||||
if ( $post->post_type === 'us_grid_layout' ) {
|
||||
// Removing duplicate post plugin affection
|
||||
unset( $actions['duplicate'], $actions['edit_as_new_draft'] );
|
||||
$actions = us_array_merge_insert(
|
||||
$actions, array(
|
||||
'duplicate' => '<a href="' . admin_url( 'post-new.php?post_type=us_grid_layout&duplicate_from=' . $post->ID ) . '" aria-label="' . esc_attr__( 'Duplicate', 'us' ) . '">' . esc_html__( 'Duplicate', 'us' ) . '</a>',
|
||||
), 'before', isset( $actions['trash'] ) ? 'trash' : 'untrash'
|
||||
);
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Theme updater for activated licenses
|
||||
*/
|
||||
|
||||
$license_activated = get_option( 'us_license_activated', 0 );
|
||||
$license_secret = get_option( 'us_license_secret' );
|
||||
|
||||
if ( $license_activated AND $license_secret != '' ) {
|
||||
function us_api_themes_update( $updates ) {
|
||||
|
||||
$updates = us_check_theme_updates( $updates );
|
||||
|
||||
return $updates;
|
||||
}
|
||||
|
||||
add_filter( "pre_set_site_transient_update_themes", "us_api_themes_update" );
|
||||
} else {
|
||||
function us_api_themes_update_deactivated( $updates ) {
|
||||
|
||||
$updates = us_check_theme_updates_deactivated( $updates );
|
||||
|
||||
return $updates;
|
||||
}
|
||||
|
||||
add_filter( "pre_set_site_transient_update_themes", "us_api_themes_update_deactivated" );
|
||||
}
|
||||
|
||||
function us_check_theme_updates_deactivated( $updates ) {
|
||||
$result = us_api_get_themes_deactivated();
|
||||
|
||||
if ( ! empty( $result->data->new_version ) ) {
|
||||
|
||||
$installed = wp_get_themes();
|
||||
$filtered = array();
|
||||
foreach ( $installed as $theme ) {
|
||||
$filtered[$theme->Name] = $theme;
|
||||
}
|
||||
|
||||
if ( isset( $filtered[US_THEMENAME] ) ) {
|
||||
$current = $filtered[US_THEMENAME];
|
||||
|
||||
if ( version_compare( $current->Version, $result->data->new_version, '<' ) ) {
|
||||
$update = array(
|
||||
"url" => $result->data->url,
|
||||
"new_version" => $result->data->new_version,
|
||||
"package" => NULL,
|
||||
);
|
||||
|
||||
$updates->response[US_THEMENAME] = $update;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $updates;
|
||||
}
|
||||
|
||||
function us_api_get_themes_deactivated( $timeout = 1800 ) {
|
||||
|
||||
$urlparts = parse_url( site_url() );
|
||||
|
||||
$url = "https://help.us-themes.com/us.api/check_update/" . strtolower( US_THEMENAME ) . "?current_version=" . urlencode( US_THEMEVERSION );
|
||||
$transient = 'us_update_theme_data_deactivated_' . US_THEMENAME;
|
||||
|
||||
/* create the cache and allow filtering before it's saved */
|
||||
if ( $results = us_api_remote_request( $url ) ) {
|
||||
set_transient( $transient, $results, $timeout );
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
|
||||
function us_check_theme_updates( $updates ) {
|
||||
$license_secret = get_option( 'us_license_secret' );
|
||||
|
||||
$result = us_api_get_themes( $license_secret );
|
||||
|
||||
if ( ! empty( $result->data->new_version ) ) {
|
||||
|
||||
$installed = wp_get_themes();
|
||||
$filtered = array();
|
||||
foreach ( $installed as $theme ) {
|
||||
$filtered[$theme->Name] = $theme;
|
||||
}
|
||||
|
||||
if ( isset( $filtered[US_THEMENAME] ) ) {
|
||||
$current = $filtered[US_THEMENAME];
|
||||
|
||||
if ( version_compare( $current->Version, $result->data->new_version, '<' ) ) {
|
||||
$update = array(
|
||||
"url" => $result->data->url,
|
||||
"new_version" => $result->data->new_version,
|
||||
"package" => $result->data->package,
|
||||
);
|
||||
|
||||
$updates->response[US_THEMENAME] = $update;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $updates;
|
||||
}
|
||||
|
||||
function us_api_get_themes( $license_secret, $timeout = 1800 ) {
|
||||
|
||||
$urlparts = parse_url( site_url() );
|
||||
$domain = $urlparts['host'];
|
||||
|
||||
$url = "https://help.us-themes.com/us.api/check_update/" . strtolower( US_THEMENAME ) . "?secret=" . urlencode( $license_secret ) . "&domain=" . urlencode( $domain ) . "¤t_version=" . urlencode( US_THEMEVERSION );
|
||||
$transient = 'us_update_theme_data_' . US_THEMENAME;
|
||||
|
||||
if ( FALSE !== $results = get_transient( $transient ) ) {
|
||||
return $results;
|
||||
}
|
||||
|
||||
/* create the cache and allow filtering before it's saved */
|
||||
if ( $results = us_api_remote_request( $url ) ) {
|
||||
set_transient( $transient, $results, $timeout );
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'sanitize_key', 'us_sanitize_key_themename', 10, 2 );
|
||||
function us_sanitize_key_themename( $key, $raw_key ) {
|
||||
if ( in_array( $raw_key, array( 'Impreza', 'Zephyr' ) ) ) {
|
||||
$key = $raw_key;
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
add_action( '_network_admin_menu', 'us_add_theme_update_notice_to_menu' );
|
||||
add_action( '_user_admin_menu', 'us_add_theme_update_notice_to_menu' );
|
||||
add_action( '_admin_menu', 'us_add_theme_update_notice_to_menu' );
|
||||
function us_add_theme_update_notice_to_menu(){
|
||||
global $menu;
|
||||
|
||||
if ( isset($menu[60]) AND isset($menu[60][2]) AND $menu[60][2] == 'themes.php' ) {
|
||||
$update_notification = '';
|
||||
$update_themes = get_site_transient( 'update_themes' );
|
||||
if ( ! empty( $update_themes->response ) AND isset( $update_themes->response[US_THEMENAME] ) ) {
|
||||
$update_notification = ' <span class="update-plugins count-1"><span class="plugin-count">1</span></span>';
|
||||
}
|
||||
$menu[60][0] = us_translate( 'Appearance' ) . $update_notification;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
add_filter( 'wp_prepare_themes_for_js', 'us_wp_prepare_themes_for_js' );
|
||||
function us_wp_prepare_themes_for_js( $themes ) {
|
||||
if ( ! empty( $themes ) ) {
|
||||
foreach ( $themes as $slug => $theme_args ) {
|
||||
if ( $slug == US_THEMENAME AND $theme_args['hasUpdate'] AND ( ! $theme_args['hasPackage'] ) ) {
|
||||
$themes[$slug]['update'] = $theme_args['update'] .
|
||||
'<p><strong>' . sprintf( __( '%sActivate the theme%s to update it', 'us' ), '<a href="' . admin_url( 'admin.php?page=us-home#activation' ) . '">', '</a>' ) . '.</strong></p>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $themes;
|
||||
}
|
||||
|
||||
add_filter( 'site_transient_update_themes', 'us_site_transient_update_themes' );
|
||||
function us_site_transient_update_themes( $current ) {
|
||||
global $pagenow;
|
||||
if ( ! empty( $pagenow ) AND $pagenow == 'update-core.php' ) {
|
||||
if ( ! empty( $current->response ) ) {
|
||||
foreach ( $current->response as $stylesheet => $data ) {
|
||||
if ( $stylesheet == US_THEMENAME AND empty( $data['package'] ) ) {
|
||||
$current->response[$stylesheet]['new_version'] .= '.<br>' . sprintf( __( '%sActivate the theme%s to update it', 'us' ), '<a href="' . admin_url( 'admin.php?page=us-home#activation' ) . '">', '</a>' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $current;
|
||||
}
|
||||
|
||||
add_action( 'upgrader_process_complete', 'us_upgrader_process_complete', 10, 2 );
|
||||
function us_upgrader_process_complete( $upgrader, $atts ) {
|
||||
if ( $atts['action'] == 'update' AND $atts['type'] == 'theme' AND $atts['bulk'] == 1) {
|
||||
if ( ! empty( $atts['themes'] ) ) {
|
||||
foreach ( $atts['themes'] as $theme ) {
|
||||
if ( $theme == US_THEMENAME AND get_option( 'us_license_activated', 0 ) != 1 ) {
|
||||
echo '<div class="error"><p>' . sprintf( __( '%sActivate the theme%s to update it', 'us' ), '<a target="_top" href="' . admin_url( 'admin.php?page=us-home#activation' ) . '">', '</a>' ) . '</p></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Updater of the plugins from UpSolution Help Portal
|
||||
*/
|
||||
|
||||
add_filter( 'us_config_addons', 'us_api_addons' );
|
||||
|
||||
function us_api_addons( $plugins, $force_request = FALSE ) {
|
||||
|
||||
$license_activated = get_option( 'us_license_activated', 0 );
|
||||
$license_secret = get_option( 'us_license_secret' );
|
||||
$addons_version = get_option( 'us_addons_version' );
|
||||
|
||||
if ( $license_activated AND $license_secret != '' ) {
|
||||
|
||||
$urlparts = parse_url( site_url() );
|
||||
$domain = $urlparts['host'];
|
||||
|
||||
$url = "https://help.us-themes.com/us.api/check_addons_update/" . strtolower( US_THEMENAME ) . "?secret=" . urlencode( $license_secret ) . "&domain=" . urlencode( $domain ) . "¤t_version=" . urlencode( US_THEMEVERSION );
|
||||
$transient = 'us_update_addons_data_' . US_THEMENAME;
|
||||
|
||||
if ( ( ! empty( $addons_version ) AND $addons_version == US_THEMEVERSION ) AND FALSE !== $results = get_transient( $transient ) ) {
|
||||
$update_addons_data = $results;
|
||||
}
|
||||
|
||||
if ( ( empty( $update_addons_data ) OR $force_request ) AND $results = us_api_remote_request( $url ) ) {
|
||||
set_transient( $transient, $results, 1800 );
|
||||
$update_addons_data = $results;
|
||||
update_option( 'us_addons_version', US_THEMEVERSION );
|
||||
}
|
||||
|
||||
if ( ! empty( $update_addons_data->data ) ) {
|
||||
foreach ( $plugins as $i => $plugin ) {
|
||||
$slug = $plugin['slug'];
|
||||
if ( isset( $update_addons_data->data->$slug ) ) {
|
||||
$plugins[$i]['version'] = $update_addons_data->data->$slug->new_version;
|
||||
$plugins[$i]['source'] = $update_addons_data->data->$slug->package;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $plugins;
|
||||
}
|
||||
|
||||
$addons = us_config( 'addons', array() );
|
||||
|
||||
foreach ( $addons as $i => $addon ) {
|
||||
if ( empty( $addons[$i]['version'] ) OR empty( $addons[$i]['source'] ) ) {
|
||||
unset( $addons[$i] );
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $addons ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transient hook for automatical updates of bundled plugins
|
||||
add_action( 'site_transient_update_plugins', 'us_addons_transient_update' );
|
||||
function us_addons_transient_update( $trans ) {
|
||||
|
||||
$installed_plugins = get_plugins();
|
||||
|
||||
$addons = us_config( 'addons', array() );
|
||||
|
||||
foreach ( $addons as $i => $addon ) {
|
||||
if ( empty( $addons[$i]['version'] ) OR empty( $addons[$i]['source'] ) ) {
|
||||
unset( $addons[$i] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $addons as $addon ) {
|
||||
$plugin_basename = sprintf( '%s/%s.php', $addon['slug'], $addon['slug'] );
|
||||
|
||||
if ( ! isset( $installed_plugins[$plugin_basename] ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( version_compare( $installed_plugins[$plugin_basename]['Version'], $addon['version'], '<' ) ) {
|
||||
$trans->response[$plugin_basename] = new StdClass();
|
||||
$trans->response[$plugin_basename]->plugin = $plugin_basename;
|
||||
$trans->response[$plugin_basename]->url = $addon['changelog_url'];
|
||||
$trans->response[$plugin_basename]->slug = $addon['slug'];
|
||||
$trans->response[$plugin_basename]->package = $addon['source'];
|
||||
$trans->response[$plugin_basename]->new_version = $addon['version'];
|
||||
$trans->response[$plugin_basename]->id = '0';
|
||||
}
|
||||
}
|
||||
|
||||
return $trans;
|
||||
}
|
||||
|
||||
// Seen when user clicks "view details" on the plugin listing page
|
||||
add_action( 'install_plugins_pre_plugin-information', 'us_addons_update_popup' );
|
||||
function us_addons_update_popup() {
|
||||
|
||||
if ( ! isset( $_GET['plugin'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$plugin_slug = sanitize_file_name( $_GET['plugin'] );
|
||||
|
||||
$addons = us_config( 'addons', array() );
|
||||
|
||||
foreach ( $addons as $i => $addon ) {
|
||||
if ( empty( $addons[$i]['version'] ) OR empty( $addons[$i]['source'] ) ) {
|
||||
unset( $addons[$i] );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $addons as $addon ) {
|
||||
if ( $addon['slug'] == $plugin_slug ) {
|
||||
$changelog_url = $addon['changelog_url'];
|
||||
|
||||
echo '<html><body style="height: 90%; background: #fcfcfc"><p>See the <a href="' . $changelog_url . '" ' . 'target="_blank">' . $changelog_url . '</a> for the detailed changelog</p></body></html>';
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_action( 'admin_head', 'us_remove_bsf_update_counter' );
|
||||
function us_remove_bsf_update_counter() {
|
||||
remove_action( 'admin_head', 'bsf_update_counter', 999 );
|
||||
}
|
||||
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 579 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 745 B |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 777 B |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 850 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 742 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 980 B |
|
After Width: | Height: | Size: 971 B |
|
After Width: | Height: | Size: 979 B |
|
After Width: | Height: | Size: 508 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 525 B |
|
After Width: | Height: | Size: 466 B |
|
After Width: | Height: | Size: 272 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 786 B |
|
After Width: | Height: | Size: 962 B |
|
After Width: | Height: | Size: 539 B |
@@ -0,0 +1,84 @@
|
||||
window.wp = window.wp || {};
|
||||
|
||||
( function( $ ) {
|
||||
|
||||
var media = wp.media,
|
||||
curAttachmentsBrowser = media.view.AttachmentsBrowser;
|
||||
|
||||
media.view.AttachmentFilters.Taxonomy = media.view.AttachmentFilters.extend( {
|
||||
tagName: 'select',
|
||||
createFilters: function() {
|
||||
var filters = {},
|
||||
that = this;
|
||||
|
||||
_.each( that.options.termList || {}, function( term, key ) {
|
||||
var term_id = term[ 'term_id' ],
|
||||
term_name = $( '<div/>' ).html( term[ 'term_name' ] ).text();
|
||||
|
||||
filters[ term_id ] = {
|
||||
text: term_name,
|
||||
priority: key + 2
|
||||
};
|
||||
|
||||
filters[ term_id ][ 'props' ] = {};
|
||||
filters[ term_id ][ 'props' ][ that.options.taxonomy ] = term_id;
|
||||
} );
|
||||
|
||||
filters.all = {
|
||||
text: that.options.termListTitle,
|
||||
priority: 1
|
||||
};
|
||||
|
||||
filters[ 'all' ][ 'props' ] = {};
|
||||
filters[ 'all' ][ 'props' ][ that.options.taxonomy ] = null;
|
||||
|
||||
this.filters = filters;
|
||||
}
|
||||
} );
|
||||
|
||||
media.view.AttachmentsBrowser = media.view.AttachmentsBrowser.extend( {
|
||||
createToolbar: function() {
|
||||
var that = this,
|
||||
i = 1,
|
||||
filters = that.options.filters;
|
||||
|
||||
curAttachmentsBrowser.prototype.createToolbar.apply( this, arguments );
|
||||
|
||||
$.each( us_media_categories_taxonomies, function( taxonomy, values ) {
|
||||
if ( values.term_list && filters ) {
|
||||
that.toolbar.set( taxonomy + '-filter', new media.view.AttachmentFilters.Taxonomy( {
|
||||
controller: that.controller,
|
||||
model: that.collection.props,
|
||||
priority: - 80 + 10 * i ++,
|
||||
taxonomy: taxonomy,
|
||||
termList: values.term_list,
|
||||
termListTitle: values.list_title,
|
||||
className: 'attachment-taxonomy-filters'
|
||||
} ).render() );
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
// Relocate the new dropdown
|
||||
// $( document ).ready( function() {
|
||||
// $( '.media-toolbar.wp-filter .delete-selected-button' ).before( $('.media-toolbar.wp-filter
|
||||
// .select-mode-toggle-button' ) ); } );
|
||||
|
||||
|
||||
$.extend( wp.Uploader.prototype, {
|
||||
success: function( file_attachment ) {
|
||||
var category = $( ".attachment-taxonomy-filters" ).val();
|
||||
var data = {
|
||||
action: 'us_ajax_set_category_on_upload',
|
||||
post_id: file_attachment.attributes.id,
|
||||
category: category,
|
||||
};
|
||||
|
||||
jQuery.post( ajaxurl, data, function( response ) {
|
||||
|
||||
} );
|
||||
|
||||
}
|
||||
} );
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,78 @@
|
||||
// TODO adjust to match code standards
|
||||
( function( $ ) {
|
||||
var USSidebar = function() {
|
||||
|
||||
this.widget = $( '.widget-liquid-right' );
|
||||
this.widgetsRight = $( '#widgets-right' );
|
||||
this.addWidgetAreaForm = $( '#us_add_widget_area' );
|
||||
|
||||
this.initForm();
|
||||
this.initCustomWidgets();
|
||||
this.bindEvents();
|
||||
|
||||
};
|
||||
|
||||
USSidebar.prototype = {
|
||||
|
||||
initForm: function() {
|
||||
this.widget.append( this.addWidgetAreaForm.html() );
|
||||
this.nonce = this.widget.find( 'input[name="us_delete_widget_area_nonce"]' ).val();
|
||||
this.confirmMessage = this.widget.find( '#us_confirm_widget_area_deletion' ).html();
|
||||
},
|
||||
|
||||
initCustomWidgets: function() {
|
||||
this.widgetsRight.find( '.sidebar-us-custom-area' ).append( '<span class="us-custom-area-delete"></span>' );
|
||||
},
|
||||
|
||||
bindEvents: function() {
|
||||
this.widget.on( 'click', '.us-custom-area-delete', $.proxy( this.deleteWidgetArea, this ) );
|
||||
},
|
||||
|
||||
|
||||
//delete the sidebar area with all widgets within, then re calculate the other sidebar ids and re save the order
|
||||
deleteWidgetArea: function( e ) {
|
||||
var deleteIt = confirm( this.confirmMessage );
|
||||
|
||||
if ( deleteIt == false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var widget = $( e.currentTarget ).parents( '.widgets-holder-wrap:eq(0)' ),
|
||||
title = widget.find( '.sidebar-name h3 , .sidebar-name h2' ),
|
||||
spinner = title.find( '.spinner' ),
|
||||
widgetName = $.trim( title.text() ),
|
||||
obj = this;
|
||||
|
||||
$.ajax( {
|
||||
type: "POST",
|
||||
url: window.ajaxurl,
|
||||
data: {
|
||||
action: 'us_delete_custom_widget_area',
|
||||
name: widgetName,
|
||||
_wpnonce: obj.nonce
|
||||
},
|
||||
|
||||
beforeSend: function() {
|
||||
spinner.addClass( 'activate_spinner' );
|
||||
},
|
||||
success: function( response ) {
|
||||
if ( response == 'success' ) {
|
||||
widget.slideUp( 200, function() {
|
||||
|
||||
$( '.widget-control-remove', widget ).trigger( 'click' ); //delete all widgets inside
|
||||
widget.remove();
|
||||
|
||||
} );
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$( function() {
|
||||
new USSidebar();
|
||||
} );
|
||||
|
||||
|
||||
} )( jQuery );
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Addons configuration
|
||||
*
|
||||
* @filter us_config_addons
|
||||
*/
|
||||
|
||||
return array(
|
||||
array(
|
||||
'name' => 'WPBakery Page Builder',
|
||||
'slug' => 'js_composer',
|
||||
'description' => __( 'Save time working on your website content.', 'us' ),
|
||||
'premium' => TRUE,
|
||||
// for NOT free plugins we need to provide "url" and "changelog url"
|
||||
'changelog_url' => 'https://kb.wpbakery.com/docs/preface/release-notes/',
|
||||
'url' => 'https://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431',
|
||||
),
|
||||
array(
|
||||
'name' => 'Header Builder',
|
||||
'slug' => 'us-header-builder',
|
||||
'description' => __( 'Create custom website headers layouts with any elements.', 'us' ),
|
||||
'premium' => TRUE,
|
||||
'changelog_url' => 'https://help.us-themes.com/' . strtolower( US_THEMENAME ) . '/changelog/',
|
||||
'url' => 'https://help.us-themes.com/' . strtolower( US_THEMENAME ) . '/hb/',
|
||||
),
|
||||
array(
|
||||
'name' => 'Slider Revolution',
|
||||
'slug' => 'revslider',
|
||||
'description' => __( 'Create interactive sliders and presentations.', 'us' ),
|
||||
'premium' => TRUE,
|
||||
'changelog_url' => 'http://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380',
|
||||
'url' => 'https://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380',
|
||||
),
|
||||
array(
|
||||
'name' => 'WooCommerce',
|
||||
'slug' => 'woocommerce',
|
||||
'description' => __( 'Most popular eCommerce plugin that allows you to sell anything.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'Custom Post Type UI',
|
||||
'slug' => 'custom-post-type-ui',
|
||||
'description' => __( 'Create and manage custom post types and taxonomies.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'Advanced Custom Fields',
|
||||
'slug' => 'advanced-custom-fields',
|
||||
'description' => __( 'Add fields to edit screens and display their values on website pages.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'TablePress',
|
||||
'slug' => 'tablepress',
|
||||
'description' => __( 'Create and manage tables.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'Contact Form 7',
|
||||
'slug' => 'contact-form-7',
|
||||
'description' => __( 'Create customizable contact forms and edit the mail contents.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'Yoast SEO',
|
||||
'slug' => 'wordpress-seo',
|
||||
'description' => __( 'Improve your website search engine optimization.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'Smush Image Compression and Optimization',
|
||||
'slug' => 'wp-smushit',
|
||||
'description' => __( 'Resize, optimize and compress all of your images.', 'us' ),
|
||||
'icon_file' => 'jpg', // in case when PNG icon doesn't exist
|
||||
),
|
||||
array(
|
||||
'name' => 'WP Super Cache',
|
||||
'slug' => 'wp-super-cache',
|
||||
'description' => __( 'Improve your website pages loading speed.', 'us' ),
|
||||
),
|
||||
array(
|
||||
'name' => 'UpdraftPlus Backup',
|
||||
'slug' => 'updraftplus',
|
||||
'description' => __( 'Backup your website files and database.', 'us' ),
|
||||
'icon_file' => 'jpg', // in case when PNG icon doesn't exist
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,292 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
/**
|
||||
* Assets configuration (JS and CSS components)
|
||||
*
|
||||
* @filter us_config_assets
|
||||
*/
|
||||
|
||||
return array(
|
||||
|
||||
// Base Components
|
||||
'lazy-load' => array(
|
||||
'title' => '',
|
||||
'js' => '/framework/js/vendor/lazyloadxt.js',
|
||||
'hidden' => TRUE, // component not visible in UI
|
||||
'order' => 'top', // component will be added to the top of generated JS file
|
||||
),
|
||||
'general' => array(
|
||||
'title' => us_translate_x( 'General', 'settings screen' ),
|
||||
'css' => '/css/base/general.css',
|
||||
'js' => '/framework/js/base/general.js',
|
||||
'hidden' => TRUE, // component not visible in UI
|
||||
'order' => 'top', // component will be added to the top of generated JS file
|
||||
),
|
||||
'animation' => array(
|
||||
'title' => __( 'Animation', 'us' ),
|
||||
'css' => '/css/base/animation.css',
|
||||
'js' => '/framework/js/base/animation.js',
|
||||
'group' => __( 'Base Components', 'us' ),
|
||||
),
|
||||
'carousel' => array(
|
||||
'title' => __( 'Carousel', 'us' ),
|
||||
'css' => '/css/base/carousel.css',
|
||||
),
|
||||
'columns' => array(
|
||||
'title' => us_translate( 'Columns' ),
|
||||
'css' => '/css/base/columns.css',
|
||||
),
|
||||
'comments' => array(
|
||||
'title' => us_translate( 'Comments' ),
|
||||
'css' => '/css/base/comments.css',
|
||||
'js' => '/framework/js/base/comments.js',
|
||||
),
|
||||
'filters' => array(
|
||||
'title' => us_translate( 'Filter' ),
|
||||
'css' => '/css/base/filters.css',
|
||||
),
|
||||
'forms' => array(
|
||||
'title' => __( 'Forms', 'us' ),
|
||||
'css' => '/css/base/forms.css',
|
||||
'js' => '/framework/js/base/forms.js',
|
||||
),
|
||||
'header' => array(
|
||||
'title' => _x( 'Header', 'site top area', 'us' ),
|
||||
'css' => '/css/base/header.css',
|
||||
'js' => '/framework/js/base/header.js',
|
||||
),
|
||||
'parallax-hor' => array(
|
||||
'title' => __( 'Horizontal Parallax', 'us' ),
|
||||
'js' => '/framework/js/base/parallax-hor.js',
|
||||
),
|
||||
'pagination' => array(
|
||||
'title' => us_translate( 'Pagination' ),
|
||||
'css' => '/css/base/pagination.css',
|
||||
),
|
||||
'preloader' => array(
|
||||
'title' => __( 'Preloader', 'us' ),
|
||||
'css' => '/css/base/preloader.css',
|
||||
'js' => '/framework/js/base/preloader.js',
|
||||
),
|
||||
'print' => array(
|
||||
'title' => __( 'Print styles', 'us' ),
|
||||
'css' => '/css/base/print.css',
|
||||
),
|
||||
'popups' => array(
|
||||
'title' => __( 'Popups', 'us' ),
|
||||
'css' => '/css/base/popups.css',
|
||||
),
|
||||
'scroll' => array(
|
||||
'title' => __( 'Scroll events', 'us' ),
|
||||
'js' => '/framework/js/base/scroll.js',
|
||||
'order' => 'top',
|
||||
),
|
||||
'parallax-ver' => array(
|
||||
'title' => __( 'Vertical Parallax', 'us' ),
|
||||
'js' => '/framework/js/base/parallax-ver.js',
|
||||
),
|
||||
'ripple' => array(
|
||||
'title' => 'Ripple Effect',
|
||||
'css' => '/css/base/ripple.css',
|
||||
),
|
||||
'font-awesome' => array(
|
||||
'title' => sprintf( __( '"%s" icons', 'us' ), 'Font Awesome' ),
|
||||
'css' => '/css/base/fontawesome.css',
|
||||
),
|
||||
'material-icons' => array(
|
||||
'title' => sprintf( __( '"%s" icons', 'us' ), 'Material' ),
|
||||
'css' => '/css/base/material-icons.css',
|
||||
),
|
||||
|
||||
// Content Elements
|
||||
'actionbox' => array(
|
||||
'title' => __( 'ActionBox', 'us' ),
|
||||
'css' => '/css/elements/actionbox.css',
|
||||
'group' => __( 'Content Elements', 'us' ),
|
||||
),
|
||||
'buttons' => array(
|
||||
'title' => __( 'Buttons', 'us' ),
|
||||
'css' => '/css/elements/buttons.css',
|
||||
),
|
||||
'charts' => array(
|
||||
'title' => __( 'Charts', 'us' ),
|
||||
'css' => '/css/elements/charts.css',
|
||||
),
|
||||
'contacts' => array(
|
||||
'title' => us_translate( 'Contact Info' ),
|
||||
'css' => '/css/elements/contacts.css',
|
||||
),
|
||||
'counter' => array(
|
||||
'title' => __( 'Counter', 'us' ),
|
||||
'css' => '/css/elements/counter.css',
|
||||
'js' => '/framework/js/elements/counter.js',
|
||||
),
|
||||
'dropdown' => array(
|
||||
'title' => __( 'Dropdown', 'us' ),
|
||||
'css' => '/css/elements/dropdown.css',
|
||||
'js' => '/framework/js/elements/dropdown.js',
|
||||
),
|
||||
'flipbox' => array(
|
||||
'title' => __( 'FlipBox', 'us' ),
|
||||
'css' => '/css/elements/flipbox.css',
|
||||
'js' => '/framework/js/elements/flipbox.js',
|
||||
),
|
||||
'gmaps' => array(
|
||||
'title' => sprintf( __( '%s Maps', 'us' ), 'Google' ),
|
||||
'css' => '/css/elements/gmaps.css',
|
||||
'js' => '/framework/js/elements/gmaps.js',
|
||||
),
|
||||
'lmaps' => array(
|
||||
'title' => sprintf( __( '%s Maps', 'us' ), 'OpenStreetMap' ),
|
||||
'css' => '/css/vendor/leaflet.css',
|
||||
'js' => '/framework/js/elements/lmaps.js',
|
||||
),
|
||||
'grid' => array(
|
||||
'title' => __( 'Grid', 'us' ),
|
||||
'css' => '/css/elements/grid.css',
|
||||
'js' => '/framework/js/elements/grid.js',
|
||||
),
|
||||
'gallery' => array(
|
||||
'title' => __( 'Image Gallery', 'us' ),
|
||||
'css' => '/css/elements/gallery.css',
|
||||
'js' => '/framework/js/elements/gallery.js',
|
||||
),
|
||||
'slider' => array(
|
||||
'title' => __( 'Image Slider', 'us' ),
|
||||
'css' => '/css/elements/slider.css',
|
||||
'js' => '/framework/js/elements/slider.js',
|
||||
),
|
||||
'iconbox' => array(
|
||||
'title' => __( 'IconBox', 'us' ),
|
||||
'css' => '/css/elements/iconbox.css',
|
||||
),
|
||||
'image' => array(
|
||||
'title' => us_translate( 'Image' ),
|
||||
'css' => '/css/elements/image.css',
|
||||
),
|
||||
'itext' => array(
|
||||
'title' => __( 'Interactive Text', 'us' ),
|
||||
'css' => '/css/elements/itext.css',
|
||||
'js' => '/framework/js/elements/itext.js',
|
||||
),
|
||||
'menu' => array(
|
||||
'title' => us_translate( 'Menu' ),
|
||||
'css' => '/css/elements/menu.css',
|
||||
'js' => '/framework/js/elements/menu.js',
|
||||
),
|
||||
'message' => array(
|
||||
'title' => __( 'Message Box', 'us' ),
|
||||
'css' => '/css/elements/message.css',
|
||||
'js' => '/framework/js/elements/message.js',
|
||||
),
|
||||
'scroller' => array(
|
||||
'title' => __( 'Page Scroller', 'us' ),
|
||||
'css' => '/css/elements/page-scroller.css',
|
||||
'js' => '/framework/js/elements/page-scroller.js',
|
||||
),
|
||||
'person' => array(
|
||||
'title' => __( 'Person', 'us' ),
|
||||
'css' => '/css/elements/person.css',
|
||||
),
|
||||
'popup' => array(
|
||||
'title' => __( 'Popup', 'us' ),
|
||||
'css' => '/css/elements/popup.css',
|
||||
'js' => '/framework/js/elements/popup.js',
|
||||
),
|
||||
'pricing' => array(
|
||||
'title' => __( 'Pricing Table', 'us' ),
|
||||
'css' => '/css/elements/pricing.css',
|
||||
),
|
||||
'progbar' => array(
|
||||
'title' => __( 'Progress Bar', 'us' ),
|
||||
'css' => '/css/elements/progbar.css',
|
||||
'js' => '/framework/js/elements/progbar.js',
|
||||
),
|
||||
'search' => array(
|
||||
'title' => us_translate( 'Search' ),
|
||||
'css' => '/css/elements/search.css',
|
||||
),
|
||||
'separator' => array(
|
||||
'title' => __( 'Separator', 'us' ),
|
||||
'css' => '/css/elements/separator.css',
|
||||
),
|
||||
'sharing' => array(
|
||||
'title' => __( 'Sharing Buttons', 'us' ),
|
||||
'css' => '/css/elements/sharing.css',
|
||||
'js' => '/framework/js/elements/sharing.js',
|
||||
),
|
||||
'socials' => array(
|
||||
'title' => __( 'Social Links', 'us' ),
|
||||
'css' => '/css/elements/socials.css',
|
||||
),
|
||||
'tabs' => array(
|
||||
'title' => us_translate( 'Tabs', 'js_composer' ) . ', ' . us_translate( 'Tour', 'js_composer' ) . ', ' . us_translate( 'Accordion', 'js_composer' ),
|
||||
'css' => '/css/elements/tabs.css',
|
||||
'js' => '/framework/js/elements/tabs.js',
|
||||
),
|
||||
'video' => array(
|
||||
'title' => us_translate( 'Video Player', 'js_composer' ),
|
||||
'css' => '/css/elements/video.css',
|
||||
),
|
||||
|
||||
// Plugins
|
||||
'gravityforms' => array(
|
||||
'title' => 'Gravity Forms',
|
||||
'css' => '/css/plugins/gravityforms.css',
|
||||
'separated' => TRUE, // component will be minified into a separate file via "US Minify" plugin
|
||||
'apply_if' => class_exists( 'GFForms' ),
|
||||
'group' => us_translate( 'Plugins' ),
|
||||
),
|
||||
'tribe-events' => array(
|
||||
'title' => 'The Events Calendar',
|
||||
'css' => '/css/plugins/tribe-events.css',
|
||||
'separated' => TRUE,
|
||||
'apply_if' => class_exists( 'Tribe__Events__Main' ),
|
||||
),
|
||||
'ultimate-addons' => array(
|
||||
'title' => 'Ultimate Addons',
|
||||
'css' => '/css/plugins/ultimate-addons.css',
|
||||
'js' => '/framework/js/plugins/ultimate-addons.js',
|
||||
'apply_if' => class_exists( 'Ultimate_VC_Addons' ),
|
||||
),
|
||||
'bbpress' => array(
|
||||
'title' => 'bbPress',
|
||||
'css' => '/css/plugins/bbpress.css',
|
||||
'separated' => TRUE,
|
||||
'hidden' => TRUE,
|
||||
'apply_if' => class_exists( 'bbPress' ),
|
||||
),
|
||||
'slider-revolution' => array(
|
||||
'title' => 'Slider Revolution',
|
||||
'css' => '/css/plugins/slider-revolution.css',
|
||||
'hidden' => TRUE,
|
||||
'apply_if' => class_exists( 'RevSliderFront' ),
|
||||
),
|
||||
'tablepress' => array(
|
||||
'title' => 'TablePress',
|
||||
'css' => '/css/plugins/tablepress.css',
|
||||
'hidden' => TRUE,
|
||||
'apply_if' => class_exists( 'TablePress' ),
|
||||
),
|
||||
'woocommerce' => array(
|
||||
'title' => 'WooCommerce',
|
||||
'css' => '/css/plugins/woocommerce.css',
|
||||
'js' => '/framework/js/plugins/woocommerce.js',
|
||||
'separated' => TRUE,
|
||||
'hidden' => TRUE,
|
||||
'apply_if' => class_exists( 'woocommerce' ),
|
||||
),
|
||||
'wpml' => array(
|
||||
'title' => 'WPML',
|
||||
'css' => '/css/plugins/wpml.css',
|
||||
'hidden' => TRUE,
|
||||
'apply_if' => class_exists( 'SitePress' ),
|
||||
),
|
||||
|
||||
// Theme Customs
|
||||
'theme' => array(
|
||||
'title' => '',
|
||||
'js' => '/js/us.custom.js',
|
||||
'hidden' => TRUE,
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
// Define variables to use them in the config below, if needed
|
||||
$misc = us_config( 'elements_misc' );
|
||||
|
||||
// Structure template for all usage cases
|
||||
return array(
|
||||
|
||||
// Shows element's name in the editors UI
|
||||
'title' => 'Element name',
|
||||
|
||||
// Shows element's description in the WPB "Add New Element" window
|
||||
'description' => 'Element description',
|
||||
|
||||
// Defines tab in the WPB "Add New Element" window
|
||||
'category' => 'Post Elements',
|
||||
|
||||
// Defines icon in the WPB "Add New Element" window
|
||||
'icon' => 'icon-wpb-graph',
|
||||
|
||||
// Load JS file in the WPB element editing window
|
||||
'admin_enqueue_js' => 'site/framework/plugins-support/js_composer/js/us_icon_view.js',
|
||||
|
||||
// Defines JS class to apply custom appearance in the WPB editor UI
|
||||
'js_view' => 'ViewUsIcon',
|
||||
|
||||
// Sets element's settings and default values
|
||||
'params' => array(
|
||||
|
||||
// Common params, which can be used in all options types
|
||||
'option_name' => array(
|
||||
|
||||
// Shows name of option, can be absent
|
||||
'title' => 'Option name',
|
||||
|
||||
// Sets type of option control. See all available types below
|
||||
'type' => 'text',
|
||||
|
||||
// Shows description of option. Its appearance depends on "desc_" class
|
||||
'description' => 'Option description',
|
||||
|
||||
// Sets default value
|
||||
'std' => '',
|
||||
|
||||
// Adds css classes to customize appearance of option in the editing window
|
||||
'classes' => '',
|
||||
|
||||
// Sets appearance of option via 2 or 3 columns in the editing window
|
||||
'cols' => 2,
|
||||
|
||||
// Sets display conditions depending on other option's values
|
||||
'show_if' => array( 'some_option', '=', 'some_value' ),
|
||||
|
||||
// Combines several options into separate tab in the editing window
|
||||
'group' => 'Tab Name',
|
||||
|
||||
// Sets where the option can be used
|
||||
'context' => array( 'header', 'grid', 'shortcode', 'widget' ),
|
||||
|
||||
// Shows option's name and value in the editors UI
|
||||
'admin_label' => TRUE,
|
||||
|
||||
// Shows option's value inside a <div> in the editors UI
|
||||
'holder' => 'div',
|
||||
|
||||
// Outputs the option depending on "if" condition, e.g. "plugin is active"
|
||||
'place_if' => class_exists( 'woocommerce' ),
|
||||
),
|
||||
|
||||
/************ OPTIONS TYPES ************/
|
||||
|
||||
// TEXT: single line text field with free user input, based on <input type="text">
|
||||
'option_name' => array(
|
||||
'type' => 'text',
|
||||
'placeholder' => '', // shows text inside a field
|
||||
'std' => '', // string
|
||||
),
|
||||
|
||||
// TEXTAREA: multiple lines text field with free user input, based on <textarea>
|
||||
'option_name' => array(
|
||||
'type' => 'textarea',
|
||||
'placeholder' => '', // shows text inside a field
|
||||
'std' => '', // string
|
||||
),
|
||||
|
||||
// SELECT: single selection between several values, based on <select>
|
||||
'option_name' => array(
|
||||
'type' => 'select',
|
||||
'is_advanced' => TRUE, // adds search field while selecting, based on "select2" script
|
||||
'options' => array( // shows possible values for selection
|
||||
'key1' => 'Value Name',
|
||||
'key2' => 'Value Name',
|
||||
'key3' => array( // sets <optgroup> for several values
|
||||
'optgroup' => TRUE,
|
||||
'title' => 'Values Group Name',
|
||||
),
|
||||
),
|
||||
'std' => 'key1', // string
|
||||
),
|
||||
|
||||
// RADIO: single selection between several values, based on <input type="radio">
|
||||
'option_name' => array(
|
||||
'type' => 'radio',
|
||||
'options' => array( // shows possible values for selection
|
||||
'key1' => 'Value Name',
|
||||
'key2' => 'Value Name',
|
||||
'key3' => 'Value Name',
|
||||
),
|
||||
'std' => 'key1', // string
|
||||
),
|
||||
|
||||
// CHECKBOXES: multiple selection between several values, based on several <input type="checkbox">
|
||||
'option_name' => array(
|
||||
'type' => 'checkboxes',
|
||||
'options' => array( // shows possible values for selection
|
||||
'key1' => 'Value Name',
|
||||
'key2' => 'Value Name',
|
||||
'key3' => 'Value Name',
|
||||
),
|
||||
'std' => array( 'key2' ), // array
|
||||
),
|
||||
|
||||
// SWITCH: ON/OFF switch, based on a single <input type="checkbox">
|
||||
'option_name' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => '', // shows text after switch, text is also clickable
|
||||
'std' => FALSE, // bool
|
||||
),
|
||||
|
||||
// ICON: icon selection with preview, based on combined controls
|
||||
'option_name' => array(
|
||||
'type' => 'icon',
|
||||
'std' => 'fas|star', // string: "set|name"
|
||||
),
|
||||
|
||||
// LINK: text field with checkboxes, based on combined controls
|
||||
'option_name' => array(
|
||||
'type' => 'link',
|
||||
'std' => array(), // array
|
||||
'shortcode_std' => '', // empty string for shortcode param
|
||||
),
|
||||
|
||||
// COLOR: color picker, based on custom controls
|
||||
'option_name' => array(
|
||||
'type' => 'color',
|
||||
'std' => '#fff', // string: HEX or RGBA value
|
||||
),
|
||||
|
||||
// UPLOAD: shows button with selection files from WordPress Media Library
|
||||
'option_name' => array(
|
||||
'type' => 'upload',
|
||||
'is_multiple' => TRUE, // enables slection of several files, default is FALSE
|
||||
'button_label' => 'Set image', // sets text on the button
|
||||
'extension' => 'png,jpg,jpeg,gif,svg', // sets available file types
|
||||
),
|
||||
|
||||
// HEADING: used as visual separator between options
|
||||
'option_name' => array(
|
||||
'type' => 'heading',
|
||||
),
|
||||
|
||||
// EDITOR: WordPress Classic Editor, used in shortcodes only
|
||||
'option_name' => array(
|
||||
'type' => 'editor',
|
||||
'std' => '', // string
|
||||
),
|
||||
|
||||
// HTML: used for code input, based on <textarea>
|
||||
'option_name' => array(
|
||||
'type' => 'html',
|
||||
'encoded' => TRUE, // encodes the value to the base64
|
||||
'std' => '', // string
|
||||
),
|
||||
|
||||
// USOF Design Options: adds special control for box properties: position, margin, border, padding
|
||||
'option_name' => array(
|
||||
'type' => 'design_options',
|
||||
'states' => array( 'default', 'tablets', 'mobiles' ), // separates box properties for every responsive state
|
||||
'with_position' => TRUE, // enables "position" property with "Position: absolute" switcher
|
||||
'std' => array(), // array
|
||||
),
|
||||
|
||||
// WPB Design Options: adds special control for box properties: margin, border, padding and some additional options
|
||||
'option_name' => array(
|
||||
'type' => 'css_editor',
|
||||
),
|
||||
|
||||
// GROUP: Group of several items. Every item may have all other option types. Group allows to add/delete/reorder items
|
||||
'option_name_group' => array(
|
||||
'type' => 'group',
|
||||
'is_sortable' => TRUE, // enables ordering items in the editing window
|
||||
'params' => array( // items with their settings and default values
|
||||
'item_name_1' => array(
|
||||
'type' => 'image',
|
||||
'std' => '',
|
||||
),
|
||||
'item_name_2' => array(
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
),
|
||||
'std' => array(), // array
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$body_fontsize = us_get_option( 'body_fontsize', '16px' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => sprintf( __( 'Product "%s" block', 'us' ), us_translate( 'Add to cart', 'woocommerce' ) ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'params' => array_merge( array(
|
||||
|
||||
'font_size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => $body_fontsize,
|
||||
'grid_cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'font_size_mobiles' => array(
|
||||
'title' => __( 'Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'context' => array( 'grid' ),
|
||||
),
|
||||
'view_cart_link' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show link to cart when adding products', 'us' ),
|
||||
'std' => FALSE,
|
||||
'context' => array( 'grid' ),
|
||||
),
|
||||
|
||||
), $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,127 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Links Menu', 'us' ),
|
||||
'icon' => 'fas fa-bars',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'source' => array(
|
||||
'title' => us_translate( 'Menu' ),
|
||||
'description' => $misc['desc_menu_select'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_nav_menus(),
|
||||
'std' => '',
|
||||
),
|
||||
'size' => array(
|
||||
'title' => __( 'Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'size_tablets' => array(
|
||||
'title' => __( 'Font Size on Tablets', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'size_mobiles' => array(
|
||||
'title' => __( 'Font Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'indents' => array(
|
||||
'title' => __( 'Items Indents', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '10px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 2,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'indents_tablets' => array(
|
||||
'title' => __( 'Items Indents on Tablets', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '10px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 2,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'indents_mobiles' => array(
|
||||
'title' => __( 'Items Indents on Mobiles', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '10px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'max' => 100,
|
||||
'step' => 2,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 6.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Breadcrumbs', 'us' ),
|
||||
'description' => __( 'Shows current page location', 'us' ),
|
||||
'icon' => 'fas fa-angle-double-right',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'home' => array(
|
||||
'title' => __( 'Homepage Label', 'us' ),
|
||||
'description' => __( 'Leave blank to hide the homepage link', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => us_translate( 'Home' ),
|
||||
),
|
||||
'show_current' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show current page', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'font_size' => array(
|
||||
'title' => __( 'Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'separator_type' => array(
|
||||
'title' => __( 'Separator between items', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'icon' => __( 'Icon', 'us' ),
|
||||
'custom' => __( 'Custom symbol', 'us' ),
|
||||
),
|
||||
'std' => 'icon',
|
||||
),
|
||||
'separator_icon' => array(
|
||||
'type' => 'icon',
|
||||
'std' => 'far|angle-right',
|
||||
'show_if' => array( 'separator_type', '=', 'icon' ),
|
||||
),
|
||||
'separator_symbol' => array(
|
||||
'type' => 'text',
|
||||
'std' => '/',
|
||||
'show_if' => array( 'separator_type', '=', 'custom' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
global $us_template_directory_uri;
|
||||
$body_fontsize = us_get_option( 'body_fontsize', '16px' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Button', 'us' ),
|
||||
'icon' => 'icon-wpb-ui-button',
|
||||
'admin_enqueue_js' => $us_template_directory_uri . '/framework/plugins-support/js_composer/js/us_icon_view.js',
|
||||
'js_view' => 'ViewUsIcon',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'label' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'holder' => 'button',
|
||||
),
|
||||
'link_type' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
),
|
||||
'std' => 'post',
|
||||
'context' => array( 'grid' ),
|
||||
),
|
||||
'link' => array(
|
||||
'header_title' => us_translate( 'Link' ),
|
||||
'shortcode_title' => us_translate( 'Link' ),
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'grid_description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'grid_show_if' => array( 'link_type', '=', 'custom' ),
|
||||
),
|
||||
'style' => array(
|
||||
'title' => us_translate( 'Style' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_btn_styles(),
|
||||
'std' => '1',
|
||||
),
|
||||
'font_size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'placeholder' => $body_fontsize,
|
||||
'type' => 'text',
|
||||
'cols' => 2,
|
||||
'header_cols' => 3,
|
||||
'std' => $body_fontsize,
|
||||
),
|
||||
'font_size_tablets' => array(
|
||||
'title' => __( 'Size on Tablets', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'font_size_mobiles' => array(
|
||||
'title' => __( 'Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'header_cols' => 3,
|
||||
),
|
||||
'width_type' => array(
|
||||
'title' => us_translate( 'Width' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'auto' => us_translate( 'Auto' ),
|
||||
'full' => __( 'Stretch to the full width', 'us' ),
|
||||
'custom' => __( 'Set a width', 'us' ),
|
||||
'max' => __( 'Set a maximum width', 'us' ),
|
||||
),
|
||||
'std' => 'auto',
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'custom_width' => array(
|
||||
'description' => $misc['desc_width'],
|
||||
'type' => 'text',
|
||||
'std' => '200px',
|
||||
'show_if' => array( 'width_type', '=', array( 'custom', 'max' ) ),
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'align' => array(
|
||||
'title' => __( 'Button Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'show_if' => array( 'width_type', '=', array( 'auto', 'custom', 'max' ) ),
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
|
||||
// Icon
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'group' => __( 'Icon', 'us' ),
|
||||
),
|
||||
'iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'group' => __( 'Icon', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,206 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
// Get params from Grid config and exclude unneeded
|
||||
$grid_params = us_config( 'elements/grid.params' );
|
||||
foreach( $grid_params as $grid_param_name => $grid_param ) {
|
||||
|
||||
if ( strpos( $grid_param_name, 'pagination' ) !== FALSE ) { // exclude Pagination options
|
||||
unset( $grid_params[ $grid_param_name ] );
|
||||
} elseif ( strpos( $grid_param_name, 'filter' ) !== FALSE ) { // exclude Filter options
|
||||
unset( $grid_params[ $grid_param_name ] );
|
||||
} elseif ( strpos( $grid_param_name, 'breakpoint' ) !== FALSE ) { // exclude Responsive options
|
||||
unset( $grid_params[ $grid_param_name ] );
|
||||
} elseif ( in_array( $grid_param_name, array_keys( $design_options ) ) ) { // exclude Design options for correct params order
|
||||
unset( $grid_params[ $grid_param_name ] );
|
||||
}
|
||||
}
|
||||
unset( $grid_params['type'] ); // exclude "Display as" option
|
||||
|
||||
return array(
|
||||
'title' => __( 'Carousel', 'us' ),
|
||||
'description' => __( 'List of images, posts, pages or any custom post types', 'us' ),
|
||||
'icon' => 'fas fa-laptop-code',
|
||||
'params' => array_merge( $grid_params, array(
|
||||
|
||||
// Carousel options
|
||||
'carousel_arrows' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Prev/Next arrows', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_arrows_style' => array(
|
||||
'title' => __( 'Arrows Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'circle' => __( 'Circles', 'us' ),
|
||||
'block' => __( 'Full height blocks', 'us' ),
|
||||
),
|
||||
'std' => 'circle',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'carousel_arrows', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_arrows_pos' => array(
|
||||
'title' => __( 'Arrows Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'outside' => __( 'Outside', 'us' ),
|
||||
'inside' => __( 'Inside', 'us' ),
|
||||
),
|
||||
'std' => 'outside',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'carousel_arrows', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_arrows_size' => array(
|
||||
'title' => __( 'Arrows Size', 'us' ),
|
||||
'description' => __( 'Examples:', 'us' ) . ' <span class="usof-example">26px</span>, <span class="usof-example">3rem</span>',
|
||||
'type' => 'text',
|
||||
'std' => '1.8rem',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'carousel_arrows', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_arrows_offset' => array(
|
||||
'title' => __( 'Arrows Offset', 'us' ),
|
||||
'description' => __( 'Examples:', 'us' ) . ' <span class="usof-example">20px</span>, <span class="usof-example">2rem</span>',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'carousel_arrows', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_dots' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Navigation Dots', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_center' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'First item in the center', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'type', '=', 'carousel' ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_slideby' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Slide by several items instead of one', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_autoheight' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto height (for 1 column only)', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_autoplay' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto Rotation', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_interval' => array(
|
||||
'title' => __( 'Auto Rotation Interval (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '3',
|
||||
'show_if' => array( 'carousel_autoplay', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_autoplay_smooth' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Continual Rotation', 'us' ),
|
||||
'std' => FALSE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'carousel_autoplay', '!=', FALSE ),
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_speed' => array(
|
||||
'title' => __( 'Slide Speed (in milliseconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '250',
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
'carousel_transition' => array(
|
||||
'title' => __( 'Transition Effect', 'us' ),
|
||||
'description' => '<a href="http://cubic-bezier.com/" target="_blank">' . __( 'Use timing function', 'us' ) . '</a>' . '. ' . __( 'Examples:', 'us' ) . ' <span class="usof-example">linear</span>, <span class="usof-example">cubic-bezier(0,1,.8,1)</span>, <span class="usof-example">cubic-bezier(.78,.13,.15,.86)</span>',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'group' => __( 'Carousel', 'us' ),
|
||||
),
|
||||
|
||||
// Responsive
|
||||
'breakpoint_1_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '1200px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_1_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '3',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_1_autoplay' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto Rotation', 'us' ),
|
||||
'std' => TRUE,
|
||||
'classes' => 'for_above',
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_2_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '900px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_2_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '2',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_2_autoplay' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto Rotation', 'us' ),
|
||||
'std' => TRUE,
|
||||
'classes' => 'for_above',
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_3_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '600px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_3_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '1',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_3_autoplay' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto Rotation', 'us' ),
|
||||
'std' => TRUE,
|
||||
'classes' => 'for_above',
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$color_bg = us_get_color( 'color_menu_button_bg', TRUE );
|
||||
$color_text = us_get_color( 'color_menu_button_text' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Cart', 'us' ),
|
||||
'icon' => 'fas fa-shopping-cart',
|
||||
'place_if' => class_exists( 'woocommerce' ),
|
||||
'params' => array_merge( array(
|
||||
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => 'fas|shopping-cart',
|
||||
),
|
||||
'size' => array(
|
||||
'title' => __( 'Icon Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
),
|
||||
'size_tablets' => array(
|
||||
'title' => __( 'Icon Size on Tablets', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
),
|
||||
'size_mobiles' => array(
|
||||
'title' => __( 'Icon Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
),
|
||||
'quantity_color_bg' => array(
|
||||
'title' => __( 'Quantity Badge Background', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => $color_bg,
|
||||
'cols' => 2,
|
||||
),
|
||||
'quantity_color_text' => array(
|
||||
'title' => __( 'Quantity Badge Text', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => $color_text,
|
||||
'cols' => 2,
|
||||
),
|
||||
'vstretch' => array(
|
||||
'title' => us_translate( 'Height' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Stretch to the full available height', 'us' ),
|
||||
'std' => TRUE,
|
||||
),
|
||||
'dropdown_effect' => array(
|
||||
'title' => __( 'Dropdown Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['dropdown_effect_values'],
|
||||
'std' => 'height',
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,204 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$receiver_email = get_option( 'admin_email' );
|
||||
$body_fontsize = us_get_option( 'body_fontsize', '16px' );
|
||||
$btn_styles = us_get_btn_styles();
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
// Default Form Fields
|
||||
$default_fields = array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => '',
|
||||
'placeholder' => us_translate( 'Name' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'email',
|
||||
'label' => '',
|
||||
'placeholder' => us_translate( 'Email' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'textarea',
|
||||
'label' => '',
|
||||
'placeholder' => us_translate( 'Message' ),
|
||||
),
|
||||
);
|
||||
|
||||
return array(
|
||||
'title' => __( 'Contact Form', 'us' ),
|
||||
'icon' => 'fas fa-envelope',
|
||||
'params' => array_merge(
|
||||
|
||||
array(
|
||||
// Fields
|
||||
'items' => array(
|
||||
'type' => 'group',
|
||||
'group' => __( 'Fields', 'us' ),
|
||||
'is_sortable' => TRUE,
|
||||
'params' => array(
|
||||
'type' => array(
|
||||
'title' => us_translate( 'Type' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'text' => us_translate( 'Text' ) . ' ' . __( '(single line)', 'us' ),
|
||||
'textarea' => us_translate( 'Text' ) . ' ' . __( '(multiple lines)', 'us' ),
|
||||
'email' => us_translate( 'Email' ),
|
||||
'select' => __( 'Dropdown', 'us' ),
|
||||
'checkboxes' => __( 'Checkboxes', 'us' ),
|
||||
'radio' => __( 'Radio buttons', 'us' ),
|
||||
'info' => us_translate( 'Text Block', 'js_composer' ),
|
||||
'agreement' => __( 'Agreement checkbox', 'us' ),
|
||||
'captcha' => __( 'Captcha', 'us' ),
|
||||
),
|
||||
'std' => 'text',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'label' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'description' => __( 'Shown above the field', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'type', '!=', 'info' ),
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'description' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'description' => __( 'Shown below the field', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'type', '!=', 'info' ),
|
||||
),
|
||||
'placeholder' => array(
|
||||
'title' => __( 'Placeholder', 'us' ),
|
||||
'description' => __( 'Shown inside the field', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'show_if' => array( 'type', 'in', array( 'text', 'email', 'textarea' ) ),
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'values' => array(
|
||||
'title' => __( 'Values', 'us' ),
|
||||
'description' => __( 'Each value on a new line', 'us' ),
|
||||
'type' => 'textarea',
|
||||
'encoded' => TRUE,
|
||||
'std' => '',
|
||||
'show_if' => array( 'type', 'in', array( 'select', 'checkboxes', 'radio' ) ),
|
||||
),
|
||||
'value' => array(
|
||||
'title' => us_translate( 'Text' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'show_if' => array( 'type', 'in', array( 'info', 'agreement' ) ),
|
||||
),
|
||||
'required' => array(
|
||||
'switch_text' => __( 'Required field', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
'show_if' => array(
|
||||
'type',
|
||||
'in',
|
||||
array( 'text', 'email', 'textarea', 'checkboxes' ),
|
||||
),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array(
|
||||
'type',
|
||||
'in',
|
||||
array( 'text', 'email', 'textarea', 'select', 'captcha' ),
|
||||
),
|
||||
),
|
||||
),
|
||||
'std' => urlencode( json_encode( $default_fields ) ),
|
||||
),
|
||||
|
||||
// Button
|
||||
'button_text' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => us_translate( 'Submit' ),
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'button_style' => array(
|
||||
'title' => us_translate( 'Style' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => $btn_styles,
|
||||
'std' => '1',
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'button_size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => $body_fontsize,
|
||||
'cols' => 2,
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'button_size_mobiles' => array(
|
||||
'title' => __( 'Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'button_fullwidth' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Stretch to the full width', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'button_align' => array(
|
||||
'title' => __( 'Button Alignment', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
'iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'group' => __( 'Button', 'us' ),
|
||||
),
|
||||
|
||||
// More Options
|
||||
'receiver_email' => array(
|
||||
'title' => __( 'Receiver Email', 'us' ),
|
||||
'description' => __( 'Requests will be sent to this email. You can insert multiple comma-separated emails as well.', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => $receiver_email,
|
||||
'admin_label' => TRUE,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'success_message' => array(
|
||||
'title' => __( 'Message after sending', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Thank you! Your message was sent.', 'us' ),
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => us_translate( 'Contact Info' ),
|
||||
'icon' => 'fas fa-phone',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'address' => array(
|
||||
'title' => __( 'Address', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
'phone' => array(
|
||||
'title' => __( 'Phone', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
'fax' => array(
|
||||
'title' => __( 'Fax', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
'email' => array(
|
||||
'title' => us_translate( 'Email' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Counter', 'us' ),
|
||||
'description' => __( 'Animated number with text', 'us' ),
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'initial' => array(
|
||||
'title' => __( 'Initial counting value', 'us' ),
|
||||
'description' => __( 'With all the prefixes, suffixes and decimal marks if needed.', 'us' ) . ' ' . __( 'Examples:', 'us' ) . ' 0, $0, 1%, 0.001, 1kg',
|
||||
'type' => 'text',
|
||||
'std' => '1',
|
||||
),
|
||||
'final' => array(
|
||||
'title' => __( 'Final counting value', 'us' ),
|
||||
'description' => __( 'The way it should look like, when the animation ends.', 'us' ) . ' ' . __( 'Examples:', 'us' ) . ' 100, $70, 98%, 0.374, 35kg',
|
||||
'type' => 'text',
|
||||
'std' => '99',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'color' => array(
|
||||
'title' => us_translate( 'Color' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'primary' => __( 'Primary (theme color)', 'us' ),
|
||||
'secondary' => __( 'Secondary (theme color)', 'us' ),
|
||||
'heading' => __( 'Heading (theme color)', 'us' ),
|
||||
'text' => __( 'Text (theme color)', 'us' ),
|
||||
'custom' => us_translate( 'Custom' ),
|
||||
),
|
||||
'std' => 'primary',
|
||||
'cols' => 2,
|
||||
),
|
||||
'size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '5rem',
|
||||
'cols' => 2,
|
||||
),
|
||||
'custom_color' => array(
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'font' => array(
|
||||
'title' => __( 'Font', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => us_get_fonts( 'without_groups' ),
|
||||
'std' => 'body',
|
||||
),
|
||||
'font_weight' => array(
|
||||
'title' => __( 'Font Weight', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'100' => '100 ' . __( 'thin', 'us' ),
|
||||
'200' => '200 ' . __( 'extra-light', 'us' ),
|
||||
'300' => '300 ' . __( 'light', 'us' ),
|
||||
'400' => '400 ' . __( 'normal', 'us' ),
|
||||
'500' => '500 ' . __( 'medium', 'us' ),
|
||||
'600' => '600 ' . __( 'semi-bold', 'us' ),
|
||||
'700' => '700 ' . __( 'bold', 'us' ),
|
||||
'800' => '800 ' . __( 'extra-bold', 'us' ),
|
||||
'900' => '900 ' . __( 'ultra-bold', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
'text_transform' => array(
|
||||
'title' => __( 'Text Transform', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
'uppercase' => 'UPPERCASE',
|
||||
'lowercase' => 'lowercase',
|
||||
'capitalize' => 'Capitalize',
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
'font_style' => array(
|
||||
'title' => __( 'Font Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'normal' => __( 'normal', 'us' ),
|
||||
'italic' => __( 'italic', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
|
||||
// More Options
|
||||
'title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Projects completed', 'us' ),
|
||||
'holder' => 'div',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'title_size' => array(
|
||||
'title' => __( 'Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'title_tag' => array(
|
||||
'title' => __( 'Title HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h6',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'title_color' => array(
|
||||
'title' => __( 'Title Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'center',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'duration' => array(
|
||||
'title' => __( 'Animation Duration (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '2',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$body_fontsize = us_get_option( 'body_fontsize', '16px' );
|
||||
$btn_styles = us_get_btn_styles();
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'ActionBox', 'us' ),
|
||||
'description' => __( 'Content box with call to action button', 'us' ),
|
||||
'icon' => 'icon-wpb-call-to-action',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => 'This is ActionBox',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'title_size' => array(
|
||||
'title' => __( 'Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'title', '!=', '' ),
|
||||
),
|
||||
'title_tag' => array(
|
||||
'title' => __( 'Title HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h2',
|
||||
'show_if' => array( 'title', '!=', '' ),
|
||||
'cols' => 2,
|
||||
),
|
||||
'content' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'type' => 'textarea',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'color' => array(
|
||||
'title' => us_translate( 'Colors' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'primary' => __( 'Primary bg & White text', 'us' ),
|
||||
'secondary' => __( 'Secondary bg & White text', 'us' ),
|
||||
'light' => __( 'Alternate bg & Content text', 'us' ),
|
||||
'custom' => us_translate( 'Custom' ),
|
||||
),
|
||||
'std' => 'primary',
|
||||
),
|
||||
'bg_color' => array(
|
||||
'title' => __( 'Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'text_color' => array(
|
||||
'title' => __( 'Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'controls' => array(
|
||||
'title' => __( 'Buttons Location', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'right' => us_translate( 'Right' ),
|
||||
'bottom' => us_translate( 'Bottom' ),
|
||||
),
|
||||
'std' => 'right',
|
||||
),
|
||||
|
||||
// Button 1
|
||||
'btn_label' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
'btn_link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'link',
|
||||
'std' => '',
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
'btn_style' => array(
|
||||
'title' => us_translate( 'Style' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => $btn_styles,
|
||||
'std' => '1',
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
'btn_size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => $body_fontsize,
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
'btn_icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
'btn_iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'group' => __( 'Button', 'us' ) . ' 1',
|
||||
),
|
||||
|
||||
// Button 2
|
||||
'second_button' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Display second button', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_label' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'link',
|
||||
'std' => '',
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_style' => array(
|
||||
'title' => us_translate( 'Style' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => $btn_styles,
|
||||
'std' => '1',
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => $body_fontsize,
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
'btn2_iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'show_if' => array( 'second_button', '!=', FALSE ),
|
||||
'group' => __( 'Button', 'us' ) . ' 2',
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,145 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
$dropdown_source_values = array(
|
||||
'own' => us_translate( 'Custom Links' ),
|
||||
'sidebar' => __( 'Sidebar with Widgets', 'us' ),
|
||||
);
|
||||
if ( class_exists( 'SitePress' ) ) {
|
||||
$dropdown_source_values['wpml'] = 'WPML ' . us_translate( 'Language Switcher', 'sitepress' );
|
||||
}
|
||||
if ( class_exists( 'Polylang' ) ) {
|
||||
$dropdown_source_values['polylang'] = 'Polylang ' . us_translate( 'Language Switcher', 'polylang' );
|
||||
}
|
||||
|
||||
return array(
|
||||
'title' => __( 'Dropdown', 'us' ),
|
||||
'icon' => 'fas fa-caret-square-down',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'source' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => $dropdown_source_values,
|
||||
'std' => 'own',
|
||||
),
|
||||
'link_title' => array(
|
||||
'title' => __( 'Dropdown Title', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'show_if' => array( 'source', 'in', array( 'own', 'sidebar' ) ),
|
||||
),
|
||||
'link_icon' => array(
|
||||
'title' => __( 'Dropdown Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array( 'source', 'in', array( 'own', 'sidebar' ) ),
|
||||
),
|
||||
'h_links' => array(
|
||||
'title' => __( 'Dropdown Links', 'us' ),
|
||||
'type' => 'heading',
|
||||
'show_if' => array( 'source', '=', 'own' ),
|
||||
'classes' => 'as_field_title',
|
||||
),
|
||||
'links' => array(
|
||||
'title' => '{{label}}',
|
||||
'type' => 'group',
|
||||
'is_sortable' => TRUE,
|
||||
'is_accordion' => TRUE,
|
||||
'show_if' => array( 'source', '=', 'own' ),
|
||||
'params' => array(
|
||||
'label' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => us_translate( 'Custom Link' ),
|
||||
),
|
||||
'url' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
),
|
||||
),
|
||||
),
|
||||
'sidebar_id' => array(
|
||||
'title' => __( 'Sidebar', 'us' ),
|
||||
'description' => sprintf( __( 'Add or edit Sidebar on the %s page', 'us' ), '<a href="' . admin_url( 'widgets.php' ) . '" target="_blank">' . us_translate( 'Widgets' ) . '</a>' ),
|
||||
'type' => 'select',
|
||||
'options' => us_get_sidebars(),
|
||||
'std' => 'default_sidebar',
|
||||
'show_if' => array( 'source', '=', 'sidebar' ),
|
||||
),
|
||||
'wpml_switcher' => array(
|
||||
'type' => 'checkboxes',
|
||||
'options' => array(
|
||||
'flag' => us_translate( 'Flag', 'sitepress' ),
|
||||
'native_lang' => us_translate( 'Native language name', 'sitepress' ),
|
||||
'display_lang' => us_translate( 'Language name in current language', 'sitepress' ),
|
||||
),
|
||||
'std' => array( 'native_lang', 'display_lang' ),
|
||||
'show_if' => array( 'source', '=', 'wpml' ),
|
||||
'place_if' => class_exists( 'SitePress' ),
|
||||
),
|
||||
'size' => array(
|
||||
'title' => us_translate( 'Size' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '16px',
|
||||
'cols' => 3,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'size_tablets' => array(
|
||||
'title' => __( 'Size on Tablets', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '15px',
|
||||
'cols' => 3,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'size_mobiles' => array(
|
||||
'title' => __( 'Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '14px',
|
||||
'cols' => 3,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'dropdown_open' => array(
|
||||
'title' => __( 'Open Dropdown', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'click' => __( 'On click', 'us' ),
|
||||
'hover' => __( 'On hover', 'us' ),
|
||||
),
|
||||
'std' => 'click',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'dropdown_dir' => array(
|
||||
'title' => __( 'Dropdown Direction', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'right',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'dropdown_effect' => array(
|
||||
'title' => __( 'Dropdown Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['dropdown_effect_values'],
|
||||
'std' => 'height',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,328 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'FlipBox', 'us' ),
|
||||
'description' => __( 'Two-sided content element, flipping on hover', 'us' ),
|
||||
'icon' => 'fas fa-cube',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// Front Side
|
||||
'front_title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Front Side', 'us' ),
|
||||
'holder' => 'div',
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_title_size' => array(
|
||||
'title' => __( 'Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_title', '!=', '' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_title_tag' => array(
|
||||
'title' => __( 'Title HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h4',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_title', '!=', '' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_desc' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'type' => 'textarea',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_bgcolor' => array(
|
||||
'title' => __( 'Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_textcolor' => array(
|
||||
'title' => __( 'Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_bgimage' => array(
|
||||
'title' => __( 'Background Image', 'us' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_bgimage_size' => array(
|
||||
'title' => __( 'Background Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_bgimage', '!=', '' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_type' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'font' => __( 'Font icon', 'us' ),
|
||||
'image' => __( 'Custom', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_name' => array(
|
||||
'type' => 'icon',
|
||||
'show_if' => array( 'front_icon_type', '=', 'font' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_size' => array(
|
||||
'title' => __( 'Icon Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '2rem',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_icon_type', '=', 'font' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_style' => array(
|
||||
'title' => __( 'Icon Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'Simple', 'us' ),
|
||||
'circle' => __( 'Inside the Solid circle', 'us' ),
|
||||
),
|
||||
'std' => 'default',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_icon_type', '=', 'font' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_color' => array(
|
||||
'title' => __( 'Icon Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'front_icon_type', '=', 'font' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_bgcolor' => array(
|
||||
'title' => __( 'Icon Circle Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'front_icon_type', '=', 'font' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_image' => array(
|
||||
'title' => us_translate( 'Image' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_icon_type', '=', 'image' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_image_width' => array(
|
||||
'title' => us_translate( 'Width' ),
|
||||
'description' => $misc['desc_width'],
|
||||
'type' => 'text',
|
||||
'std' => '4rem',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'front_icon_type', '=', 'image' ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
'front_icon_pos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'above_title' => __( 'Above Title', 'us' ),
|
||||
'below_title' => __( 'Below Title', 'us' ),
|
||||
'below_desc' => __( 'Below Description', 'us' ),
|
||||
),
|
||||
'std' => 'above_title',
|
||||
'show_if' => array( 'front_icon_type', 'in', array( 'font', 'image' ) ),
|
||||
'group' => __( 'Front Side', 'us' ),
|
||||
),
|
||||
|
||||
// Back Side
|
||||
'back_title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Back Side', 'us' ),
|
||||
'holder' => 'div',
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_title_size' => array(
|
||||
'title' => __( 'Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'back_title', '!=', '' ),
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_title_tag' => array(
|
||||
'title' => __( 'Title HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h4',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'back_title', '!=', '' ),
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_desc' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'type' => 'textarea',
|
||||
'std' => '',
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_bgcolor' => array(
|
||||
'title' => __( 'Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_textcolor' => array(
|
||||
'title' => __( 'Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_bgimage' => array(
|
||||
'title' => __( 'Background Image', 'us' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
),
|
||||
'back_bgimage_size' => array(
|
||||
'title' => __( 'Background Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'back_bgimage', '!=', '' ),
|
||||
'group' => __( 'Back Side', 'us' ),
|
||||
|
||||
),
|
||||
|
||||
// Link
|
||||
'link_type' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'container' => __( 'The whole element', 'us' ),
|
||||
'btn' => __( 'Button on the Back Side', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'group' => us_translate( 'Link' ),
|
||||
),
|
||||
'link' => array(
|
||||
'type' => 'link',
|
||||
'std' => '',
|
||||
'show_if' => array( 'link_type', 'in', array( 'container', 'btn' ) ),
|
||||
'group' => us_translate( 'Link' ),
|
||||
),
|
||||
'btn_label' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'link_type', '=', 'btn' ),
|
||||
'group' => us_translate( 'Link' ),
|
||||
),
|
||||
'btn_size' => array(
|
||||
'title' => __( 'Button Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'link_type', '=', 'btn' ),
|
||||
'group' => us_translate( 'Link' ),
|
||||
),
|
||||
'btn_style' => array(
|
||||
'title' => __( 'Button Style', 'us' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_btn_styles(),
|
||||
'std' => '1',
|
||||
'show_if' => array( 'link_type', '=', 'btn' ),
|
||||
'group' => us_translate( 'Link' ),
|
||||
),
|
||||
|
||||
// Appearance
|
||||
'animation' => array(
|
||||
'title' => __( 'Animation Type', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'cardflip' => __( 'Card Flip', 'us' ),
|
||||
'cubetilt' => __( 'Cube Tilt', 'us' ),
|
||||
'cubeflip' => __( 'Cube Flip', 'us' ),
|
||||
'coveropen' => __( 'Cover Open', 'us' ),
|
||||
),
|
||||
'std' => 'cardflip',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'direction' => array(
|
||||
'title' => __( 'Animation Direction', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'n' => us_translate( 'Top' ),
|
||||
'e' => us_translate( 'Right' ),
|
||||
's' => us_translate( 'Bottom' ),
|
||||
'w' => us_translate( 'Left' ),
|
||||
'ne' => us_translate( 'Top Right' ),
|
||||
'se' => us_translate( 'Bottom Right' ),
|
||||
'sw' => us_translate( 'Bottom Left' ),
|
||||
'nw' => us_translate( 'Top Left' ),
|
||||
),
|
||||
'std' => 'w',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'duration' => array(
|
||||
'title' => __( 'Animation Duration (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '0.5',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'easing' => array(
|
||||
'title' => __( 'Animation Easing', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'ease' => 'ease',
|
||||
'easeInOutExpo' => 'easeInOutExpo',
|
||||
'easeInOutCirc' => 'easeInOutCirc',
|
||||
),
|
||||
'std' => 'ease',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'custom_width' => array(
|
||||
'title' => us_translate( 'Width' ),
|
||||
'description' => $misc['desc_width'],
|
||||
'type' => 'text',
|
||||
'std' => '100%',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'custom_height' => array(
|
||||
'title' => us_translate( 'Height' ),
|
||||
'description' => $misc['desc_height'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,200 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Map', 'us' ),
|
||||
'icon' => 'icon-wpb-map-pin',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'marker_address' => array(
|
||||
'title' => __( 'Address', 'us' ),
|
||||
'description' => __( 'Specify address in accordance with the format used by the national postal service of the country concerned.', 'us' ) . ' ' . sprintf( __( 'Or use geo coordinates, for example: %s', 'us' ), '38.6774156, 34.8520661' ),
|
||||
'type' => 'text',
|
||||
'std' => '1600 Amphitheatre Parkway, Mountain View, CA 94043, United States',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'marker_text' => array(
|
||||
'title' => __( 'Marker Text', 'us' ),
|
||||
'description' => __( 'HTML tags are allowed.', 'us' ),
|
||||
'type' => 'html',
|
||||
'encoded' => TRUE,
|
||||
'std' => base64_encode( '<h6>Hey, we are here!</h6><p>We will be glad to see you in our office.</p>' ),
|
||||
'classes' => 'vc_col-sm-12 pretend_textfield', // appearance fix in shortcode editing window
|
||||
),
|
||||
'show_infowindow' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show Marker Text when map is loaded', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'custom_marker_img' => array(
|
||||
'title' => __( 'Custom Marker Image', 'us' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
),
|
||||
'custom_marker_size' => array(
|
||||
'title' => __( 'Marker Image Size', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'20' => '20px',
|
||||
'30' => '30px',
|
||||
'40' => '40px',
|
||||
'50' => '50px',
|
||||
'60' => '60px',
|
||||
'70' => '70px',
|
||||
'80' => '80px',
|
||||
),
|
||||
'std' => '30',
|
||||
'show_if' => array( 'custom_marker_img', '!=', '' ),
|
||||
'cols' => 2,
|
||||
),
|
||||
|
||||
// Additional Markers
|
||||
'markers' => array(
|
||||
'type' => 'group',
|
||||
'params' => array(
|
||||
'marker_address' => array(
|
||||
'title' => __( 'Address', 'us' ),
|
||||
'description' => __( 'Specify address in accordance with the format used by the national postal service of the country concerned.', 'us' ) . ' ' . sprintf( __( 'Or use geo coordinates, for example: %s', 'us' ), '38.6774156, 34.8520661' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'marker_text' => array(
|
||||
'title' => __( 'Marker Text', 'us' ),
|
||||
'description' => __( 'HTML tags are allowed.', 'us' ),
|
||||
'type' => 'textarea',
|
||||
'std' => '',
|
||||
'classes' => 'vc_col-sm-12 pretend_textfield', // appearance fix in shortcode editing window
|
||||
),
|
||||
'marker_img' => array(
|
||||
'title' => __( 'Custom Marker Image', 'us' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
),
|
||||
'marker_size' => array(
|
||||
'title' => __( 'Marker Image Size', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'20' => '20px',
|
||||
'30' => '30px',
|
||||
'40' => '40px',
|
||||
'50' => '50px',
|
||||
'60' => '60px',
|
||||
'70' => '70px',
|
||||
'80' => '80px',
|
||||
),
|
||||
'std' => '30',
|
||||
'show_if' => array( 'marker_img', '!=', '' ),
|
||||
'cols' => 2,
|
||||
),
|
||||
),
|
||||
'group' => __( 'Additional Markers', 'us' ),
|
||||
),
|
||||
|
||||
// More Options
|
||||
'provider' => array(
|
||||
'title' => __( 'Map Provider', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'google' => __( 'Google Maps', 'us' ),
|
||||
'osm' => 'OpenStreetMap',
|
||||
),
|
||||
'std' => 'google',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'height' => array(
|
||||
'title' => __( 'Map Height (pixels)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '400',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'zoom' => array(
|
||||
'title' => __( 'Map Zoom', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'7' => '7',
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10',
|
||||
'11' => '11',
|
||||
'12' => '12',
|
||||
'13' => '13',
|
||||
'14' => '14',
|
||||
'15' => '15',
|
||||
'16' => '16',
|
||||
'17' => '17',
|
||||
'18' => '18',
|
||||
'19' => '19',
|
||||
'20' => '20',
|
||||
),
|
||||
'std' => '14',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'hide_controls' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Hide all map controls', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'disable_zoom' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Disable map zoom on mouse wheel scroll', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'disable_dragging' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Disable dragging on touch screens', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'map_bg_color' => array(
|
||||
'title' => __( 'Background Color', 'us' ),
|
||||
'description' => __( 'This color will be visible when map layer has not yet loaded.', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'type' => array(
|
||||
'title' => __( 'Map Type', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'roadmap' => __( 'Roadmap', 'us' ),
|
||||
'terrain' => __( 'Roadmap + Terrain', 'us' ),
|
||||
'satellite' => __( 'Satellite', 'us' ),
|
||||
'hybrid' => __( 'Satellite + Roadmap', 'us' ),
|
||||
),
|
||||
'std' => 'roadmap',
|
||||
'show_if' => array( 'provider', '=', 'google' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'map_style_json' => array(
|
||||
'title' => __( 'Map Style', 'us' ),
|
||||
'description' => sprintf( __( 'Check available styles on %s.', 'us' ), '<a href="https://snazzymaps.com/" target="_blank">snazzymaps.com</a>' ),
|
||||
'type' => 'html',
|
||||
'std' => '',
|
||||
'show_if' => array( 'provider', '=', 'google' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'layer_style' => array(
|
||||
'title' => __( 'Map Style', 'us' ),
|
||||
'description' => sprintf( __( 'Check available styles on %s.', 'us' ), '<a href="https://leaflet-extras.github.io/leaflet-providers/preview/" target="_blank">Leaflet Provider Demo</a>' ) . ' ' . sprintf( __( 'Example: %s', 'us' ), 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'show_if' => array( 'provider', '=', 'osm' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,503 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
// Get the available post types for selection
|
||||
$available_posts_types = us_grid_available_post_types( TRUE );
|
||||
|
||||
// Fetching the available taxonomies for selection
|
||||
$taxonomies_params = $filter_taxonomies_params = $available_taxonomies = array();
|
||||
|
||||
$known_post_type_taxonomies = us_grid_available_taxonomies();
|
||||
|
||||
foreach ( $known_post_type_taxonomies as $post_type => $taxonomy_slugs ) {
|
||||
if ( isset( $available_posts_types[ $post_type ] ) ) {
|
||||
$filter_values = array();
|
||||
foreach ( $taxonomy_slugs as $taxonomy_slug ) {
|
||||
$taxonomy_class = get_taxonomy( $taxonomy_slug );
|
||||
if ( ! empty( $taxonomy_class ) AND ! empty( $taxonomy_class->labels ) AND ! empty( $taxonomy_class->labels->name ) ) {
|
||||
if ( isset ( $available_taxonomies[ $taxonomy_slug ] ) ) {
|
||||
$available_taxonomies[ $taxonomy_slug ]['post_type'][] = $post_type;
|
||||
} else {
|
||||
$available_taxonomies[ $taxonomy_slug ] = array(
|
||||
'name' => $taxonomy_class->labels->name,
|
||||
'post_type' => array( $post_type ),
|
||||
);
|
||||
}
|
||||
$filter_value_label = $taxonomy_class->labels->name;
|
||||
$filter_values[ $taxonomy_slug ] = $filter_value_label;
|
||||
}
|
||||
}
|
||||
if ( count( $filter_values ) > 0 ) {
|
||||
$filter_taxonomies_params[ 'filter_' . $post_type ] = array(
|
||||
'title' => __( 'Filter by', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array_merge(
|
||||
array( '' => '– ' . us_translate( 'None' ) . ' –' ), $filter_values
|
||||
),
|
||||
'std' => '',
|
||||
'show_if' => array( 'post_type', '=', $post_type ),
|
||||
'group' => us_translate( 'Filter' ),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $available_taxonomies as $taxonomy_slug => $taxonomy ) {
|
||||
$taxonomy_items = array();
|
||||
$taxonomy_items_raw = get_categories(
|
||||
array(
|
||||
'taxonomy' => $taxonomy_slug,
|
||||
'hierarchical' => 0,
|
||||
'hide_empty' => FALSE,
|
||||
'number' => 200,
|
||||
)
|
||||
);
|
||||
if ( $taxonomy_items_raw ) {
|
||||
foreach ( $taxonomy_items_raw as $taxonomy_item_raw ) {
|
||||
if ( is_object( $taxonomy_item_raw ) ) {
|
||||
$taxonomy_items[ $taxonomy_item_raw->slug ] = $taxonomy_item_raw->name;
|
||||
}
|
||||
}
|
||||
if ( count( $taxonomy_items ) > 0 ) {
|
||||
// Do not output the only "Uncategorized" of Posts and Products
|
||||
if ( in_array( $taxonomy_slug, array( 'category', 'product_cat' ) ) AND count( $taxonomy_items ) == 1 ) {
|
||||
continue;
|
||||
}
|
||||
foreach ( $taxonomy['post_type'] as $taxonomy_post_type ) {
|
||||
$taxonomies_params[ 'taxonomy_' . $taxonomy_slug ] = array(
|
||||
'title' => sprintf( __( 'Show Items of selected %s', 'us' ), $taxonomy['name'] ),
|
||||
'type' => 'checkboxes',
|
||||
'options' => $taxonomy_items,
|
||||
'show_if' => array( 'post_type', 'in', $taxonomy['post_type'] ),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Additional values for WooCommerce products
|
||||
if ( class_exists( 'woocommerce' ) ) {
|
||||
$products_show_values = array(
|
||||
'product_upsells' => us_translate( 'Upsells', 'woocommerce' ),
|
||||
);
|
||||
$products_orderby_values = array(
|
||||
'popularity' => us_translate( 'Popularity (sales)', 'woocommerce' ),
|
||||
'price_asc' => us_translate( 'Sort by price: low to high', 'woocommerce' ),
|
||||
'price_desc' => us_translate( 'Sort by price: high to low', 'woocommerce' ),
|
||||
'rating' => us_translate( 'Sort by average rating', 'woocommerce' ),
|
||||
);
|
||||
$products_exclude_values = array(
|
||||
'out_of_stock' => us_translate( 'Out of stock', 'woocommerce' ),
|
||||
);
|
||||
} else {
|
||||
$products_orderby_values = $products_exclude_values = $products_show_values = array();
|
||||
}
|
||||
|
||||
// Get "Gallery" and "Post Object" options from ACF PRO plugin
|
||||
$acf_show_values = array();
|
||||
if ( function_exists( 'acf_get_field_groups' ) ) {
|
||||
$acf_groups = acf_get_field_groups();
|
||||
if ( ! empty( $acf_groups ) ) {
|
||||
foreach ( $acf_groups as $group ) {
|
||||
$fields = acf_get_fields( $group['ID'] );
|
||||
foreach ( $fields as $field ) {
|
||||
if ( $field['type'] == 'gallery' ) {
|
||||
$acf_show_values[ 'acf_gallery_' . $field['name'] ] = $group['title'] . ': ' . $field['label'];
|
||||
}
|
||||
if ( $field['type'] == 'post_object' ) {
|
||||
$acf_show_values[ 'acf_posts_' . $field['name'] ] = $group['title'] . ': ' . $field['label'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$grid_config = array(
|
||||
'title' => __( 'Grid', 'us' ),
|
||||
'description' => __( 'List of images, posts, pages or any custom post types', 'us' ),
|
||||
'icon' => 'fas fa-th-large',
|
||||
'params' => array(),
|
||||
);
|
||||
|
||||
// General
|
||||
$general_params = array_merge(
|
||||
array(
|
||||
|
||||
'post_type' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => array_merge(
|
||||
$available_posts_types, array(
|
||||
'ids' => __( 'Specific items', 'us' ),
|
||||
'related' => __( 'Items with the same taxonomy of current post', 'us' ),
|
||||
'current_query' => __( 'Items of the current query (used for archives and search results)', 'us' ),
|
||||
'taxonomy_terms' => __( 'Terms of selected taxonomy', 'us' ),
|
||||
'current_child_terms' => __( 'Child terms of current taxonomy', 'us' ),
|
||||
), $products_show_values, $acf_show_values
|
||||
),
|
||||
'std' => 'post',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'related_taxonomy' => array(
|
||||
'type' => 'select',
|
||||
'options' => us_get_taxonomies(),
|
||||
'std' => 'category',
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'post_type', 'in', array( 'related', 'taxonomy_terms' ) ),
|
||||
),
|
||||
'ids' => array(
|
||||
'type' => 'autocomplete',
|
||||
'settings' => array(
|
||||
'multiple' => TRUE,
|
||||
'sortable' => TRUE,
|
||||
'unique_values' => TRUE,
|
||||
),
|
||||
'save_always' => TRUE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'post_type', '=', 'ids' ),
|
||||
),
|
||||
'images' => array(
|
||||
'title' => us_translate( 'Images' ),
|
||||
'type' => 'upload',
|
||||
'is_multiple' => TRUE,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'show_if' => array( 'post_type', '=', 'attachment' ),
|
||||
),
|
||||
'ignore_sticky' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Ignore sticky posts', 'us' ),
|
||||
'std' => FALSE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'post_type', '=', 'post' ),
|
||||
),
|
||||
'products_include' => array(
|
||||
'type' => 'checkboxes',
|
||||
'options' => array(
|
||||
'sale' => us_translate( 'On-sale products', 'woocommerce' ),
|
||||
'featured' => us_translate( 'Featured products', 'woocommerce' ),
|
||||
),
|
||||
'std' => '',
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'post_type', '=', 'product' ),
|
||||
),
|
||||
'terms_include' => array(
|
||||
'type' => 'checkboxes',
|
||||
'options' => array(
|
||||
'children' => __( 'Show child terms', 'us' ),
|
||||
'empty' => __( 'Show empty', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'post_type', '=', array( 'taxonomy_terms', 'current_child_terms' ) ),
|
||||
),
|
||||
), $taxonomies_params, array(
|
||||
'orderby' => array(
|
||||
'title' => us_translate( 'Order' ),
|
||||
'type' => 'select',
|
||||
'options' => array_merge(
|
||||
array(
|
||||
'date' => __( 'By date of creation (newer first)', 'us' ),
|
||||
'date_asc' => __( 'By date of creation (older first)', 'us' ),
|
||||
'modified' => __( 'By date of update (newer first)', 'us' ),
|
||||
'modified_asc' => __( 'By date of update (older first)', 'us' ),
|
||||
'alpha' => __( 'Alphabetically', 'us' ),
|
||||
'rand' => us_translate( 'Random' ),
|
||||
'comment_count' => us_translate( 'Number of Comments' ),
|
||||
'menu_order' => sprintf( __( 'By "%s" values from "%s" box', 'us' ), us_translate( 'Order' ), us_translate( 'Page Attributes' ) ),
|
||||
'post__in' => __( 'Manually for images and specific items', 'us' ),
|
||||
), $products_orderby_values
|
||||
),
|
||||
'std' => 'date',
|
||||
'show_if' => array( 'post_type', '!=', array( 'current_query', 'taxonomy_terms', 'current_child_terms' ) ),
|
||||
),
|
||||
'terms_orderby' => array(
|
||||
'title' => us_translate( 'Order' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'title' => __( 'Alphabetically', 'us' ),
|
||||
'rand' => us_translate( 'Random' ),
|
||||
'count' => __( 'Items Quantity', 'us' ),
|
||||
'name' => __( 'Manually, if available', 'us' ),
|
||||
),
|
||||
'std' => 'title',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'post_type', '=', array( 'taxonomy_terms', 'current_child_terms' ) ),
|
||||
),
|
||||
'items_quantity' => array(
|
||||
'title' => __( 'Items Quantity', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '10',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'post_type', '!=', 'current_query' ),
|
||||
),
|
||||
'exclude_items' => array(
|
||||
'title' => __( 'Exclude Items', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array_merge(
|
||||
array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'prev' => __( 'of previous Grids on this page', 'us' ),
|
||||
'offset' => __( 'by the given quantity from the beginning of output', 'us' ),
|
||||
), $products_exclude_values
|
||||
),
|
||||
'std' => 'none',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'post_type', '!=', array( 'current_query', 'taxonomy_terms', 'current_child_terms' ) ),
|
||||
),
|
||||
'items_offset' => array(
|
||||
'title' => __( 'Items Quantity to skip', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '1',
|
||||
'show_if' => array( 'exclude_items', '=', 'offset' ),
|
||||
),
|
||||
'no_items_message' => array(
|
||||
'title' => __( 'Message when no items', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => us_translate( 'No results found' ),
|
||||
),
|
||||
'pagination' => array(
|
||||
'title' => us_translate( 'Pagination' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'regular' => __( 'Numbered pagination', 'us' ),
|
||||
'ajax' => __( 'Load items on button click', 'us' ),
|
||||
'infinite' => __( 'Load items on page scroll', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'show_if' => array( 'post_type', '!=', array( 'taxonomy_terms', 'current_child_terms', 'product_upsells' ) ),
|
||||
),
|
||||
'pagination_btn_text' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Load More', 'us' ),
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'pagination', '=', 'ajax' ),
|
||||
),
|
||||
'pagination_btn_size' => array(
|
||||
'title' => __( 'Button Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'pagination', '=', 'ajax' ),
|
||||
),
|
||||
'pagination_btn_style' => array(
|
||||
'title' => __( 'Button Style', 'us' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_btn_styles(),
|
||||
'std' => '1',
|
||||
'show_if' => array( 'pagination', '=', 'ajax' ),
|
||||
),
|
||||
'pagination_btn_fullwidth' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Stretch to the full width', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'pagination', '=', 'ajax' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
// Appearance
|
||||
$appearance_params = array(
|
||||
'items_layout' => array(
|
||||
'title' => __( 'Grid Layout', 'us' ),
|
||||
'type' => 'us_grid_layout',
|
||||
'admin_label' => TRUE,
|
||||
'std' => 'blog_1',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'type' => array(
|
||||
'title' => __( 'Display as', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'grid' => __( 'Regular Grid', 'us' ),
|
||||
'masonry' => __( 'Masonry', 'us' ),
|
||||
),
|
||||
'std' => 'grid',
|
||||
'admin_label' => TRUE,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'items_valign' => array(
|
||||
'switch_text' => __( 'Center items vertically', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'type', '!=', 'masonry' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'columns' => array(
|
||||
'title' => us_translate( 'Columns' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'1' => '1',
|
||||
'2' => '2',
|
||||
'3' => '3',
|
||||
'4' => '4',
|
||||
'5' => '5',
|
||||
'6' => '6',
|
||||
'7' => '7',
|
||||
'8' => '8',
|
||||
'9' => '9',
|
||||
'10' => '10',
|
||||
),
|
||||
'std' => '2',
|
||||
'admin_label' => TRUE,
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'items_gap' => array(
|
||||
'title' => __( 'Gap between Items', 'us' ),
|
||||
'description' => __( 'Examples:', 'us' ) . ' <span class="usof-example">5px</span>, <span class="usof-example">1.5rem</span>, <span class="usof-example">2vw</span>',
|
||||
'type' => 'text',
|
||||
'std' => '1.5rem',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'img_size' => array(
|
||||
'title' => __( 'Post Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => array_merge(
|
||||
array( 'default' => __( 'As in Grid Layout', 'us' ) ), us_image_sizes_select_values()
|
||||
),
|
||||
'std' => 'default',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'title_size' => array(
|
||||
'title' => __( 'Post Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'overriding_link' => array(
|
||||
'title' => __( 'Overriding Link', 'us' ),
|
||||
'description' => __( 'Applies to every item of this Grid. All Grid Layout elements become not clickable.', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'popup_post' => __( 'Opens a Post in a popup', 'us' ),
|
||||
'popup_post_image' => __( 'Opens a Post Image in a popup', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'popup_width' => array(
|
||||
'title' => __( 'Popup Width', 'us' ),
|
||||
'description' => $misc['desc_width'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'show_if' => array( 'overriding_link', '=', 'popup_post' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'popup_arrows' => array(
|
||||
'switch_text' => __( 'Prev/Next arrows', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'overriding_link', '=', 'popup_post' ),
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
);
|
||||
|
||||
// Filter
|
||||
$filter_params = array_merge(
|
||||
$filter_taxonomies_params, array(
|
||||
'filter_style' => array(
|
||||
'title' => __( 'Filter Bar Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'style_1' => us_translate( 'Style' ) . ' 1',
|
||||
'style_2' => us_translate( 'Style' ) . ' 2',
|
||||
'style_3' => us_translate( 'Style' ) . ' 3',
|
||||
),
|
||||
'std' => 'style_1',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'post_type', 'in', array_keys( $known_post_type_taxonomies ) ),
|
||||
'group' => us_translate( 'Filter' ),
|
||||
),
|
||||
'filter_align' => array(
|
||||
'title' => __( 'Filter Bar Alignment', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'center',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'post_type', 'in', array_keys( $known_post_type_taxonomies ) ),
|
||||
'group' => us_translate( 'Filter' ),
|
||||
),
|
||||
'filter_show_all' => array(
|
||||
'switch_text' => __( 'Show "All" item in filter bar', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'post_type', 'in', array_keys( $known_post_type_taxonomies ) ),
|
||||
'group' => us_translate( 'Filter' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
// Responsive Options
|
||||
$responsive_params = array(
|
||||
'breakpoint_1_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '1200px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_1_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '3',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_2_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '900px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_2_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '2',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_3_width' => array(
|
||||
'title' => __( 'Below screen width', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '600px',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
'breakpoint_3_cols' => array(
|
||||
'title' => __( 'show', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['column_values'],
|
||||
'std' => '1',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Responsive Options', 'js_composer' ),
|
||||
),
|
||||
);
|
||||
|
||||
$grid_config['params'] = array_merge(
|
||||
$general_params, $appearance_params, $filter_params, $responsive_params, $design_options
|
||||
);
|
||||
|
||||
return $grid_config;
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Custom HTML', 'us' ),
|
||||
'icon' => 'fas fa-code',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'content' => array(
|
||||
'description' => sprintf( __( 'Added content will be displayed inside the %s block', 'us' ), '<code><div class="w-html"></div></code>' ),
|
||||
'type' => 'html',
|
||||
'encoded' => TRUE,
|
||||
'std' => '',
|
||||
'classes' => 'desc_2',
|
||||
),
|
||||
|
||||
), $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Horizontal Wrapper', 'us' ),
|
||||
'icon' => 'fas fa-ellipsis-h',
|
||||
'as_parent' => array(
|
||||
'except' => 'vc_row,vc_column,vc_tta_tabs,vc_tta_tour,vc_tta_accordion,vc_tta_section,us_hwrapper',
|
||||
),
|
||||
'show_settings_on_create' => FALSE,
|
||||
'js_view' => 'VcColumnView',
|
||||
'params' => array_merge(
|
||||
array(
|
||||
'alignment' => array(
|
||||
'title' => __( 'Content Horizontal Alignment', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
'justify' => us_translate( 'Justify' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'cols' => 2,
|
||||
),
|
||||
'valign' => array(
|
||||
'title' => __( 'Content Vertical Alignment', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'top' => us_translate( 'Top' ),
|
||||
'middle' => us_translate( 'Middle' ),
|
||||
'bottom' => us_translate( 'Bottom' ),
|
||||
),
|
||||
'std' => 'top',
|
||||
'cols' => 2,
|
||||
),
|
||||
'wrap' => array(
|
||||
'switch_text' => __( 'Allow move content to the next line', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
),
|
||||
), $design_options, $hover_options
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
global $us_template_directory_uri;
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'IconBox', 'us' ),
|
||||
'description' => __( 'Icon, title, description', 'us' ),
|
||||
'admin_enqueue_js' => $us_template_directory_uri . '/framework/plugins-support/js_composer/js/us_icon_view.js',
|
||||
'js_view' => 'ViewUsIcon',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// Icon
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => 'fas|star',
|
||||
),
|
||||
'color' => array(
|
||||
'title' => __( 'Icon Color', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'primary' => __( 'Primary (theme color)', 'us' ),
|
||||
'secondary' => __( 'Secondary (theme color)', 'us' ),
|
||||
'light' => __( 'Border (theme color)', 'us' ),
|
||||
'contrast' => __( 'Text (theme color)', 'us' ),
|
||||
'custom' => __( 'Custom colors', 'us' ),
|
||||
),
|
||||
'std' => 'primary',
|
||||
'cols' => 2,
|
||||
),
|
||||
'style' => array(
|
||||
'title' => __( 'Icon Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'default' => __( 'Simple', 'us' ),
|
||||
'circle' => __( 'Inside the Solid circle', 'us' ),
|
||||
'outlined' => __( 'Inside the Outlined circle', 'us' ),
|
||||
),
|
||||
'std' => 'default',
|
||||
'cols' => 2,
|
||||
),
|
||||
'icon_color' => array(
|
||||
'title' => __( 'Icon Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'circle_color' => array(
|
||||
'title' => __( 'Icon Circle Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'size' => array(
|
||||
'title' => __( 'Icon Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '36px',
|
||||
'cols' => 2,
|
||||
),
|
||||
'iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'top' => us_translate( 'Top' ),
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'top',
|
||||
'cols' => 2,
|
||||
),
|
||||
|
||||
// Title & Description
|
||||
'title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'title_size' => array(
|
||||
'title' => __( 'Title Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'title', '!=', '' ),
|
||||
),
|
||||
'title_tag' => array(
|
||||
'title' => __( 'Title HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h4',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'title', '!=', '' ),
|
||||
),
|
||||
'content' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'type' => 'editor',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
),
|
||||
|
||||
// More Options
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'description' => __( 'Will be applied to the icon and title', 'us' ),
|
||||
'type' => 'link',
|
||||
'std' => '',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'alignment' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'center',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'img' => array(
|
||||
'title' => us_translate( 'Image' ),
|
||||
'description' => __( 'Will be shown instead of the icon', 'us' ),
|
||||
'type' => 'upload',
|
||||
'is_multiple' => FALSE,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,255 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => us_translate( 'Image' ),
|
||||
'icon' => 'icon-wpb-single-image',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'img' => array(
|
||||
'type' => 'upload',
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'context' => array( 'header', 'grid' ),
|
||||
),
|
||||
'image' => array(
|
||||
'type' => 'upload',
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'shortcode_cols' => 2,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'size' => array(
|
||||
'title' => __( 'Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'style' => array(
|
||||
'title' => __( 'Image Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'None' ),
|
||||
'circle' => __( 'Circle', 'us' ),
|
||||
'outlined' => __( 'Outlined', 'us' ),
|
||||
'shadow-1' => __( 'Simple Shadow', 'us' ),
|
||||
'shadow-2' => __( 'Colored Shadow', 'us' ),
|
||||
'phone6-1' => __( 'Phone 6 Black Realistic', 'us' ),
|
||||
'phone6-2' => __( 'Phone 6 White Realistic', 'us' ),
|
||||
'phone6-3' => __( 'Phone 6 Black Flat', 'us' ),
|
||||
'phone6-4' => __( 'Phone 6 White Flat', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'meta' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show image title and description', 'us' ),
|
||||
'std' => FALSE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'meta_style' => array(
|
||||
'title' => __( 'Title and Description Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'simple' => __( 'Below the image', 'us' ),
|
||||
'modern' => __( 'Over the image', 'us' ),
|
||||
),
|
||||
'std' => 'simple',
|
||||
'show_if' => array( 'meta', '!=', FALSE ),
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'onclick' => array(
|
||||
'title' => __( 'On click action', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'None' ),
|
||||
'lightbox' => __( 'Open original image in a popup', 'us' ),
|
||||
'custom_link' => __( 'Open custom link', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'link' => array(
|
||||
'header_title' => us_translate( 'Link' ),
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'shortcode_show_if' => array( 'onclick', '=', 'custom_link' ),
|
||||
),
|
||||
'img_transparent' => array(
|
||||
'title' => __( 'Different Image for Transparent Header', 'us' ),
|
||||
'type' => 'upload',
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'animate' => array(
|
||||
'title' => __( 'Animation', 'us' ),
|
||||
'description' => __( 'Selected animation will be applied to this element, when it enters into the browsers viewport.', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'None' ),
|
||||
'fade' => __( 'Fade', 'us' ),
|
||||
'afc' => __( 'Appear From Center', 'us' ),
|
||||
'afl' => __( 'Appear From Left', 'us' ),
|
||||
'afr' => __( 'Appear From Right', 'us' ),
|
||||
'afb' => __( 'Appear From Bottom', 'us' ),
|
||||
'aft' => __( 'Appear From Top', 'us' ),
|
||||
'hfc' => __( 'Height From Center', 'us' ),
|
||||
'wfc' => __( 'Width From Center', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'admin_label' => TRUE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'animate_delay' => array(
|
||||
'title' => __( 'Animation Delay (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'show_if' => array( 'animate', '!=', '' ),
|
||||
'admin_label' => TRUE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
|
||||
// Sizes
|
||||
'heading_1' => array(
|
||||
'title' => __( 'Default Sizes', 'us' ),
|
||||
'type' => 'heading',
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'height' => array(
|
||||
'title' => us_translate( 'Height' ),
|
||||
'type' => 'slider',
|
||||
'std' => '35px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'height_tablets' => array(
|
||||
'title' => __( 'Height on Tablets', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '30px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'height_mobiles' => array(
|
||||
'title' => __( 'Height on Mobiles', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '20px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'heading_2' => array(
|
||||
'title' => __( 'Sizes in the Sticky Header', 'us' ),
|
||||
'type' => 'heading',
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
),
|
||||
'height_sticky' => array(
|
||||
'title' => us_translate( 'Height' ),
|
||||
'type' => 'slider',
|
||||
'std' => '35px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'height_sticky_tablets' => array(
|
||||
'title' => __( 'Height on Tablets', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '30px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
'height_sticky_mobiles' => array(
|
||||
'title' => __( 'Height on Mobiles', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '20px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 20,
|
||||
'max' => 300,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 1,
|
||||
'max' => 20,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
'group' => __( 'Sizes', 'us' ),
|
||||
'context' => array( 'header' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Image Slider', 'us' ),
|
||||
'icon' => 'icon-wpb-images-carousel',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'ids' => array(
|
||||
'title' => us_translate( 'Images' ),
|
||||
'type' => 'upload',
|
||||
'is_multiple' => TRUE,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg', // sets available file types
|
||||
),
|
||||
'arrows' => array(
|
||||
'title' => __( 'Prev/Next arrows', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'always' => __( 'Show always', 'us' ),
|
||||
'hover' => __( 'Show on hover', 'us' ),
|
||||
'hide' => us_translate( 'Hide' ),
|
||||
),
|
||||
'std' => 'always',
|
||||
'cols' => 2,
|
||||
),
|
||||
'nav' => array(
|
||||
'title' => __( 'Additional Navigation', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'dots' => __( 'Dots', 'us' ),
|
||||
'thumbs' => __( 'Thumbnails', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'cols' => 2,
|
||||
),
|
||||
'transition' => array(
|
||||
'title' => __( 'Transition Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'slide' => __( 'Slide', 'us' ),
|
||||
'crossfade' => __( 'Fade', 'us' ),
|
||||
),
|
||||
'std' => 'slide',
|
||||
'cols' => 2,
|
||||
),
|
||||
'transition_speed' => array(
|
||||
'title' => __( 'Slide Speed (in milliseconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '300',
|
||||
'cols' => 2,
|
||||
),
|
||||
'meta' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show image title and description', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'orderby' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Display items in random order', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'fullscreen' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Allow Full Screen view', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'autoplay' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Auto Rotation', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'pause_on_hover' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Pause on hover', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'autoplay', '!=', FALSE ),
|
||||
),
|
||||
'autoplay_period' => array(
|
||||
'title' => __( 'Auto Rotation Interval (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '3',
|
||||
'show_if' => array( 'autoplay', '!=', FALSE ),
|
||||
),
|
||||
'img_size' => array(
|
||||
'title' => __( 'Images Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'img_fit' => array(
|
||||
'title' => __( 'Images Fit', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'scaledown' => __( 'Initial', 'us' ),
|
||||
'contain' => __( 'Fit to Area', 'us' ),
|
||||
'cover' => __( 'Fill Area', 'us' ),
|
||||
),
|
||||
'std' => 'scaledown',
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'style' => array(
|
||||
'title' => __( 'Images Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'phone6-1' => __( 'Phone 6 Black Realistic', 'us' ),
|
||||
'phone6-2' => __( 'Phone 6 White Realistic', 'us' ),
|
||||
'phone6-3' => __( 'Phone 6 Black Flat', 'us' ),
|
||||
'phone6-4' => __( 'Phone 6 White Flat', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Interactive Text', 'us' ),
|
||||
'description' => __( 'Text with dynamically changing part', 'us' ),
|
||||
'icon' => 'fas fa-italic',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'texts' => array(
|
||||
'title' => __( 'Text States', 'us' ),
|
||||
'description' => __( 'Each value on a new line', 'us' ),
|
||||
'type' => 'textarea',
|
||||
'std' => 'We create great design' . "\n" . 'We create great websites' . "\n" . 'We create great code',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'dynamic_bold' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Make the dynamic part bold', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
|
||||
), $typography_options, array(
|
||||
|
||||
// More Options
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'center',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'tag' => array(
|
||||
'title' => __( 'HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h2',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'color' => array(
|
||||
'title' => __( 'Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'dynamic_color' => array(
|
||||
'title' => __( 'Dynamic Part Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'animation_type' => array(
|
||||
'title' => __( 'Animation', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'fadeIn' => __( 'Fade in the whole part', 'us' ),
|
||||
'flipInX' => __( 'Flip the whole part', 'us' ),
|
||||
'flipInXChars' => __( 'Flip character by character', 'us' ),
|
||||
'zoomIn' => __( 'Zoom in the whole part', 'us' ),
|
||||
'zoomInChars' => __( 'Zoom in character by character', 'us' ),
|
||||
),
|
||||
'std' => 'fadeIn',
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'duration' => array(
|
||||
'title' => __( 'Animation Duration (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '0.3',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
'delay' => array(
|
||||
'title' => __( 'Animation Delay (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '5',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Appearance' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,252 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => us_translate( 'Menu' ),
|
||||
'icon' => 'fas fa-bars',
|
||||
'params' => array_merge( array(
|
||||
'source' => array(
|
||||
'title' => us_translate( 'Menu' ),
|
||||
'description' => $misc['desc_menu_select'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_nav_menus(),
|
||||
'std' => 'header-menu',
|
||||
),
|
||||
'font' => array(
|
||||
'title' => __( 'Font', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => us_get_fonts(),
|
||||
'std' => 'body',
|
||||
),
|
||||
'font_weight' => array(
|
||||
'title' => __( 'Font Weight', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'100' => '100 ' . __( 'thin', 'us' ),
|
||||
'200' => '200 ' . __( 'extra-light', 'us' ),
|
||||
'300' => '300 ' . __( 'light', 'us' ),
|
||||
'400' => '400 ' . __( 'normal', 'us' ),
|
||||
'500' => '500 ' . __( 'medium', 'us' ),
|
||||
'600' => '600 ' . __( 'semi-bold', 'us' ),
|
||||
'700' => '700 ' . __( 'bold', 'us' ),
|
||||
'800' => '800 ' . __( 'extra-bold', 'us' ),
|
||||
'900' => '900 ' . __( 'ultra-bold', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
'text_transform' => array(
|
||||
'title' => __( 'Text Transform', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
'uppercase' => 'UPPERCASE',
|
||||
'lowercase' => 'lowercase',
|
||||
'capitalize' => 'Capitalize',
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
'font_style' => array(
|
||||
'title' => __( 'Font Style', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'' => us_translate( 'Default' ),
|
||||
'normal' => __( 'normal', 'us' ),
|
||||
'italic' => __( 'italic', 'us' ),
|
||||
),
|
||||
'std' => '',
|
||||
'cols' => 3,
|
||||
),
|
||||
'font_size' => array(
|
||||
'title' => __( 'Main Items Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '1rem',
|
||||
'cols' => 2,
|
||||
),
|
||||
'indents' => array(
|
||||
'title' => __( 'Distance Between Main Items', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '20px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 0,
|
||||
'max' => 50,
|
||||
),
|
||||
'rem' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 3.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'em' => array(
|
||||
'min' => 0.0,
|
||||
'max' => 3.0,
|
||||
'step' => 0.1,
|
||||
),
|
||||
'vw' => array(
|
||||
'min' => 0,
|
||||
'max' => 10,
|
||||
),
|
||||
'vh' => array(
|
||||
'min' => 0,
|
||||
'max' => 10,
|
||||
),
|
||||
),
|
||||
'cols' => 2,
|
||||
),
|
||||
'vstretch' => array(
|
||||
'title' => __( 'Main Items Height', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Stretch to the full available height', 'us' ),
|
||||
'std' => TRUE,
|
||||
),
|
||||
'hover_effect' => array(
|
||||
'title' => __( 'Main Items Hover Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'simple' => __( 'Simple', 'us' ),
|
||||
'underline' => us_translate( 'Underline' ),
|
||||
),
|
||||
'std' => 'simple',
|
||||
),
|
||||
'dropdown_arrow' => array(
|
||||
'title' => __( 'Dropdown Indication', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show arrows for main items with dropdown', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Dropdowns', 'us' ),
|
||||
),
|
||||
'dropdown_effect' => array(
|
||||
'title' => __( 'Dropdown Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['dropdown_effect_values'],
|
||||
'std' => 'height',
|
||||
'group' => __( 'Dropdowns', 'us' ),
|
||||
),
|
||||
'dropdown_font_size' => array(
|
||||
'title' => __( 'Dropdown Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '1rem',
|
||||
'group' => __( 'Dropdowns', 'us' ),
|
||||
),
|
||||
'dropdown_width' => array(
|
||||
'title' => __( 'Dropdown Width', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Limit full-width dropdowns by a menu width', 'us' ),
|
||||
'std' => FALSE,
|
||||
'group' => __( 'Dropdowns', 'us' ),
|
||||
),
|
||||
'mobile_width' => array(
|
||||
'title' => __( 'Show mobile menu when screen width is less than', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '900px',
|
||||
'options' => array(
|
||||
'px' => array(
|
||||
'min' => 300,
|
||||
'max' => 2000,
|
||||
'step' => 10,
|
||||
),
|
||||
),
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_layout' => array(
|
||||
'title' => __( 'Mobile Menu Layout', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'dropdown' => __( 'Dropdown', 'us' ),
|
||||
'panel' => __( 'Vertical Panel', 'us' ),
|
||||
'fullscreen' => __( 'Full Screen', 'us' ),
|
||||
),
|
||||
'std' => 'dropdown',
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_effect_p' => array(
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'afl' => __( 'Appear From Left', 'us' ),
|
||||
'afr' => __( 'Appear From Right', 'us' ),
|
||||
),
|
||||
'std' => 'afl',
|
||||
'show_if' => array( 'mobile_layout', '=', 'panel' ),
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_effect_f' => array(
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'aft' => __( 'Appear From Top', 'us' ),
|
||||
'afc' => __( 'Appear From Center', 'us' ),
|
||||
'afb' => __( 'Appear From Bottom', 'us' ),
|
||||
),
|
||||
'std' => 'aft',
|
||||
'show_if' => array( 'mobile_layout', '=', 'fullscreen' ),
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_font_size' => array(
|
||||
'title' => __( 'Main Items Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '1.1rem',
|
||||
'cols' => 2,
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_dropdown_font_size' => array(
|
||||
'title' => __( 'Dropdown Font Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '0.9rem',
|
||||
'cols' => 2,
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_align' => array(
|
||||
'title' => __( 'Menu Items Alignment', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_behavior' => array(
|
||||
'title' => __( 'Dropdown Behavior', 'us' ),
|
||||
'description' => __( 'When this option is OFF, mobile menu dropdown will be shown by click on an arrow only.', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show dropdown by click on menu item title', 'us' ),
|
||||
'std' => TRUE,
|
||||
'classes' => 'desc_2',
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_icon_size' => array(
|
||||
'title' => __( 'Icon Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_icon_size_tablets' => array(
|
||||
'title' => __( 'Icon Size on Tablets', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
'mobile_icon_size_mobiles' => array(
|
||||
'title' => __( 'Icon Size on Mobiles', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => '20px',
|
||||
'cols' => 3,
|
||||
'group' => __( 'Mobile Menu', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Message Box', 'us' ),
|
||||
'description' => __( 'Colored notification box', 'us' ),
|
||||
'icon' => 'icon-wpb-information-white',
|
||||
'js_view' => 'VcMessageView',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'color' => array(
|
||||
'title' => us_translate( 'Color' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'blue' => __( 'Blue', 'us' ),
|
||||
'yellow' => __( 'Yellow', 'us' ),
|
||||
'green' => __( 'Green', 'us' ),
|
||||
'red' => __( 'Red', 'us' ),
|
||||
'custom' => us_translate( 'Custom' ),
|
||||
),
|
||||
'std' => 'blue',
|
||||
),
|
||||
'bg_color' => array(
|
||||
'title' => __( 'Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'holder' => 'div',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'text_color' => array(
|
||||
'title' => __( 'Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'holder' => 'div',
|
||||
'std' => '',
|
||||
'show_if' => array( 'color', '=', 'custom' ),
|
||||
),
|
||||
'content' => array(
|
||||
'title' => __( 'Message Text', 'us' ),
|
||||
'type' => 'textarea',
|
||||
'holder' => 'div',
|
||||
'std' => 'I am message box. Click edit button to change this text.',
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
),
|
||||
'closing' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Enable closing', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
// Get Page Blocks
|
||||
$us_page_blocks_list = us_get_posts_titles_for( 'us_page_block' );
|
||||
|
||||
// Visual Composer sends 'post_id' POST variable to the element popup. We will use it to remove current page block from list.
|
||||
if ( ! empty( $_POST['post_id'] ) AND isset( $us_page_blocks_list[ $_POST['post_id'] ] ) ) {
|
||||
unset( $us_page_blocks_list[ $_POST['post_id'] ] );
|
||||
}
|
||||
|
||||
|
||||
return array(
|
||||
'title' => __( 'Page Block', 'us' ),
|
||||
'icon' => 'far fa-square',
|
||||
'params' => array(
|
||||
|
||||
'id' => array(
|
||||
'title' => __( 'Page Block', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $us_page_blocks_list,
|
||||
'std' => '',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'remove_rows' => array(
|
||||
'switch_text' => __( 'Exclude Rows and Columns in selected Page Block', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
),
|
||||
'force_fullwidth_rows' => array(
|
||||
'switch_text' => __( 'Stretch content of Rows to the full width', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'remove_rows', '=', '' ),
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Page Title', 'us' ),
|
||||
'icon' => 'fas fa-font',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'tag' => array(
|
||||
'title' => __( 'HTML tag', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h1',
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'color' => array(
|
||||
'title' => us_translate( 'Color' ),
|
||||
'type' => 'color',
|
||||
'std' => '',
|
||||
),
|
||||
'inline' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show the next text in the same line', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'align', '=', array( 'left', 'right' ) ),
|
||||
),
|
||||
'description' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show archive pages description', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
|
||||
), $typography_options, $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Person', 'us' ),
|
||||
'description' => __( 'Photo, name, description and social links', 'us' ),
|
||||
'icon' => 'fas fa-user',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'image' => array(
|
||||
'title' => __( 'Photo', 'us' ),
|
||||
'type' => 'upload',
|
||||
'is_multiple' => FALSE,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'cols' => 2,
|
||||
),
|
||||
'image_hover' => array(
|
||||
'title' => __( 'Photo on hover (optional)', 'us' ),
|
||||
'type' => 'upload',
|
||||
'is_multiple' => FALSE,
|
||||
'extension' => 'png,jpg,jpeg,gif,svg',
|
||||
'cols' => 2,
|
||||
),
|
||||
'name' => array(
|
||||
'title' => us_translate( 'Name' ),
|
||||
'type' => 'text',
|
||||
'std' => 'John Doe',
|
||||
'holder' => 'div',
|
||||
'cols' => 2,
|
||||
),
|
||||
'role' => array(
|
||||
'title' => __( 'Role', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => 'UpSolution Team',
|
||||
'holder' => 'div',
|
||||
'cols' => 2,
|
||||
),
|
||||
'content' => array(
|
||||
'title' => us_translate( 'Description' ),
|
||||
'type' => 'textarea',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
),
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'description' => __( 'Applies to the Name and to the Photo', 'us' ),
|
||||
'type' => 'link',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
// More Options
|
||||
'layout' => array(
|
||||
'title' => __( 'Layout', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'simple' => __( 'Simple', 'us' ),
|
||||
'simple_circle' => __( 'Simple (rounded photo)', 'us' ),
|
||||
'square' => __( 'Compact', 'us' ),
|
||||
'circle' => __( 'Compact (rounded photo)', 'us' ),
|
||||
'modern' => __( 'Modern', 'us' ),
|
||||
'trendy' => __( 'Trendy', 'us' ),
|
||||
),
|
||||
'std' => 'circle',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'effect' => array(
|
||||
'title' => __( 'Photo Effect', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'None' ),
|
||||
'sepia' => __( 'Sepia', 'us' ),
|
||||
'bw' => __( 'Black & White', 'us' ),
|
||||
'faded' => __( 'Faded', 'us' ),
|
||||
'colored' => __( 'Colored', 'us' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'img_size' => array(
|
||||
'title' => __( 'Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'us_350_350_crop',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'email' => array(
|
||||
'title' => us_translate( 'Email' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'facebook' => array(
|
||||
'title' => 'Facebook',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'twitter' => array(
|
||||
'title' => 'Twitter',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'google_plus' => array(
|
||||
'title' => 'Google',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'linkedin' => array(
|
||||
'title' => 'LinkedIn',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'skype' => array(
|
||||
'title' => 'Skype',
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'custom_link' => array(
|
||||
'title' => __( 'Custom Link', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
'custom_icon' => array(
|
||||
'title' => __( 'Custom Link Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => 'fas|star',
|
||||
'show_if' => array( 'custom_link', '!=', '' ),
|
||||
'group' => __( 'More Options', 'us' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$body_fontsize = us_get_option( 'body_fontsize', '16px' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Popup', 'us' ),
|
||||
'description' => __( 'Window appears in the foreground of the page content', 'us' ),
|
||||
'icon' => 'fas fa-window-restore',
|
||||
'params' => array_merge( array(
|
||||
|
||||
// General
|
||||
'title' => array(
|
||||
'title' => us_translate( 'Title' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'holder' => 'div',
|
||||
'group' => us_translate( 'Content' ),
|
||||
),
|
||||
'content' => array(
|
||||
'type' => 'editor',
|
||||
'std' => __( 'This content will appear inside a popup...', 'us' ),
|
||||
'group' => us_translate( 'Content' ),
|
||||
),
|
||||
|
||||
// Trigger
|
||||
'show_on' => array(
|
||||
'title' => __( 'Show Popup on', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'btn' => __( 'Button click', 'us' ),
|
||||
'image' => __( 'Image click', 'us' ),
|
||||
'selector' => __( 'Custom element click', 'us' ),
|
||||
'load' => __( 'Page load', 'us' ),
|
||||
),
|
||||
'std' => 'btn',
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'btn_label' => array(
|
||||
'title' => __( 'Button Label', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => __( 'Click Me', 'us' ),
|
||||
'cols' => 2,
|
||||
'admin_label' => TRUE,
|
||||
'show_if' => array( 'show_on', '=', 'btn' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'btn_size' => array(
|
||||
'title' => __( 'Button Size', 'us' ),
|
||||
'description' => $misc['desc_font_size'],
|
||||
'type' => 'text',
|
||||
'std' => $body_fontsize,
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'show_on', '=', 'btn' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'btn_style' => array(
|
||||
'title' => __( 'Button Style', 'us' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => us_get_btn_styles(),
|
||||
'std' => '1',
|
||||
'show_if' => array( 'show_on', '=', 'btn' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'image' => array(
|
||||
'title' => us_translate( 'Image' ),
|
||||
'type' => 'upload',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'show_on', '=', 'image' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'image_size' => array(
|
||||
'title' => __( 'Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'show_on', '=', 'image' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'show_if' => array( 'show_on', 'in', array( 'btn', 'image', 'text' ) ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'btn_icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array( 'show_on', '=', 'btn' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'btn_iconpos' => array(
|
||||
'title' => __( 'Icon Position', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'left' => us_translate( 'Left' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'left',
|
||||
'show_if' => array( 'show_on', '=', 'btn' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'trigger_selector' => array(
|
||||
'title' => __( 'Custom element CSS selector', 'us' ),
|
||||
'description' => __( 'Use class or ID.', 'us' ) . ' ' . __( 'Examples:', 'us' ) . ' <span class="usof-example">.my-element</span>, <span class="usof-example">#my-element</span>',
|
||||
'type' => 'text',
|
||||
'std' => '.my-element',
|
||||
'show_if' => array( 'show_on', '=', 'selector' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
'show_delay' => array(
|
||||
'title' => __( 'Delay after page load (in seconds)', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '2',
|
||||
'show_if' => array( 'show_on', '=', 'load' ),
|
||||
'group' => __( 'Trigger', 'us' ),
|
||||
),
|
||||
|
||||
// Style
|
||||
'popup_width' => array(
|
||||
'title' => __( 'Popup Width', 'us' ),
|
||||
'description' => $misc['desc_width'],
|
||||
'type' => 'text',
|
||||
'std' => '600px',
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'popup_padding' => array(
|
||||
'title' => __( 'Popup Padding', 'us' ),
|
||||
'description' => $misc['desc_padding'],
|
||||
'type' => 'text',
|
||||
'std' => '5%',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'popup_border_radius' => array(
|
||||
'title' => __( 'Popup Corners Radius', 'us' ),
|
||||
'description' => $misc['desc_border_radius'],
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'cols' => 2,
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'title_bgcolor' => array(
|
||||
'title' => __( 'Title Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => us_get_color( 'color_content_bg_alt', TRUE ),
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'title_textcolor' => array(
|
||||
'title' => __( 'Title Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => us_get_color( 'color_content_heading' ),
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'content_bgcolor' => array(
|
||||
'title' => __( 'Popup Background Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => us_get_color( 'color_content_bg', TRUE ),
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'content_textcolor' => array(
|
||||
'title' => __( 'Popup Text Color', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => us_get_color( 'color_content_text' ),
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'overlay_bgcolor' => array(
|
||||
'title' => __( 'Background Overlay', 'us' ),
|
||||
'type' => 'color',
|
||||
'std' => 'rgba(0,0,0,0.85)',
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
'animation' => array(
|
||||
'title' => __( 'Animation Type', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'fadeIn' => __( 'Fade', 'us' ),
|
||||
'scaleUp' => __( 'Scale Up', 'us' ),
|
||||
'scaleDown' => __( 'Scale Down', 'us' ),
|
||||
'slideTop' => __( 'Slide from the Top', 'us' ),
|
||||
'slideBottom' => __( 'Slide from the Bottom', 'us' ),
|
||||
'flipHor' => __( '3D Flip', 'us' ) . ' (' . __( 'Horizontal', 'us' ) . ')',
|
||||
'flipVer' => __( '3D Flip', 'us' ) . ' (' . __( 'Vertical', 'us' ) . ')',
|
||||
),
|
||||
'std' => 'fadeIn',
|
||||
'group' => us_translate( 'Style' ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Author', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-user',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'author_page' => __( 'To the page with the Author\'s posts', 'us' ),
|
||||
'author_website' => __( 'To the Author\'s website (if specified on his profile)', 'us' ),
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'std' => 'author_page',
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'color_link' => array(
|
||||
'title' => __( 'Link Color', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Inherit from text color', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'link', '!=', 'none' ),
|
||||
),
|
||||
'avatar' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => us_translate( 'Profile Picture' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'avatar_width' => array(
|
||||
'title' => __( 'Picture Width', 'us' ),
|
||||
'description' => $misc['desc_pixels'],
|
||||
'type' => 'text',
|
||||
'std' => '96px',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'avatar', '!=', FALSE ),
|
||||
),
|
||||
'avatar_pos' => array(
|
||||
'title' => __( 'Picture Position', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'top' => us_translate( 'Top' ),
|
||||
'left' => us_translate( 'Left' ),
|
||||
),
|
||||
'std' => 'top',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'avatar', '!=', FALSE ),
|
||||
),
|
||||
'posts_count' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Posts count', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'website' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => us_translate( 'Website' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'info' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => us_translate( 'Biographical Info' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Comments', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-comments-alt',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'layout' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'comments_template' => __( 'List of comments with response form', 'us' ),
|
||||
'amount' => __( 'Comments amount', 'us' ),
|
||||
),
|
||||
'std' => 'comments_template',
|
||||
'admin_label' => TRUE,
|
||||
'context' => array( 'shortcode' ),
|
||||
),
|
||||
'hide_zero' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Hide this element if no comments', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'layout', '=', 'amount' ),
|
||||
),
|
||||
'number' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show only number', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'layout', '=', 'amount' ),
|
||||
),
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post comments', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'std' => 'post',
|
||||
'show_if' => array( 'layout', '=', 'amount' ),
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'color_link' => array(
|
||||
'title' => __( 'Link Color', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Inherit from text color', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'link', '!=', 'none' ),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array( 'layout', '=', 'amount' ),
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Content', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-align-justify',
|
||||
'shortcode_post_type' => array( 'us_page_block' ),
|
||||
'params' => array_merge( array(
|
||||
|
||||
'type' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'excerpt_content' => __( 'Excerpt, if it\'s empty, show part of a content', 'us' ),
|
||||
'excerpt_only' => __( 'Excerpt, if it\'s empty, show nothing', 'us' ),
|
||||
'part_content' => __( 'Part of a content', 'us' ),
|
||||
'full_content' => __( 'Full content', 'us' ),
|
||||
),
|
||||
'std' => 'excerpt_content',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'force_fullwidth_rows' => array(
|
||||
'switch_text' => __( 'Stretch content of Rows to the full width', 'us' ),
|
||||
'type' => 'switch',
|
||||
'std' => FALSE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'type', '=', 'full_content' ),
|
||||
),
|
||||
'length' => array(
|
||||
'title' => __( 'Amount of words', 'us' ),
|
||||
'description' => __( 'All HTML tags of a content will be stripped', 'us' ),
|
||||
'type' => 'slider',
|
||||
'std' => '30',
|
||||
'options' => array(
|
||||
'' => array(
|
||||
'min' => 1,
|
||||
'max' => 100,
|
||||
),
|
||||
),
|
||||
'show_if' => array( 'type', 'in', array( 'excerpt_content', 'part_content' ) ),
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$custom_fields_options = array_merge( us_get_custom_fields(), array( 'custom' => __( 'Custom Field', 'us' ) ) );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Custom Field', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-cog',
|
||||
'params' => array_merge( array(
|
||||
'key' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => $custom_fields_options,
|
||||
'std' => key( $custom_fields_options ),
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'custom_key' => array(
|
||||
'description' => __( 'Enter custom field name to retrieve its value.', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
'admin_label' => TRUE,
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'key', '=', 'custom' ),
|
||||
),
|
||||
'hide_empty' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Hide this element if its value is empty', 'us' ),
|
||||
'std' => FALSE,
|
||||
'show_if' => array( 'key', '!=', 'us_testimonial_rating' ),
|
||||
),
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'color_link' => array(
|
||||
'title' => __( 'Link Color', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Inherit from text color', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'link', '!=', 'none' ),
|
||||
),
|
||||
'thumbnail_size' => array(
|
||||
'title' => __( 'Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'show_if' => array( 'key', '!=', 'us_testimonial_rating' ),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
'show_if' => array( 'key', '!=', 'us_testimonial_rating' ),
|
||||
),
|
||||
'text_before' => array(
|
||||
'title' => __( 'Text before value', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Date', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-calendar-alt',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'type' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'published' => __( 'Date of creation', 'us' ),
|
||||
'modified' => __( 'Date of update', 'us' ),
|
||||
),
|
||||
'std' => 'published',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'format' => array(
|
||||
'title' => __( 'Format', 'us' ),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'smart' => __( 'Human friendly', 'us' ),
|
||||
'default' => us_translate( 'Default' ) . ': ' . date_i18n( get_option( 'date_format' ) ),
|
||||
'jS F Y' => date_i18n( 'jS F Y' ),
|
||||
'j M, G:i' => date_i18n( 'j M, G:i' ),
|
||||
'm/d/Y' => date_i18n( 'm/d/Y' ),
|
||||
'j.m.y' => date_i18n( 'j.m.y' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
),
|
||||
'std' => 'default',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'format_custom' => array(
|
||||
'description' => '<a href="https://codex.wordpress.org/Formatting_Date_and_Time" target="_blank">' . __( 'Documentation on date and time formatting.', 'us' ) . '</a>',
|
||||
'type' => 'text',
|
||||
'std' => 'F j, Y',
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'format', '=', 'custom' ),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
),
|
||||
'text_before' => array(
|
||||
'title' => __( 'Text before value', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Image', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-image',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'grid_std' => 'post',
|
||||
'shortcode_std' => 'none',
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'placeholder' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show placeholder when post image is absent', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'media_preview' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Show media preview for posts with video, audio and gallery format', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'stretch' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Stretch the image to the container width', 'us' ),
|
||||
'std' => TRUE,
|
||||
),
|
||||
'circle' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Enable rounded image', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'thumbnail_size' => array(
|
||||
'title' => __( 'Image Size', 'us' ),
|
||||
'description' => $misc['desc_img_sizes'],
|
||||
'type' => 'select',
|
||||
'options' => us_image_sizes_select_values(),
|
||||
'std' => 'large',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
|
||||
), $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$taxonomies_options = us_get_taxonomies();
|
||||
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Prev/Next Navigation', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-exchange',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'layout' => array(
|
||||
'title' => __( 'Layout', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'simple' => __( 'Simple links', 'us' ),
|
||||
'sided' => __( 'On sides of the screen', 'us' ),
|
||||
),
|
||||
'std' => 'simple',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'invert' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Invert position of previous and next', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'in_same_term' => array(
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Navigate within the specified taxonomy', 'us' ),
|
||||
'std' => FALSE,
|
||||
),
|
||||
'taxonomy' => array(
|
||||
'type' => 'select',
|
||||
'options' => $taxonomies_options,
|
||||
'std' => key( $taxonomies_options ),
|
||||
'classes' => 'for_above',
|
||||
'show_if' => array( 'in_same_term', '!=', FALSE ),
|
||||
),
|
||||
|
||||
), $design_options ),
|
||||
);
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$taxonomies_options = us_get_taxonomies();
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Taxonomy', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-tags',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'taxonomy_name' => array(
|
||||
'title' => us_translate( 'Show' ),
|
||||
'type' => 'select',
|
||||
'options' => $taxonomies_options,
|
||||
'std' => key( $taxonomies_options ),
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'style' => array(
|
||||
'title' => __( 'Display as', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'simple' => us_translate( 'Text' ),
|
||||
'badge' => __( 'Button', 'us' ),
|
||||
),
|
||||
'std' => 'simple',
|
||||
'cols' => 2,
|
||||
),
|
||||
'btn_style' => array(
|
||||
'title' => __( 'Button Style', 'us' ),
|
||||
'description' => $misc['desc_btn_styles'],
|
||||
'type' => 'select',
|
||||
'options' => us_array_merge(
|
||||
array( 'badge' => '– ' . __( 'Badge by default', 'us' ) . ' –' ),
|
||||
us_get_btn_styles()
|
||||
),
|
||||
'std' => 'badge',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'style', '=', 'badge' ),
|
||||
),
|
||||
'separator' => array(
|
||||
'title' => __( 'Separator between items', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => ', ',
|
||||
'cols' => 2,
|
||||
'show_if' => array( 'style', '=', 'simple' ),
|
||||
),
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'archive' => __( 'To a Post Archive', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'std' => 'archive',
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'color_link' => array(
|
||||
'title' => __( 'Link Color', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Inherit from text color', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'link', '!=', 'none' ),
|
||||
),
|
||||
'icon' => array(
|
||||
'title' => __( 'Icon', 'us' ),
|
||||
'type' => 'icon',
|
||||
'std' => '',
|
||||
),
|
||||
'text_before' => array(
|
||||
'title' => __( 'Text before value', 'us' ),
|
||||
'type' => 'text',
|
||||
'std' => '',
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
|
||||
|
||||
$misc = us_config( 'elements_misc' );
|
||||
$typography_options = us_config( 'elements_typography_options' );
|
||||
$design_options = us_config( 'elements_design_options' );
|
||||
$hover_options = us_config( 'elements_hover_options' );
|
||||
|
||||
return array(
|
||||
'title' => __( 'Post Title', 'us' ),
|
||||
'category' => __( 'Post Elements', 'us' ),
|
||||
'icon' => 'fas fa-font',
|
||||
'params' => array_merge( array(
|
||||
|
||||
'link' => array(
|
||||
'title' => us_translate( 'Link' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'post' => __( 'To a Post', 'us' ),
|
||||
'custom' => __( 'Custom', 'us' ),
|
||||
'none' => us_translate( 'None' ),
|
||||
),
|
||||
'grid_std' => 'post',
|
||||
'shortcode_std' => 'none',
|
||||
),
|
||||
'custom_link' => array(
|
||||
'placeholder' => us_translate( 'Enter the URL' ),
|
||||
'description' => $misc['desc_grid_custom_link'],
|
||||
'type' => 'link',
|
||||
'std' => array(),
|
||||
'shortcode_std' => '',
|
||||
'grid_classes' => 'desc_3',
|
||||
'show_if' => array( 'link', '=', 'custom' ),
|
||||
),
|
||||
'color_link' => array(
|
||||
'title' => __( 'Link Color', 'us' ),
|
||||
'type' => 'switch',
|
||||
'switch_text' => __( 'Inherit from text color', 'us' ),
|
||||
'std' => TRUE,
|
||||
'show_if' => array( 'link', '!=', 'none' ),
|
||||
),
|
||||
'align' => array(
|
||||
'title' => us_translate( 'Alignment' ),
|
||||
'type' => 'radio',
|
||||
'options' => array(
|
||||
'none' => us_translate( 'Default' ),
|
||||
'left' => us_translate( 'Left' ),
|
||||
'center' => us_translate( 'Center' ),
|
||||
'right' => us_translate( 'Right' ),
|
||||
),
|
||||
'std' => 'none',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
'tag' => array(
|
||||
'title' => __( 'HTML tag', 'us' ),
|
||||
'type' => 'radio',
|
||||
'options' => $misc['html_tag_values'],
|
||||
'std' => 'h2',
|
||||
'admin_label' => TRUE,
|
||||
),
|
||||
|
||||
), $typography_options, $design_options, $hover_options ),
|
||||
);
|
||||