Ejemplo n.º 1
0
function siteorigin_metaslider_install_link()
{
    if (function_exists('siteorigin_plugin_activation_install_url')) {
        return siteorigin_plugin_activation_install_url('ml-slider', 'MetaSlider');
    } else {
        return 'http://downloads.wordpress.org/plugin/ml-slider.zip';
    }
}
Ejemplo n.º 2
0
/**
 * Render the video metabox.
 */
function focus_video_metabox_render()
{
    $install_url = siteorigin_plugin_activation_install_url('focus-videos', __('Focus Videos', 'focus'), 'http://gpriday.s3.amazonaws.com/plugins/focus-videos.zip');
    ?>
	<p><?php 
    printf(__('Please <a href="%s">install</a> the focus video plugin to edit this video setting.', 'focus'), $install_url);
    ?>
</p>
	<?php 
}
Ejemplo n.º 3
0
/**
 * Enqueue any required admin scripts.
 *
 * @param $prefix
 */
function siteorigin_panels_lite_enqueue_admin($prefix)
{
    if ($prefix == 'appearance_page_so_panels_home_page') {
        wp_enqueue_style('siteorigin-panels-lite-teaser', get_template_directory_uri() . '/extras/panels-lite/css/panels-admin.css');
    }
    if ($prefix == 'post.php' || $prefix == 'post-new.php') {
        $install_url = siteorigin_plugin_activation_install_url('siteorigin-panels', __('Page Builder', 'vantage'));
        wp_enqueue_script('siteorigin-panels-lite-teaser', get_template_directory_uri() . '/extras/panels-lite/js/tab.js', array('jquery'));
        wp_localize_script('siteorigin-panels-lite-teaser', 'panelsLiteTeaser', array('tab' => __('Page Builder', 'vantage'), 'message' => __("Refresh this page after you've installed Page Builder.", 'vantage'), 'confirm' => __("Your theme has Page Builder support. Would you like to install it? It's free."), 'installUrl' => $install_url));
    }
}
Ejemplo n.º 4
0
function vantage_settings_tour($tour)
{
    $tour = array();
    $tour[] = array('title' => __('Welcome to Vantage', 'vantage'), 'content' => __('Vantage is a powerful, multipurpose theme. This quick tour will guide you through some of the basic setup and features.', 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/logo.png');
    $tour[] = array('title' => __('Upload Your Logo', 'vantage'), 'content' => __('The first step to making your site uniquely your own is to upload your custom logo. Choose a logo image below, and it will replace the plain-text site title. Any size will work, but we recommend that you use a smaller version of your logo.', 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/upload-logo.jpg', 'setting' => 'logo_image');
    $tour[] = array('title' => __('Upload Your Retina Logo', 'vantage'), 'content' => __('A retina logo is a double-sized version of your standard logo. Vantage displays this version of your logo to users with high pixel density displays. Currently, these are most common on mobile devices, but they are starting to infiltrate desktop devices too.', 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/upload-logo-retina.jpg', 'setting' => 'logo_image_retina');
    $tour[] = array('title' => __('Choose a Layout', 'vantage'), 'content' => __('Vantage supports two different layouts: boxed and full-width. Full-width is the default setting, but it is possible that boxed will give you a look you prefer. Boxed also gives you access to the custom background feature.', 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/width.jpg', 'setting' => 'layout_bound');
    $tour[] = array('title' => __('Change the Header Text', 'vantage'), 'content' => __('The header text, which by default reads "Call Me, Maybe?" is a great place to add your site slogan or contact details. You can also overwrite this area entirely by adding widgets to the header widget area.', 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/header-text.jpg', 'setting' => 'logo_header_text');
    $tour[] = array('title' => __('Change the Slider', 'vantage'), 'content' => __("The home page slider is a great place to show off your images or branding message. You'll need to install Meta Slider to create any new sliders. Once you do, the sliders will show up in this drop down list. For now, you can just disable the default slider until you create your own.", 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/slider.jpg', 'setting' => 'home_slider');
    if (!function_exists('siteorigin_panels_render')) {
        // Only include this step of the tour if Page Builder is not enabled.
        $tour[] = array('title' => __('Install Page Builder', 'vantage'), 'content' => __("Page Builder is the easiest way to create a site that makes you proud. Navigate to Appearance > Home Page in your WordPress admin to install it. After you've installed it, you will be able to create columnized pages using your widgets.", 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/page-builder.jpg', 'action' => array('text' => __('Install Page Builder', 'vantage'), 'href' => function_exists('siteorigin_plugin_activation_install_url') ? siteorigin_plugin_activation_install_url('siteorigin-panels', __('Page Builder', 'vantage')) : '#'), 'video' => 101728633);
    }
    $tour[] = array('title' => __('Enable Post Sharing', 'vantage'), 'content' => __("This setting toggles a social sharing box that appears below your blog posts. This box lets your users quickly share your content on Facebook, Twitter, and Google Plus.", 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/sharing.png', 'setting' => 'social_share_post');
    $tour[] = array('title' => __('Additional Settings', 'vantage'), 'content' => __("There are a lot of additional settings that we haven't covered in this brief tour. Navigate to Appearance > Theme Settings at any time to take a look. You'll be amazed at what you can accomplish with a few clicks.", 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/additional.png');
    if (!defined('SITEORIGIN_IS_PREMIUM')) {
        // Only show this step if the user isn't already using premium
        $tour[] = array('title' => __('Check Out Vantage Premium', 'vantage'), 'content' => __("You may have noticed that some settings and features are only available in Vantage Premium. This is a cost-effective upgrade that gives you access to a lot of bonus features. Take a look to see if this is something you might find useful.", 'vantage'), 'image' => get_template_directory_uri() . '/tour/steps/premium.jpg', 'action' => array('text' => __('More About Vantage Premium', 'vantage'), 'href' => admin_url('themes.php?page=premium_upgrade')), 'video' => 74123479);
    }
    return $tour;
}
Ejemplo n.º 5
0
/**
 * Setup theme settings.
 * 
 * @since estate 1.0
 */
function estate_theme_settings()
{
    siteorigin_settings_add_section('general', __('General', 'estate'));
    siteorigin_settings_add_section('banner', __('Home Banner', 'estate'));
    siteorigin_settings_add_section('layout', __('Layout', 'estate'));
    siteorigin_settings_add_section('text', __('Site Text', 'estate'));
    /**
     * General Settings
     */
    siteorigin_settings_add_field('general', 'logo', 'media', __('Logo', 'estate'), array('choose' => __('Choose Image', 'estate'), 'update' => __('Set Logo', 'estate')));
    siteorigin_settings_add_teaser('general', 'logo_retina', __('Retina Logo', 'estate'), array('choose' => __('Choose Image', 'estate'), 'update' => __('Set Logo', 'estate'), 'description' => __('A double sized version of your logo for retina displays. Must be used in addition to standard logo.', 'estate')));
    siteorigin_settings_add_field('general', 'site_description', 'checkbox', __('Site Description', 'estate'), array('description' => __('Display your site description under your logo.', 'estate')));
    siteorigin_settings_add_field('general', 'menu_search', 'checkbox', __('Menu Search', 'estate'), array('description' => __('Display a search input in the main menu.', 'estate')));
    siteorigin_settings_add_teaser('general', 'footer_attribution', __('Footer Attribution', 'estate'), array('description' => __('Remove the SiteOrigin attribution text from your footer.', 'estate')));
    siteorigin_settings_add_teaser('general', 'ajax_comments', __('Ajax Comments', 'estate'), array('description' => __('Comments are updated without reloading the page.', 'estate')));
    /**
     * Home Page
     */
    $options = array('' => __('None', 'estate'), 'title_banner' => __('Title Banner with Image', 'estate'), 'title_banner_noimage' => __('Title Banner without Image', 'estate'));
    if (class_exists('MetaSliderPlugin')) {
        $sliders = get_posts(array('post_type' => 'ml-slider'));
        foreach ($sliders as $slider) {
            $options['meta:' . $slider->ID] = __('Slider: ', 'estate') . $slider->post_title;
        }
    }
    siteorigin_settings_add_field('banner', 'type', 'select', __('Home Page Banner', 'estate'), array('options' => $options, 'description' => sprintf(__('This theme supports <a href="%s" target="_blank">Meta Slider</a>. <a href="%s">Install it</a> for free to create responsive, animated sliders - <a href="%s" target="_blank">More Info</a>', 'estate'), 'http://sorig.in/metaslider', siteorigin_plugin_activation_install_url('ml-slider', __('Meta Slider', 'estate'), 'http://sorig.in/ml-slider'), 'http://siteorigin.com/estate-documentation/sliders/')));
    siteorigin_settings_add_field('banner', 'image', 'media', __('Background Image', 'estate'));
    siteorigin_settings_add_field('banner', 'color', 'color', __('Background Color', 'estate'));
    siteorigin_settings_add_field('banner', 'title', 'text', __('Banner Title', 'estate'));
    siteorigin_settings_add_field('banner', 'subtitle', 'text', __('Banner Subtitle', 'estate'));
    siteorigin_settings_add_field('banner', 'button', 'text', __('Banner Button', 'estate'));
    siteorigin_settings_add_field('banner', 'button_url', 'text', __('Banner Button URL', 'estate'));
    /**
     * Layout
     */
    siteorigin_settings_add_teaser('layout', 'responsive', __('Responsive Layout', 'estate'), array('description' => __('Use a layout that adapts to mobile devices.', 'estate')));
    siteorigin_settings_add_teaser('layout', 'responsive_menu', __('Responsive Menu', 'estate'), array('description' => __('A single button nested menu is displayed for mobile devices.', 'estate')));
    siteorigin_settings_add_field('text', 'footer_text', 'text', __('Footer Text', 'estate'), array('description' => __('The footer text, ideal for copyright information', 'estate')));
}
Ejemplo n.º 6
0
Archivo: page.php Proyecto: gipix/azm
			<p><?php 
    _e('Viewing a revision. Save CSS to use this revision.', 'vantage');
    ?>
</p>
		</div>
	<?php 
}
?>

	<?php 
if (function_exists('siteorigin_plugin_activation_install_url') && current_user_can('activate_plugins') && get_user_meta(get_current_user_id(), 'so_extras_css_dismissed_upgrade', true) == '') {
    ?>
		<div class="updated settings-error" id="upgrade-notice">
			<p>
				<?php 
    printf(__("We've released a new CSS Editor plugin. It's a free upgrade - <a href='%s' target='_blank'>Upgrade Now</a> | <a href='%s' class='dismiss'>Dismiss</a>.", 'vantage'), siteorigin_plugin_activation_install_url('so-css', __('SiteOrigin CSS', 'vantage')), wp_nonce_url(admin_url('admin-ajax.php?action=siteorigin_css_hide_extra_upgrade'), 'dismiss'));
    ?>
			</p>
		</div>
	<?php 
}
?>


	<div id="poststuff">
		<div id="so-custom-css-info">

			<div class="postbox" id="so-custom-css-revisions">
				<h3 class="hndle"><span><?php 
_e('CSS Revisions', 'vantage');
?>
Ejemplo n.º 7
0
<?php

$install_url = siteorigin_plugin_activation_install_url('siteorigin-panels', __('Page Builder', 'vantage'));
$home = get_theme_mod('siteorigin_panels_home_page_enabled', siteorigin_panels_lite_setting('home-page-default'));
$toggle_url = wp_nonce_url(admin_url('themes.php?page=so_panels_home_page&toggle=1&panels_new=' . ($home ? 0 : 1)), 'toggle_panels_home');
?>
<div class="wrap" id="panels-home-page">
	<div id="icon-index" class="icon32"><br></div>
	<h2>
		<?php 
esc_html_e('Custom Home Page', 'vantage');
?>

		<a id="panels-toggle-switch" href="<?php 
echo esc_url($toggle_url);
?>
" class="state-<?php 
echo $home ? 'on' : 'off';
?>
 subtle-move">
			<div class="on-text"><?php 
_e('ON', 'vantage');
?>
</div>
			<div class="off-text"><?php 
_e('OFF', 'vantage');
?>
</div>
			<img src="<?php 
echo get_template_directory_uri();
?>
Ejemplo n.º 8
0
/**
 * Render a settings field.
 *
 * @param $args
 */
function siteorigin_settings_field($args)
{
    $field_name = $GLOBALS['siteorigin_settings_name'] . '[' . $args['section'] . '_' . $args['field'] . ']';
    $field_id = $args['section'] . '_' . $args['field'];
    $current = isset($GLOBALS['siteorigin_settings'][$field_id]) ? $GLOBALS['siteorigin_settings'][$field_id] : null;
    switch ($args['type']) {
        case 'checkbox':
            ?>
			<input id="<?php 
            echo esc_attr($field_id);
            ?>
" name="<?php 
            echo esc_attr($field_name);
            ?>
" type="checkbox" <?php 
            checked($current);
            ?>
 />
			<label for="<?php 
            echo esc_attr($field_id);
            ?>
"><?php 
            echo esc_attr(!empty($args['label']) ? $args['label'] : __('Enabled', 'vantage'));
            ?>
</label>
			<?php 
            break;
        case 'text':
        case 'number':
            ?>
			<input
				id="<?php 
            echo esc_attr($field_id);
            ?>
"
				name="<?php 
            echo esc_attr($field_name);
            ?>
"
				class="<?php 
            echo esc_attr($args['type'] == 'number' ? 'small-text' : 'regular-text');
            ?>
"
				size="25"
				type="<?php 
            echo esc_attr($args['type']);
            ?>
"
				value="<?php 
            echo esc_attr($current);
            ?>
" />
			<?php 
            if (!empty($args['options'])) {
                ?>
				<select class="input-field-select">
					<option></option>
					<?php 
                foreach ($args['options'] as $value => $label) {
                    ?>
						<option value="<?php 
                    echo esc_attr($value);
                    ?>
"><?php 
                    echo esc_html($label);
                    ?>
</option>
					<?php 
                }
                ?>
				</select>
			<?php 
            }
            break;
        case 'select':
            ?>
			<select id="<?php 
            echo esc_attr($field_id);
            ?>
" name="<?php 
            echo esc_attr($field_name);
            ?>
">
				<?php 
            foreach ($args['options'] as $option_id => $label) {
                ?>
					<option value="<?php 
                echo esc_attr($option_id);
                ?>
" <?php 
                selected($option_id, $current);
                ?>
><?php 
                echo esc_attr($label);
                ?>
</option>
				<?php 
            }
            ?>
			</select>
			<?php 
            break;
        case 'textarea':
            ?>
<textarea id="<?php 
            echo esc_attr($field_id);
            ?>
" name="<?php 
            echo esc_attr($field_name);
            ?>
" class="large-text" rows="3"><?php 
            echo esc_textarea($current);
            ?>
</textarea><?php 
            break;
        case 'color':
            if (wp_script_is('wp-color-picker', 'registered')) {
                ?>
<input type="text" value="<?php 
                echo esc_attr($current);
                ?>
" class="color-field" name="<?php 
                echo esc_attr($field_name);
                ?>
" /><?php 
            } else {
                ?>
				<div class="colorpicker-wrapper">
					<div class="color-indicator" style="background-color: <?php 
                echo esc_attr($current);
                ?>
"></div>
					<input type="text" id="<?php 
                echo esc_attr($field_id);
                ?>
" value="<?php 
                echo esc_attr($current);
                ?>
" name="<?php 
                echo esc_attr($field_name);
                ?>
" />

					<div class="farbtastic-container"></div>
				</div>
				<?php 
            }
            break;
        case 'media':
            if (version_compare(get_bloginfo('version'), '3.5', '<')) {
                printf(__('You need to <a href="%s">upgrade</a> to WordPress 3.5 to use media fields', 'vantage'), admin_url('update-core.php'));
                break;
            }
            if (!empty($current)) {
                if (is_array($current)) {
                    $src = $current;
                } else {
                    $post = get_post($current);
                    $src = wp_get_attachment_image_src($current, 'thumbnail');
                    if (empty($src)) {
                        $src = wp_get_attachment_image_src($current, 'thumbnail', true);
                    }
                }
            } else {
                $src = array('', 0, 0);
            }
            $choose_title = empty($args['choose']) ? __('Choose Media', 'vantage') : $args['choose'];
            $update_button = empty($args['update']) ? __('Set Media', 'vantage') : $args['update'];
            ?>
				<div class="media-field-wrapper">
					<div class="current">
						<div class="thumbnail-wrapper">
							<img src="<?php 
            echo esc_url($src[0]);
            ?>
" class="thumbnail" <?php 
            if (empty($src[0])) {
                echo "style='display:none'";
            }
            ?>
 />
						</div>
						<div class="title"><?php 
            if (!empty($post)) {
                echo esc_attr($post->post_title);
            }
            ?>
</div>
					</div>
					<a href="#" class="media-upload-button" data-choose="<?php 
            echo esc_attr($choose_title);
            ?>
" data-update="<?php 
            echo esc_attr($update_button);
            ?>
">
						<?php 
            echo esc_html($choose_title);
            ?>
					</a>

					<a href="#" class="media-remove-button"><?php 
            _e('Remove', 'vantage');
            ?>
</a>
				</div>

				<input type="hidden" id="<?php 
            echo esc_attr($field_id);
            ?>
" value="<?php 
            echo esc_attr(is_array($current) ? '-1' : $current);
            ?>
" name="<?php 
            echo esc_attr($field_name);
            ?>
" />
				<div class="clear"></div>
			<?php 
            break;
        case 'teaser':
            $theme = get_option('template');
            ?>
			<a class="premium-teaser siteorigin-premium-teaser" href="<?php 
            echo admin_url('themes.php?page=premium_upgrade');
            ?>
" target="_blank">
				<em></em>
				<?php 
            printf(__('Only available in <strong>%s</strong> - <strong class="upgrade">Upgrade Now</strong>', 'vantage'), apply_filters('siteorigin_premium_theme_name', ucfirst($theme) . ' ' . __('Premium', 'vantage')));
            ?>
				<?php 
            if (!empty($args['teaser-image'])) {
                ?>
					<div class="teaser-image"><img src="<?php 
                echo esc_url($args['teaser-image']);
                ?>
" width="220" height="120" /><div class="pointer"></div></div>
				<?php 
            }
            ?>
			</a>
			<?php 
            break;
        case 'gallery':
            ?>
			<input
				id="<?php 
            echo esc_attr($field_id);
            ?>
"
				name="<?php 
            echo esc_attr($field_name);
            ?>
"
				class="regular-text gallery-ids"
				size="25"
				type="text"
				value="<?php 
            echo esc_attr($current);
            ?>
" />
			<a href="#" class="so-settings-gallery-edit"><?php 
            _e('Select Images', 'vantage');
            ?>
</a>
			<?php 
            break;
        case 'pages':
            $pages = get_posts(array('post_type' => 'page', 'numberposts' => 200, 'post_status' => empty($args['unpublished']) ? 'publish' : 'any'));
            ?>
			<select id="<?php 
            echo esc_attr($field_id);
            ?>
" name="<?php 
            echo esc_attr($field_name);
            ?>
">
				<option value="0"><?php 
            _e('None', 'vantage');
            ?>
</option>
				<?php 
            foreach ($pages as $page) {
                ?>
					<option value="<?php 
                echo $page->ID;
                ?>
" <?php 
                selected($page->ID, $current);
                ?>
><?php 
                echo esc_attr($page->post_title);
                ?>
</option>
				<?php 
            }
            ?>
			</select>
			<?php 
            break;
        case 'widget':
            if (empty($args['widget_class'])) {
                break;
            }
            if (!class_exists($args['widget_class'])) {
                ?>
<div class="so-settings-widget-form"><?php 
                printf(__('This field requires the %s plugin. ', 'influence'), $args['plugin_name']);
                if (function_exists('siteorigin_plugin_activation_install_url')) {
                    $install_url = siteorigin_plugin_activation_install_url($args['plugin'], $args['plugin_name']);
                    printf(__('<a href="%s" target="_blank">Install %s</a> now. ', 'influence'), $install_url, $args['plugin_name']);
                }
                ?>
</div><?php 
            } else {
                global $siteorigin_settings_widget_forms;
                if (is_null($siteorigin_settings_widget_forms)) {
                    $siteorigin_settings_widget_forms = array();
                }
                // Render the widget form
                $the_widget = new $args['widget_class']();
                $the_widget->id = $field_id;
                $the_widget->number = $field_id;
                ob_start();
                $the_widget->form($current);
                $form = ob_get_clean();
                // Convert the widget field naming into ones that Settings will use
                $exp = preg_quote($the_widget->get_field_name('____'));
                $exp = str_replace('____', '(.*?)', $exp);
                $form = preg_replace('/' . $exp . '/', 'siteorigin_settings_widget[' . preg_quote($field_id) . '][$1]', $form);
                echo '<div class="so-settings-widget-form"><a href="#" class="so-settings-widget-edit" data-is-setup="0" data-form="' . esc_attr($form) . '">' . __('Edit', 'vantage') . '</a></div>';
                ?>
<input type="hidden" id="<?php 
                echo esc_attr($field_id);
                ?>
" name="<?php 
                echo esc_attr($field_name);
                ?>
" value="<?php 
                echo esc_attr(serialize($current));
                ?>
" /><?php 
            }
            break;
        default:
            _e('Unknown Field Type', 'vantage');
            break;
    }
    if (!empty($args['description'])) {
        echo '<p class="description">' . $args['description'] . '</p>';
    }
}