Ejemplo n.º 1
1
/**
 * Return the HTML link of the translation of a post.
 *
 * @param $post_id integer id of post. If it is null, then it converts the current URL with the language specified.
 * @param $language string language of translation. If it is null or invalid, current language loaded in the page is used.
 * @param $label string inner text of the link.
 * @param $class string text to include as class parameter in the link
 *
 * @return string the HTML link of the translation link of a post.
 */
function uls_get_link($post_id = null, $language = null, $label = null, $class = 'uls-link')
{
    // instance the atribute
    $translation_url = "#";
    if ($post_id == null) {
        if (is_home() || is_front_page() || is_archive() || is_search() || is_author() || is_category() || is_tag() || is_date()) {
            $url = uls_get_browser_url();
            $translation_url = uls_get_url_translated($url, $language);
        } else {
            if (is_search()) {
                $url = get_home_url();
                $url .= "?s=" . get_search_query();
                $translation_url = uls_get_url_translated($url, $language);
            }
        }
    } else {
        $translation_id = uls_get_post_translation_id($post_id, $language);
        if (empty($translation_id)) {
            $translation_id = $post_id;
        }
        //set conversion of permalinks to true
        global $uls_permalink_convertion;
        $uls_permalink_convertion = true;
        $translation_url = uls_get_url_translated(get_permalink($translation_id), $language);
        //reset conversion of permalinks
        $uls_permalink_convertion = false;
        $title = get_the_title($translation_id);
    }
    if (null == $label) {
        return '<a class="' . $class . '" href="' . $translation_url . '" >' . $title . '</a>';
    } else {
        return '<a class="' . $class . '" href="' . $translation_url . '" >' . $label . '</a>';
    }
}
Ejemplo n.º 2
0
/**
 * Website logo function
 */
function theme_site_logo()
{
    $get_image_id = wps_get_theme_option('company_logo');
    $output = '';
    $default = '<a href="' . get_home_url() . '">' . get_bloginfo('name') . '</a><br/><small>' . get_bloginfo('description') . '</small>';
    /**
     * Logo HTML wrapper
     */
    $output .= '<div data-ui-component="branding">';
    if (wps_get_theme_option('logo_setting') === 'brand_title') {
        $output .= $default;
    } else {
        if ($get_image_id) {
            $image = wp_get_attachment_image_src($get_image_id, 'full');
            $logo = $image[0];
            $output .= '<a title="' . get_bloginfo('name') . '" href="' . get_home_url() . '">';
            $output .= '<img src="' . $logo . '" alt="' . get_bloginfo('name') . '" class="brand-logo"/>';
            $output .= '</a>';
        } else {
            $output .= $default;
        }
    }
    $output .= '</div>';
    $allowed_html = array('a' => array('href' => array(), 'title' => array()), 'h1' => array(), 'h2' => array(), 'span' => array(), 'small' => array(), 'br' => array(), 'div' => array(), 'img' => array('src' => array(), 'alt' => array(), 'class' => array()));
    echo wp_kses($output, $allowed_html);
}
 /**
  * (non-PHPdoc)
  * @see Ai1ec_Template_Adapter::get_site_url()
  */
 public function get_site_url()
 {
     if (is_admin() && defined('FORCE_SSL_ADMIN') && true === FORCE_SSL_ADMIN) {
         return get_home_url(null, '', 'https');
     }
     return get_home_url();
 }
Ejemplo n.º 4
0
 function wpo_init_constants()
 {
     $theme_mods = get_theme_mods();
     if (!defined('TEMPLATEURI')) {
         define('TEMPLATEURI', trailingslashit(get_stylesheet_directory_uri()));
     }
     if (!defined('HOMEURL')) {
         define('HOMEURL', trailingslashit(get_home_url()));
     }
     if (!defined('THEMECOLOR')) {
         if (!empty($theme_mods['wpo_theme_color'])) {
             $meta_color = $theme_mods['wpo_theme_color'];
         } else {
             $meta_color = '#000000';
         }
         define('THEMECOLOR', $meta_color);
     }
     if (!defined('HEADERCOLOR')) {
         if (!empty($theme_mods['wpo_header_color'])) {
             $meta_color = $theme_mods['wpo_header_color'];
         } else {
             $meta_color = '#000000';
         }
         define('HEADERCOLOR', $meta_color);
     }
 }
Ejemplo n.º 5
0
 public function get_default_logout_url($current_url = null, $redirect_slug = 'customer-dashboard', $redirect_url = null)
 {
     if ($current_url != null) {
         return $current_url;
     }
     $cp_addon = $this->plugin->get_addon('customer-pages');
     // Where should we redirect?
     if (!empty($redirect_slug)) {
         $redirect_page_id = $cp_addon->get_page_id($redirect_slug);
         if ($redirect_page_id > 0) {
             $redirect_url = get_permalink($redirect_page_id);
         }
     }
     if ($redirect_url == null) {
         $redirect_url = get_home_url();
     }
     // The account page ID
     $page_id = $cp_addon->get_page_id('user-account');
     if ($page_id > 0) {
         $permalink = get_permalink($page_id);
         $logout_url = $permalink . '?cuar_redirect=' . $redirect_url;
     } else {
         $logout_url = wp_login_url($redirect_url);
     }
     return $logout_url;
 }
Ejemplo n.º 6
0
/**
 * Display JavaScript on the page.
 *
 * @since 3.5.0
 */
function options_general_add_js()
{
    ?>
<script type="text/javascript">
//<![CDATA[
	jQuery(document).ready(function($){
		var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
			homeURL = ( <?php 
    echo wp_json_encode(get_home_url());
    ?>
 || '' ).replace( /^(https?:\/\/)?(www\.)?/, '' );

		$( '#blogname' ).on( 'input', function() {
			var title = $.trim( $( this ).val() ) || homeURL;

			// Truncate to 40 characters.
			if ( 40 < title.length ) {
				title = title.substring( 0, 40 ) + '\u2026';
			}

			$siteName.text( title );
		});

		$("input[name='date_format']").click(function(){
			if ( "date_format_custom_radio" != $(this).attr("id") )
				$("input[name='date_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
		});
		$("input[name='date_format_custom']").focus(function(){
			$( '#date_format_custom_radio' ).prop( 'checked', true );
		});

		$("input[name='time_format']").click(function(){
			if ( "time_format_custom_radio" != $(this).attr("id") )
				$("input[name='time_format_custom']").val( $(this).val() ).siblings('.example').text( $(this).siblings('span').text() );
		});
		$("input[name='time_format_custom']").focus(function(){
			$( '#time_format_custom_radio' ).prop( 'checked', true );
		});
		$("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
			var format = $(this);
			format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
			$.post(ajaxurl, {
					action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
					date : format.val()
				}, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
		});

		var languageSelect = $( '#WPLANG' );
		$( 'form' ).submit( function() {
			// Don't show a spinner for English and installed languages,
			// as there is nothing to download.
			if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
				$( '#submit', this ).after( '<span class="spinner language-install-spinner" />' );
			}
		});
	});
//]]>
</script>
<?php 
}
function swp_check_registration_status()
{
    // Fetch the User's Options Array
    $swp_user_options = swp_get_user_options();
    // Fetch URL of the home page
    $homeURL = get_home_url();
    // Create a Registration Code from the Domain Name
    $regCode = md5($homeURL);
    // IF the plugin thinks that it is already registered....
    if (is_swp_registered()) {
        // Construct the request URL
        $url = 'https://warfareplugins.com/registration-api/?activity=check_registration&emailAddress=' . $swp_user_options['emailAddress'] . '&domain=' . $homeURL . '&registrationCode=' . md5($homeURL);
        // Send the link and load the response
        $response = swp_file_get_contents_curl($url);
        // If the response is negative, unregister the plugin....
        if ($response == 'false') {
            // Set the premium code to null
            $swp_user_options['premiumCode'] = '';
            // Update the options array with the premium code nulled
            update_option('socialWarfareOptions', $swp_user_options);
        }
        // If the codes didn't match, but a premium code does exist
    } elseif (isset($swp_user_options['premiumCode'])) {
        // Attemp to unregister this from the Warfare Plugins Server
        $url = 'https://warfareplugins.com/registration-api/?activity=unregister&emailAddress=' . $swp_user_options['emailAddress'] . '&premiumCode=' . $swp_user_options['premiumCode'];
        // Parse the response
        $response = swp_file_get_contents_curl($url);
        $response = json_decode($response, true);
        // If it unregistered, let's try to auto-reregister it....
        if ($response['status'] == 'Success') {
            // Attempt to reregister it
            $url = 'https://warfareplugins.com/registration-api/?activity=register&emailAddress=' . $swp_user_options['emailAddress'] . '&domain=' . get_home_url() . '&registrationCode=' . $regCode;
            // Parse the response
            $response = swp_file_get_contents_curl($url);
            $response = json_decode($response, true);
            // IF the registration attempt was successful....
            if ($response['status'] == 'Success') {
                // Save our updated options
                $swp_user_options['premiumCode'] == $response['premiumCode'];
                // Update the options storing in our new updated Premium Code
                update_option('socialWarfareOptions', $swp_user_options);
                return true;
                // IF the registration attempt was NOT successful
            } else {
                // Set the premium code to null
                $swp_user_options['premiumCode'] = '';
                // Update the options array with the premium code nulled
                update_option('socialWarfareOptions', $swp_user_options);
                return false;
            }
            // IF it wasn't able to unregister
        } else {
            // Set the premium code to null
            $swp_user_options['premiumCode'] = '';
            // Update the options array with the premium code nulled
            update_option('socialWarfareOptions', $swp_user_options);
            return false;
        }
    }
}
Ejemplo n.º 8
0
/**
 *
 * Function for registering wp_nav_menu() in 3 locations
 */
function bb_register_navmenus()
{
    register_nav_menus(array('Top' => __('Top Navigation'), 'Header' => __('Header Navigation'), 'Footer' => __('Footer Navigation')));
    // Check if Top menu exists and make it if not
    if (!is_nav_menu('Top')) {
        $menu_id = wp_create_nav_menu('Top');
        $menu = array('menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => 'Home');
        wp_update_nav_menu_item($menu_id, 1, $menu);
    }
    // Check if Header menu exists and make it if not
    if (!is_nav_menu('Header')) {
        $menu_id = wp_create_nav_menu('Header');
        $menu = array('menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => 'Home');
        wp_update_nav_menu_item($menu_id, 1, $menu);
    }
    // Check if Footer menu exists and make it if not
    if (!is_nav_menu('Footer')) {
        $menu_id = wp_create_nav_menu('Footer');
        $menu = array('menu-item-type' => 'custom', 'menu-item-url' => get_home_url('/'), 'menu-item-title' => 'Home');
        wp_update_nav_menu_item($menu_id, 1, $menu);
    }
    // Get any menu locations that dont have a menu assigned to it and give it on
    /*
    $loc = array('Top', 'Header', 'Footer');
    if ( has_nav_menu( $location )) {
    	$locations = get_nav_menu_locations();
    	return (!empty( $locations[ $location ] ));
    }
    */
}
Ejemplo n.º 9
0
 /**
  * Search for publications.
  *
  * @param array $args
  * @return array
  */
 private function publication_query($args = array())
 {
     $query = array('post_type' => 'seoslides-slideset', 'suppress_filters' => true, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, 'post_status' => 'publish', 'order' => 'DESC', 'orderby' => 'post_date', 'posts_per_page' => 20);
     $args['pagenum'] = isset($args['pagenum']) ? absint($args['pagenum']) : 1;
     if (isset($args['s'])) {
         $query['s'] = $args['s'];
     }
     $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ($args['pagenum'] - 1) : 0;
     // Run the query
     $get_posts = new WP_Query();
     $posts = $get_posts->query($query);
     $results = array();
     if (0 === $get_posts->post_count) {
         return $results;
     }
     // Populate results
     foreach ($posts as $post) {
         // Get the embed ID for the first slide in the presentation
         $slideset = new SEOSlides_Slideset($post->ID);
         /** @var SEOSlides_Embed $embed */
         $embed = SEOSlides_Module_Provider::get('SEOSlides Embed');
         $embed_id = $embed->get_embed_unique_id($post->ID, $slideset->first_slide()->slug);
         $embed_url = $embed->get_embed_url($post->ID, $slideset->first_slide()->slug);
         $shortcode = '[seoslides embed_id="' . $embed_id . '"';
         $shortcode .= ' script_src="' . preg_replace('/\\/(slides|embeds)\\//', '/embed-script/', $embed_url) . '"';
         $shortcode .= ' overview_src="' . get_permalink($post) . '"';
         $shortcode .= ' title="' . get_the_title($post) . '"';
         $shortcode .= ' site_src="' . get_home_url() . '"';
         $shortcode .= ' site_title="' . get_bloginfo('name') . '"';
         $shortcode .= ' /]';
         $results[] = array('ID' => $post->ID, 'title' => trim(esc_html(strip_tags(get_the_title($post)))), 'shortcode' => esc_attr($shortcode), 'info' => mysql2date(__('Y/m/d'), $post->post_date));
     }
     return $results;
 }
Ejemplo n.º 10
0
function js_wp_editor($settings = array())
{
    if (!class_exists('_WP_Editors')) {
        require ABSPATH . WPINC . '/class-wp-editor.php';
    }
    $set = _WP_Editors::parse_settings('apid', $settings);
    if (!current_user_can('upload_files')) {
        $set['media_buttons'] = false;
    }
    if ($set['media_buttons']) {
        wp_enqueue_script('thickbox');
        wp_enqueue_style('thickbox');
        wp_enqueue_script('media-upload');
        $post = get_post();
        if (!$post && !empty($GLOBALS['post_ID'])) {
            $post = $GLOBALS['post_ID'];
        }
        wp_enqueue_media(array('post' => $post));
    }
    _WP_Editors::editor_settings('apid', $set);
    $ap_vars = array('url' => get_home_url(), 'includes_url' => includes_url());
    wp_register_script('ap_wpeditor_init', get_template_directory_uri() . '/functions/js-wp-editor.js', array('jquery'), '1.1', true);
    wp_localize_script('ap_wpeditor_init', 'ap_vars', $ap_vars);
    wp_enqueue_script('ap_wpeditor_init');
}
Ejemplo n.º 11
0
 protected function content($atts, $content = null)
 {
     $width = $input_class = $el_class = $output = $post_type = $search_form = $el_position = '';
     extract(shortcode_atts(array('el_position' => '', 'search_input_text' => '', 'input_size' => 'standard', 'post_type' => '', 'width' => '1/1', 'twitter_username' => '', 'el_class' => ''), $atts));
     if ($input_size == "large") {
         $input_class = 'input-large';
     } else {
         $input_class = 'input-standard';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = spb_translateColumnWidthToSpan($width);
     $search_form .= '<form method="get" class="search-form search-widget" action="' . get_home_url() . '/">';
     $search_form .= '<input type="text" placeholder="' . $search_input_text . '" name="s" class="' . $input_class . '" />';
     if ($post_type != "any") {
         $search_form .= '<input type="hidden" name="post_type" value="' . $post_type . '" />';
     }
     $search_form .= '</form>';
     $output .= "\n\t" . '<div class="spb_search_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb-asset-content">';
     $output .= "\n\t\t" . $search_form;
     $output .= "\n\t\t" . '</div>';
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
Ejemplo n.º 12
0
 /**
  * count the click statistic and redirect to the right url
  * @return boolean
  */
 function analyse()
 {
     if (isset($_REQUEST['email_id']) && isset($_REQUEST['user_id'])) {
         $WJ_Stats = new WJ_Stats();
         if (!empty($WJ_Stats->clicked_url)) {
             // clicked stats
             $url = $this->encode_url($WJ_Stats->subscriber_clicked());
             $external_url = htmlentities($WJ_Stats->subscriber_clicked());
             // escape HTML characters (that's how URLs are saved in the DB)
             $external_url = preg_replace('!/?\\?utm.*!', '', $external_url);
             // remove anything that starts with ?utm or /?utm
             $internal_site_url = htmlentities(get_site_url());
             $internal_home_url = htmlentities(get_home_url());
             $model_email = WYSIJA::get('email', 'model');
             $email_object = $model_email->getOne(false, array('email_id' => $_REQUEST['email_id']));
             if (preg_match('/' . preg_quote($external_url, '/') . '/', $email_object['body']) || preg_match('/^' . preg_quote($internal_site_url, '/') . '/', $url) || preg_match('/^' . preg_quote($internal_home_url, '/') . '/', $url)) {
                 do_action('mpoet_click_stats', $WJ_Stats);
                 $this->redirect($url);
             }
             header('HTTP/1.0 404 Not Found');
             echo '<h1>404 Not Found</h1>';
             echo 'The page that you have requested could not be found.';
             exit;
         } else {
             // opened stat
             $WJ_Stats->subscriber_opened();
         }
     }
     return true;
 }
    function widget($args, $instance)
    {
        extract($args);
        extract($instance);
        $options = get_option(DSIDXWIDGETS_OPTION_NAME);
        $randString = dsWidgets_Service_Base::get_random_string('abcdefghijklmnopqrstuvwxyz1234567890', 5);
        $income = htmlspecialchars($instance["income"]);
        $downPayment = htmlspecialchars($instance["downPayment"]);
        $monthlyDebts = htmlspecialchars($instance["monthlyDebts"]);
        $state = htmlspecialchars($instance["state"]);
        $city = htmlspecialchars($instance["city"]);
        $zip = htmlspecialchars($instance["zip"]);
        $priceMin = htmlspecialchars($instance["priceMin"]);
        $propType = '';
        $imagesStub = dsWidgets_Service_Base::$widgets_images_stub;
        $apiStub = dsWidgets_Service_Base::$widgets_api_stub;
        $curURL = get_home_url();
        $idxpress_options = get_option(DSIDXPRESS_OPTION_NAME);
        if (!empty($idxpress_options["AccountID"])) {
            $aid = $idxpress_options["AccountID"];
        } else {
            $aid = $options["AccountID"];
        }
        if (!empty($idxpress_options["SearchSetupID"])) {
            $ssid = $idxpress_options["SearchSetupID"];
        } else {
            $ssid = $options["SearchSetupID"];
        }
        echo $before_widget;
        if (defined('ZPRESS_API') && ZPRESS_API != '') {
            $widget_header = call_user_func('\\zpress\\themes\\Options::GetOption', 'theme_widgets_require_header');
            if (!empty($widget_header->meta) && $widget_header->meta == 'true') {
                echo $before_title;
                echo 'Affordability';
                echo $after_title;
            }
        }
        echo <<<HTML
        <div>
            <script type="text/javascript" id="divLocal{$randString}_">
\t\t\t\twindow.affordabilityHasDependency = true;
                LaunchBase{$randString} = function(){
                    var affordabilityScript, _ds_midx;
                    CreateObject{$randString} = function () { _ds_midx = {currentURL: '{$curURL}',  curAPIStub: '{$apiStub}', curImageStub: '{$imagesStub}', targetDomain: window["zpress_widget_domain_token"], accountId: '{$aid}',searchSetupId: '{$ssid}',muteStyles: true,income: '{$income}',downPayment: '{$downPayment}',monthlyDebts: '{$monthlyDebts}',state: '{$state}',city: '{$city}',zip: '{$zip}',priceMin: '{$priceMin}',curDivID: 'divLocal{$randString}_',querySchema: '12dGTTViUjEzC1rrNlw6Lq6A6wZQlgBarlIcucpGTkQrUP3gCimYF6deRFaavu2IbPpaOkZ9I4K42QaAhLVEcA==',productType: '0' }; }
                    AddJavaScriptToDOM{$randString}=function(c,d,e){if(1!=d){var a=document.createElement("script"),b=document.getElementsByTagName("script")[0];a.async=!0;a.src=c;a.onload=function(){ window[e] = 1;};b.parentNode.insertBefore(a,b)}return 1};
                    CreateWidget{$randString} = function () {
                     (window.affordabilityFinished == 1) ? (window["ds.widget.view.affordability"].isProcessing = true, CreateObject{$randString}(), new window["ds.widget.view.affordability"](_ds_midx), window["ds.widget.view.affordability"].isProcessing = false, window.affordabilityHasDependency = false) : window.setTimeout("CreateWidget{$randString}(false)", 20); 
                    }
                    if (affordabilityScript != 1) { affordabilityScript = AddJavaScriptToDOM{$randString}("{$this->widgetsCdn}/Scripts/PostCompile/Affordability_v1_1.js", affordabilityScript, 'affordabilityFinished') }; 
                      CreateWidget{$randString}();
                }
                GetToken{$randString}=function(){if(!window.zpress_widget_domain_token&&1!=window.zpress_widget_domain_token_progress){window.zpress_widget_domain_token_progress=1;var c=-1<navigator.userAgent.indexOf("MSIE 7.0")?!0:!1,d=-1<navigator.userAgent.indexOf("MSIE 8.0")||-1<navigator.userAgent.indexOf("MSIE 9.0")?!0:!1;if(c)rr=document.createElement("script"),rr.async=!0,rr.id="domainScript",rr.type="text/javascript",rr.src="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=Basic&curDomain="+
                window.location.hostname+"&objectName_=error",rr.onload=rr.onreadystatechange=function(){"undefined"!=typeof window.error?alert("We had a problem authenticating this domain"):(window.zpress_widget_domain_token=window.encrypted_domain,LaunchBase{$randString}())},document.getElementsByTagName("head")[0].appendChild(rr);else if(c="{$apiStub}Encrypt/?targetString="+window.location.hostname+"&targetObject=domain&authType=CORS&objectName_=error",d){var a=new XDomainRequest;a.onload=function(){window.zpress_widget_domain_token=
                eval(a.responseText);LaunchBase{$randString}()};a.onerror=function(){};a.onprogress=function(){};a.open("GET",c,!0);a.send(null)}else{var b;if(b=new XMLHttpRequest)b.onreadystatechange=function(){if(4==b.readyState)if(200==b.status){var a=eval(b.responseText);"undefined"!=typeof a.listingsError?alert(a.listingsError[0].Message):(window.zpress_widget_domain_token=a,LaunchBase{$randString}())}},b.open("GET",c,!0),b.send()}}else window.zpress_widget_domain_token?LaunchBase{$randString}():
                window.setTimeout("GetToken{$randString}()",20)};GetToken{$randString}();
            </script>
        </div>
HTML;
        echo $after_widget;
    }
Ejemplo n.º 14
0
function mayo_login_screen_url($url)
{
    global $mayo_login_screen_option;
    if (isset($mayo_login_screen_option['login_screen_logo_link']) && $mayo_login_screen_option['login_screen_logo_link'] !== '') {
        switch ($mayo_login_screen_option['login_screen_logo_link']) {
            case '@front':
            case '@home':
                $url = get_home_url();
                break;
            case '@posts':
            case '@post':
                $url = get_permalink(get_option('page_for_posts'));
                break;
            case '':
                $url = '';
                break;
            default:
                $url = $mayo_login_screen_option['login_screen_logo_link'];
                break;
        }
    } else {
        $url = '';
    }
    return $url;
}
Ejemplo n.º 15
0
function zb_add_defaults($reset = false)
{
    if ($reset === true) {
        delete_option('zappbar_site');
        delete_option('zappbar_colors');
        delete_option('zappbar_panels');
        delete_option('zappbar_layout');
    }
    $zb_site = get_option('zappbar_site');
    if (empty($zb_site)) {
        $zb_site = array('responsive' => '0', 'auto_width' => 'off', 'theme_width' => '940', 'fix_admin' => 'no', 'sidebars' => '1', 'adminbar' => 'off', 'showon' => 'none', 'applyto' => 'all', 'altertheme' => array('header' => 'header', 'sitenav' => 'sitenav', 'commentform' => 'commentform', 'push' => 'push'), 'app_icon' => '', 'splash_screen' => '', 'splash_size' => 'contain', 'header_custom' => '', 'nav_custom' => '', 'comment_custom' => '', 'sidebars_custom' => '', 'comic_nav' => '', 'alter_woo_theme' => array('woo_reviews' => 'woo_reviews', 'woo_desc' => 'woo_desc', 'woo_addl' => 'woo_addl'));
        update_option('zappbar_site', $zb_site);
    }
    $zb_social = get_option('zappbar_social');
    if (empty($zb_social)) {
        $zb_social = array('fb_default_img' => '', 'twitter_id' => '', 'phone_number' => '', 'email_address' => '', 'social_panel' => array('facebook' => 'facebook', 'twitter' => 'twitter', 'google' => 'google', 'reddit' => 'reddit', 'stumble' => 'stumble', 'digg' => 'digg', 'linkedin' => 'linkedin', 'pinterest' => 'pinterest', 'delicious' => 'delicious', 'rss' => 'rss', 'email' => 'email'));
        update_option('zappbar_social', $zb_social);
    }
    $zb_colors = get_option('zappbar_colors');
    if (empty($zb_colors)) {
        $zb_colors = array('color_src' => 'basic', 'custom_styles' => '', 'bar_bg' => '#ffffff', 'bar_bg_opacity' => '1.0', 'button_bg' => '#ffffff', 'button_bg_opacity' => '1.0', 'button_hover_bg' => '#cccccc', 'button_bg_hover_opacity' => '1.0', 'font_color' => '#333333', 'font_hover_color' => '#000000', 'bar_border_color' => '#000000', 'bar_border_style' => '', 'bar_border_width' => '');
        update_option('zappbar_colors', $zb_colors);
    }
    $zb_panels = get_option('zappbar_panels');
    if (empty($zb_panels)) {
        $zb_panels = array('panel_menu' => '0', 'panel_tabs' => 'yes', 'panel_styles' => 'on', 'panel_bg' => '#ffffff', 'panel_bg_opacity' => '1.0', 'panel_button_bg' => '#ffffff', 'panel_button_bg_opacity' => '1.0', 'panel_button_hover_bg' => '#cccccc', 'panel_button_hover_bg_opacity' => '1.0', 'panel_font_color' => '#333333', 'panel_font_hover_color' => '#000000', 'panel_border_color' => '#000000', 'panel_border_style' => '', 'panel_border_width' => '');
        update_option('zappbar_panels', $zb_panels);
    }
    $zb_layout = get_option('zappbar_layout');
    if (empty($zb_layout)) {
        $zb_layout = array('button_layout' => 'spread', 'search_button' => 'on', 'logo' => '', 'default_top' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-search', 'Search', 'search_right')), 'default_bottom' => array(array('dashicons|dashicons-wordpress', 'Blog', 'blogposts'), array('dashicons|dashicons-info', 'About', ''), array('dashicons|dashicons-admin-comments', 'Comment', 'commentform'), array('dashicons|dashicons-edit', 'Contact', 'mailto:' . get_bloginfo('admin_email')), array('dashicons|dashicons-share', 'Share', 'share_this')), 'use_archive_top_bar' => 'yes', 'archive_top_bar' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-search', 'Search', 'search_right')), 'use_archive_bottom_bar' => 'yes', 'archive_bottom_bar' => array(array('dashicons|dashicons-arrow-left-alt', 'First', 'first_page'), array('dashicons|dashicons-arrow-left-alt2', 'Previous', 'prev_page'), array('dashicons|dashicons-blank', '', ''), array('dashicons|dashicons-arrow-right-alt2', 'Next', 'next_page'), array('dashicons|dashicons-arrow-right-alt', 'Last', 'last_page')), 'use_comic_top_bar' => 'yes', 'comic_top_bar' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('fa|fa-angle-double-left', 'Prev Chap', 'prev_comic'), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('fa|fa-angle-double-right', 'Next chap', 'next_comic'), array('dashicons|dashicons-images-alt2', 'Archive', 'comic_archive')), 'use_comic_bottom_bar' => 'yes', 'comic_bottom_bar' => array(array('dashicons|dashicons-arrow-left-alt', 'First', 'first_comic'), array('dashicons|dashicons-arrow-left-alt2', 'Previous', 'prev_comic'), array('dashicons|dashicons-admin-comments', 'Comment', 'commentform'), array('dashicons|dashicons-arrow-right-alt2', 'Next', 'next_comic'), array('dashicons|dashicons-arrow-right-alt', 'Last', 'last_comic')), 'use_woo_top_bar' => 'yes', 'woo_top_bar' => array(array('dashicons|dashicons-menu', 'Menu', 'appmenu_left'), array('dashicons|dashicons-cart', 'Cart', 'woo_cart'), array('dashicons|dashicons-admin-home', 'Home', get_home_url()), array('dashicons|dashicons-admin-users', 'Account', 'woo_account'), array('dashicons|dashicons-search', 'Search', 'woo_search_right')), 'use_woo_bottom_bar' => 'yes', 'woo_bottom_bar' => array(array('dashicons|dashicons-products', 'Store', 'woo_store'), array('dashicons|dashicons-tag', 'Info', 'woo_desc'), array('dashicons|dashicons-star-filled', 'Reviews', 'woo_review'), array('fa|fa-tags', 'More Info', 'woo_addl'), array('dashicons|dashicons-share', 'Share', 'share_this')));
        update_option('zappbar_layout', $zb_layout);
    }
}
Ejemplo n.º 16
0
function admin_stylesheet($filename = '')
{
    if ($filename == '') {
        return get_home_url() . '/admin/assets/';
    }
    return get_home_url() . "/admin/assets/css/{$filename}" . ".css";
}
Ejemplo n.º 17
0
 protected function content($atts, $content = null)
 {
     $width = $pb_margin_bottom = $pb_border_bottom = $pb_border_top = $el_class = $output = $search_form = $el_position = '';
     extract(shortcode_atts(array('el_position' => '', 'search_input_text' => '', 'pb_margin_bottom' => 'no', 'pb_border_bottom' => 'no', 'pb_border_top' => 'no', 'width' => '1/1', 'twitter_username' => '', 'el_class' => ''), $atts));
     if ($pb_margin_bottom == "yes") {
         $el_class .= ' pb-margin-bottom';
     }
     if ($pb_border_bottom == "yes") {
         $el_class .= ' pb-border-bottom';
     }
     if ($pb_border_top == "yes") {
         $el_class .= ' pb-border-top';
     }
     $el_class = $this->getExtraClass($el_class);
     $width = wpb_translateColumnWidthToSpan($width);
     $search_form .= '<form method="get" class="search-form search-widget" action="' . get_home_url() . '/">';
     $search_form .= '<input type="text" placeholder="' . $search_input_text . '" name="sf-search" />';
     $search_form .= '</form>';
     $output .= "\n\t" . '<div class="wpb_search_widget wpb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="wpb_wrapper latest-tweet-bar-wrap clearfix">';
     $output .= "\n\t\t\t" . $search_form;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     return $output;
 }
Ejemplo n.º 18
0
 private function multisite_url($url)
 {
     $stage_url = new Url($url);
     $current_site = new Url(get_home_url(get_current_blog_id()));
     $current_site->host = str_replace($current_site->registerableDomain, $stage_url->registerableDomain, $current_site->host);
     return rtrim($current_site->getUrl(), '/') . $_SERVER['REQUEST_URI'];
 }
Ejemplo n.º 19
0
    function makeclean_logo()
    {
        global $makeclean_theme_option;
        if ($makeclean_theme_option['logo-on'] == 0) {
            ?>
           <div class="col-md-3 col-sm-4">
                <?php 
            printf('<h1> <a href="%1$s" title="%2$s"> %3$s  </a></h1> ', esc_url(get_home_url()), get_bloginfo('description'), $makeclean_theme_option['text-logo']);
            ?>
            </div>
        <?php 
        } else {
            ?>
                    <div class="col-md-3 col-sm-4">
                        <a title="<?php 
            bloginfo('description');
            ?>
" href="<?php 
            esc_url(get_home_url());
            ?>
"><img src="<?php 
            echo $makeclean_theme_option['logo-image']['url'];
            ?>
" alt="<?php 
            bloginfo('description');
            ?>
" /></a>
                    </div>
        <?php 
        }
        ?>


    <?php 
    }
Ejemplo n.º 20
0
function td_theme_style_footer()
{
    if (TD_DEPLOY_MODE == 'dev') {
        $script_path = get_template_directory_uri() . '/td_redirect.php?td_deploy_mode=dev&url=' . urlencode(get_home_url()) . '&';
    } else {
        $script_path = 'http://demo.tagdiv.com/td_redirect.php?';
    }
    ?>

    <div id="td-theme-settings" class="td-theme-settings-small">
        <div class="td-skin-header">DEMO STACKS</div>
        <div class="td-skin-content">


                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper" class="td-set-theme-style-link">DEFAULT</a></div>
                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper_classic_blog/" class="td-set-theme-style-link" data-value="">CLASSIC BLOG <span>new</span></a></div>
                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper_fashion/" class="td-set-theme-style-link">FASHION</a></div>
                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper_sport/" class="td-set-theme-style-link">SPORT</a></div>
                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper_cafe/" class="td-set-theme-style-link">CAFE</a></div>
                <div class="td-set-theme-style"><a href="http://demo.tagdiv.com/newspaper_tech/" class="td-set-theme-style-link">TECH</a></div>


        </div>
        <div class="clearfix"></div>
        <div class="td-set-hide-show"><a href="#" id="td-theme-set-hide">HIDE</a></div>
    </div>

    <?php 
}
Ejemplo n.º 21
0
/**
 * @param string $success_message - '', if present, will return an clickable link
 * @param string $error_message - "You don’t have access to this RSS feed."
 * @param bool $return
 * @return string
 */
function memberful_private_rss_feed_link($success_message = '', $error_message = "You don’t have access to this RSS feed.", $return = false)
{
    $error_message = apply_filters('memberful_private_rss_feed_error_message', $error_message);
    if (!is_user_logged_in()) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $requiredPlan = memberful_private_user_feed_settings_get_required_plan();
    // We want to allow the private user feed only if the admin has configured it.
    if ($requiredPlan == false) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $current_user_id = get_current_user_id();
    if (!is_subscribed_to_memberful_plan($requiredPlan, $current_user_id)) {
        return memberful_private_rss_feed_link_response_helper($error_message, $return);
    }
    $feedToken = get_user_meta($current_user_id, 'memberful_private_user_feed_token', true);
    if ($feedToken == false || $feedToken == '') {
        $feedToken = substr(md5(uniqid(rand(1, 10000))), 2, 30);
        update_user_meta($current_user_id, 'memberful_private_user_feed_token', $feedToken);
    }
    $link = get_home_url() . '/' . memberful_private_user_feed_get_url_identifier($feedToken);
    if ($success_message != '') {
        $link = '<a href="' . $link . '">' . do_shortcode($success_message) . '</a>';
    }
    return memberful_private_rss_feed_link_response_helper($link, $return);
}
 public function odg_admin_menu()
 {
     $home_url = get_home_url();
     echo "<div class='wrap'>";
     printf('<h2>%s</h2>', __('OpenData Generator', 'opendata-generator'));
     printf('<p>%s</p>', __('Now This Plugin Supports only JSON-LD.', 'opendata-generator'));
     echo "<table class='widefat form-table'>";
     //How To Use Table
     printf("<thead><tr><th colspan='2'> %s</th></tr>", __('How To Use(JSON-LD)', 'opendata-generator'));
     echo '</thead>';
     echo '<tbody>';
     printf("<tr><td> %s</td><td><a href='{$home_url}/odg-jsonld/' target='_blank'>{$home_url}/odg-jsonld/</a></td></tr>", __('See All Data', 'opendata-generator'));
     printf("<tr><td> %s</td><td>{$home_url}/[POST_URL]/odg-jsonld/</td></tr>", __('See Single Post Data', 'opendata-generator'));
     printf("<tr><td> %s</td><td><a href='{$home_url}/odg-jsonld/' target='_blank'>{$home_url}/odg-jsonld/</a></td></tr>", __('Search Data for All Post', 'opendata-generator'));
     echo '</tbody>';
     //Settings Tables
     printf("<thead><tr><th colspan='2'> %s</th></tr></thead>", __('Settings', 'opendata-generator'));
     echo "<tbody><tr><td colspan='2'>";
     printf('%s<hr>', __('Schema', 'opendata-generator'));
     _e('<p>Setting RDF Schem PREFIX.<br/>Default Setting is only 「http://schema.org/」.</p>', 'opendata-generator');
     echo '<br/>';
     printf('%s<hr>', __('Mapping', 'opendata-generator'));
     _e('<p>Mapping Custome Field Name and RDF Schema.<br/>Only showed mapped content.</p>', 'opendata-generator');
     echo '</td></tr></tbody>';
     echo '</table>';
     echo '</div>';
 }
Ejemplo n.º 23
0
 function test_request_xml()
 {
     $user = self::factory()->user->create_and_get(array('display_name' => 'John Doe'));
     $post = self::factory()->post->create_and_get(array('post_author' => $user->ID, 'post_title' => 'Hello World'));
     $request = array('url' => get_permalink($post->ID), 'format' => 'xml', 'maxwidth' => 400, 'callback' => '');
     $legacy_controller = new WP_oEmbed_Controller();
     $data = $legacy_controller->dispatch($request);
     $data = simplexml_load_string($data);
     $this->assertInstanceOf('SimpleXMLElement', $data);
     $data = (array) $data;
     $this->assertArrayHasKey('version', $data);
     $this->assertArrayHasKey('provider_name', $data);
     $this->assertArrayHasKey('provider_url', $data);
     $this->assertArrayHasKey('author_name', $data);
     $this->assertArrayHasKey('author_url', $data);
     $this->assertArrayHasKey('title', $data);
     $this->assertArrayHasKey('type', $data);
     $this->assertArrayHasKey('width', $data);
     $this->assertEquals('1.0', $data['version']);
     $this->assertEquals(get_bloginfo('name'), $data['provider_name']);
     $this->assertEquals(get_home_url(), $data['provider_url']);
     $this->assertEquals($user->display_name, $data['author_name']);
     $this->assertEquals(get_author_posts_url($user->ID, $user->user_nicename), $data['author_url']);
     $this->assertEquals($post->post_title, $data['title']);
     $this->assertEquals('rich', $data['type']);
     $this->assertTrue($data['width'] <= $request['maxwidth']);
 }
Ejemplo n.º 24
0
    /**
     * Function to format and display the search bar in the main menu
     *
     * @return string
     * @added 2.0
     */
    static function searchBar()
    {
        /* Added for WPML Compatibility in 2.2
         * Thanks to miguelcortereal for this */
        $action = function_exists('icl_get_home_url') ? icl_get_home_url() : get_home_url();
        ?>

        <form action="<?php 
        echo $action;
        ?>
" id="responsiveSearch" method="get" role="search">
            <span class="icon-buscador">
                <img src="<?php 
        echo get_home_url();
        ?>
/wp-content/themes/quidus/img/lupa.png" alt="Lupa">
            </span>
            <span class="caja-texto">
                <input type="search" name="s" class="form-control" value="" placeholder="Buscar">
            </span>
            <input type="submit" id="responsiveSearchSubmit" />
            
        </form>
                        
   <?php 
    }
 public function send_queued_mails()
 {
     $tj_url = admin_url('admin.php?page=' . WPML_TM_FOLDER . '/menu/translations-queue.php');
     foreach ($this->mail_cache as $type => $mail_to_send) {
         foreach ($mail_to_send as $to => $subjects) {
             $body_to_send = '';
             foreach ($subjects as $subject => $content) {
                 $body = $content['body'];
                 $body_to_send .= $body_to_send . "\n\n" . implode("\n\n\n\n", $body) . "\n\n\n\n";
                 $home_url = get_home_url();
                 if ($type === 'translator') {
                     $footer = sprintf(__('You can view your other translation jobs here: %s', 'sitepress'), $tj_url) . "\n\n--\n";
                     $footer .= sprintf(__("This message was automatically sent by Translation Management running on %s. To stop receiving these notifications contact the system administrator at %s.\n\nThis email is not monitored for replies.", 'sitepress'), get_bloginfo('name'), $home_url);
                 } else {
                     $footer = "\n--\n" . sprintf(__("This message was automatically sent by Translation Management running on %s. To stop receiving these notifications, go to Notification Settings, or contact the system administrator at %s.\n\nThis email is not monitored for replies.", 'sitepress'), get_bloginfo('name'), $home_url);
                 }
                 $body_to_send .= $footer;
                 $attachments = isset($content['attachment']) ? $content['attachment'] : array();
                 $attachments = apply_filters('WPML_new_job_notification_attachments', $attachments);
                 $this->sitepress->get_wp_api()->wp_mail($to, $subject, $body_to_send, '', $attachments);
             }
         }
     }
     $this->mail_cache = array();
     $this->process_mail_queue = false;
 }
Ejemplo n.º 26
0
function sleek_remove_home_from_breadcrumb($links)
{
    if ($links[0]['url'] == get_home_url()) {
        array_shift($links);
    }
    return $links;
}
 public function initialize()
 {
     $this->user = new stdClass();
     if (is_user_logged_in()) {
         /* Populate settings we need for the menu based on the current user. */
         $this->user->blogs = get_blogs_of_user(get_current_user_id());
         if (is_multisite()) {
             $this->user->active_blog = get_active_blog_for_user(get_current_user_id());
             $this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
             $this->user->account_domain = $this->user->domain;
         } else {
             $this->user->active_blog = $this->user->blogs[get_current_blog_id()];
             $this->user->domain = trailingslashit(home_url());
             $this->user->account_domain = $this->user->domain;
         }
     }
     add_action('wp_head', 'wp_admin_bar_header');
     add_action('admin_head', 'wp_admin_bar_header');
     if (current_theme_supports('admin-bar')) {
         $admin_bar_args = get_theme_support('admin-bar');
         // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
         $header_callback = $admin_bar_args[0]['callback'];
     }
     if (empty($header_callback)) {
         $header_callback = '_admin_bar_bump_cb';
     }
     add_action('wp_head', $header_callback);
     wp_enqueue_script('admin-bar');
     wp_enqueue_style('admin-bar');
     do_action('admin_bar_init');
 }
Ejemplo n.º 28
0
function test_metabox()
{
    if (class_exists('CantoMetabox')) {
        $test_metabox2 = array('id' => 'test_meta_box2', 'title' => __('Test Metabox2', 'textdomain'), 'post_type' => array('post', 'page'), 'options' => array(array('id' => 'ctfif_tst_text', 'label' => __('Text Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'text', 'default' => 'Test Text'), array('id' => 'ctfif_tst_email', 'label' => __('Email Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'email', 'default' => '*****@*****.**'), array('id' => 'ctfif_tst_textarea', 'label' => __('Textarea Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'textarea', 'default' => 'Test Text'), array('id' => 'ctfif_tst_editor', 'label' => __('Editor Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'editor', 'default' => 'Test Text'), array('id' => 'ctfif_tst_select', 'label' => __('Select Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'select', 'default' => 'test2', 'choices' => array('test1' => 'Test 1', 'test2' => 'Test 2', 'test3' => 'Test 3')), array('id' => 'ctfif_tst_radio', 'label' => __('Radio Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'radio', 'default' => 'test2', 'choices' => array('test1' => 'Test 1', 'test2' => 'Test 2', 'test3' => 'Test 3')), array('id' => 'ctfif_tst_checkbox', 'label' => __('Checkbox Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'checkbox', 'default' => array('test2'), 'choices' => array('test1' => 'Test 1', 'test2' => 'Test 2', 'test3' => 'Test 3')), array('id' => 'ctfif_tst_radio_image', 'label' => __('Radio Image Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'radio_image', 'default' => 'test2', 'choices' => array('test1' => get_home_url() . '/wp-admin//images/align-left-2x.png', 'test2' => get_home_url() . '/wp-admin//images/align-center-2x.png', 'test3' => get_home_url() . '/wp-admin//images/align-right-2x.png')), array('id' => 'ctfif_tst_checkbox_image', 'label' => __('Checkbox Image Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'checkbox_image', 'default' => array('test2'), 'choices' => array('test1' => get_home_url() . '/wp-admin//images/align-left-2x.png', 'test2' => get_home_url() . '/wp-admin//images/align-center-2x.png', 'test3' => get_home_url() . '/wp-admin//images/align-right-2x.png')), array('id' => 'ctfif_tst_radio_button', 'label' => __('Radio Button Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'radio_button', 'default' => 'test2', 'choices' => array('test1' => 'Test 1', 'test2' => 'Test 2', 'test3' => 'Test 3')), array('id' => 'ctfif_tst_checkbox_button', 'label' => __('Checkbox Button Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'checkbox_button', 'default' => array('test1', 'test3'), 'choices' => array('test1' => 'Test 1', 'test2' => 'Test 2', 'test3' => 'Test 3')), array('id' => 'ctfif_tst_text_multi', 'label' => __('Multi-Text Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'text_multi', 'default' => array('test 1', 'test 2')), array('id' => 'ctfif_tst_number', 'label' => __('Number Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'number', 'default' => '50'), array('id' => 'ctfif_tst_range', 'label' => __('Range Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'range', 'default' => '50'), array('id' => 'ctfif_tst_dimension', 'label' => __('Dimension Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'dimension', 'default' => '20px'), array('id' => 'ctfif_tst_Icon', 'label' => __('Icon Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'icon', 'default' => 'fa fa-cogs'), array('id' => 'ctfif_tst_color', 'label' => __('Color Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'color', 'default' => '#ff00ff'), array('id' => 'ctfif_tst_rgba', 'label' => __('RGBA Color Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'color_rgba', 'default' => 'rgba(25,56,58,0.65)'), array('id' => 'ctfif_tst_font_style', 'label' => __('Font Style Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'font_style', 'default' => array('bold' => 'on', 'italic' => 'off', 'underline' => 'off', 'strikethrough' => 'on')), array('id' => 'ctfif_tst_text_align', 'label' => __('Text Align Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'text_align', 'default' => 'left'), array('id' => 'ctfif_tst_image', 'label' => __('Image Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'image', 'default' => array()), array('id' => 'ctfif_tst_image_multi', 'label' => __('Gallery Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'image_multi'), array('id' => 'ctfif_tst_font', 'label' => __('Google Font Input', 'mytheme'), 'subtitle' => __('Lorem ipsum dolor sit amet', 'mytheme'), 'type' => 'google_font', 'default' => array())));
        CantoMetabox::add_metabox($test_metabox2);
    }
}
Ejemplo n.º 29
0
 public function constant($mm_config = array())
 {
     // Set theme primary information.
     foreach ($mm_config as $key => $value) {
         $this->constant[$key] = $value;
     }
     // Set theme identificators and prefixes.
     $this->constant['MM_OPTIONS_NAME'] = $this->constant['MM_WARE_SLUG'] . '_options';
     $this->constant['MM_OPTIONS_DB_NAME'] = $this->constant['MM_OPTIONS_NAME'];
     $this->constant['MM_TEXTDOMAIN'] = $this->constant['MM_WARE_SLUG'];
     $this->constant['MM_TEXTDOMAIN_ADMIN'] = $this->constant['MM_WARE_SLUG'] . '_admin';
     $this->constant['MM_THEME_PAGE_SLUG'] = $this->constant['MM_OPTIONS_NAME'];
     // Set theme static locations.
     // DIRECTORIES
     $this->constant['MM_WARE_DIR'] = dirname($this->constant['MM_WARE_INIT_FILE']);
     $this->constant['MM_WARE_FRAMEWORK_DIR'] = $this->constant['MM_WARE_DIR'] . '/framework';
     $this->constant['MM_WARE_EXTENSIONS_DIR'] = $this->constant['MM_WARE_DIR'] . '/extensions';
     $this->constant['MM_WARE_SRC_DIR'] = $this->constant['MM_WARE_DIR'] . '/src';
     $this->constant['MM_WARE_CSS_DIR'] = $this->constant['MM_WARE_SRC_DIR'] . '/css';
     // URL's
     if (is_multisite()) {
         $home_url = get_home_url();
     } else {
         $wpurl = get_bloginfo('wpurl');
         $home_url = $wpurl;
     }
     $ware_dir_explode = array_reverse(explode('/', str_replace('\\', '/', $this->constant['MM_WARE_DIR'])));
     $this->constant['MM_WARE_URL'] = $home_url . '/' . $ware_dir_explode[2] . '/' . $ware_dir_explode[1] . '/' . $ware_dir_explode[0];
     $this->constant['MM_WARE_SRC_URL'] = $this->constant['MM_WARE_URL'] . '/src';
     $this->constant['MM_WARE_CSS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/css';
     $this->constant['MM_WARE_JS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/js';
     $this->constant['MM_WARE_FONTS_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/fonts';
     $this->constant['MM_WARE_IMG_URL'] = $this->constant['MM_WARE_SRC_URL'] . '/img';
 }
Ejemplo n.º 30
0
 public function menu_item()
 {
     global $wpdb, $blog_id, $eshopoptions, $post;
     $eshopsize = 0;
     $eshopqty = 0;
     $thetotal = 0;
     $eshoptotal = 0;
     if (isset($_SESSION['eshopcart' . $blog_id])) {
         $eshopcartarray = $_SESSION['eshopcart' . $blog_id];
         $currsymbol = $eshopoptions['currency_symbol'];
     }
     if (isset($_SESSION['eshopcart' . $blog_id])) {
         $eshopsize = sizeof($_SESSION['eshopcart' . $blog_id]);
         foreach ($_SESSION['eshopcart' . $blog_id] as $eshopdo => $eshopwop) {
             $eshopqty += $eshopwop['qty'];
         }
     }
     if (isset($_SESSION['final_price' . $blog_id]) && isset($_SESSION['eshopcart' . $blog_id])) {
         //should be working but there seems to be an eShop bug in storing the final_price value (doesn't multiply with quantity)
         //$thetotal=$_SESSION['final_price'.$blog_id];
         $eshopcart = $_SESSION['eshopcart' . $blog_id];
         $thetotal = 0;
         foreach ($eshopcart as $eshopcart_item) {
             $thetotal += $eshopcart_item['qty'] * $eshopcart_item['price'];
         }
         $eshoptotal = sprintf(__('%1$s%2$s', 'eshop'), $currsymbol, number_format_i18n($thetotal, __('2', 'eshop')));
     }
     $menu_item = array('cart_url' => get_permalink($eshopoptions['cart']), 'shop_page_url' => get_home_url(), 'cart_contents_count' => $eshopqty, 'cart_total' => $eshoptotal);
     return $menu_item;
 }