Example #1
8
/**
 * This function outputs a 404 "Not Found" error message
 *
 * @since 1.6
 */
function genesis_404()
{
    echo genesis_html5() ? '<article class="entry">' : '<div class="post hentry">';
    printf('<h1 class="entry-title">%s</h1>', apply_filters('genesis_404_entry_title', __('Not found, error 404', 'genesis')));
    echo '<div class="entry-content">';
    if (genesis_html5()) {
        echo apply_filters('genesis_404_entry_content', '<p>' . sprintf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it by using the search form below.', 'genesis'), trailingslashit(home_url())) . '</p>');
        get_search_form();
    } else {
        ?>

			<p><?php 
        printf(__('The page you are looking for no longer exists. Perhaps you can return back to the site\'s <a href="%s">homepage</a> and see if you can find what you are looking for. Or, you can try finding it with the information below.', 'genesis'), trailingslashit(home_url()));
        ?>
</p>



	<?php 
    }
    if (!genesis_html5()) {
        genesis_sitemap('h4');
    } elseif (genesis_a11y('404-page')) {
        echo '<h2>' . __('Sitemap', 'genesis') . '</h2>';
        genesis_sitemap('h3');
    }
    echo '</div>';
    echo genesis_html5() ? '</article>' : '</div>';
}
 /**
  * s2Member's PayPal Auto-Return/PDT handler (inner processing routine).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in (extracted) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_before_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     $paypal["s2member_log"][] = "No Return-Data. Customer MUST wait for Email Confirmation.";
     $paypal["s2member_log"][] = "Note. This can sometimes happen when/if you are offering an Initial/Trial Period. There are times when a Payment Gateway will NOT supply s2Member with any data immediately after checkout. When/if this happens, s2Member must process the transaction via IPN only (i.e. behind-the-scene), and the Customer must wait for Email Confirmation in these cases.";
     $paypal["s2member_log"][] = var_export($_REQUEST, true);
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_during_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     if ($custom_success_redirection) {
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL: " . $custom_success_redirection . ".";
         wp_redirect($custom_success_redirection);
     } else {
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page (after asking Customer to check their email).";
         echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! (you MUST check your email before proceeding).</strong><br /><br />* Note: It can take <em>(up to 15 minutes)</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), _x("Back To Home Page", "s2member-front", "s2member"), home_url("/"));
     }
     foreach (array_keys(get_defined_vars()) as $__v) {
         $__refs[$__v] =& ${$__v};
     }
     do_action("ws_plugin__s2member_during_paypal_return_after_no_return_data", get_defined_vars());
     unset($__refs, $__v);
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_no_tx_data", $paypal, get_defined_vars());
 }
Example #3
0
/**
 * Replace the default search form with a Genesis-specific form.
 *
 * The exact output depends on whether the child theme supports HTML5 or not.
 *
 * Applies the `genesis_search_text`, `genesis_search_button_text`, `genesis_search_form_label` and
 * `genesis_search_form` filters.
 *
 * @since 0.2.0
 *
 * @uses genesis_html5() Check for HTML5 support.
 *
 * @return string HTML markup.
 */
function genesis_search_form()
{
    $search_text = get_search_query() ? apply_filters('the_search_query', get_search_query()) : apply_filters('genesis_search_text', __('Search this website', 'genesis') . ' &#x02026;');
    $button_text = apply_filters('genesis_search_button_text', esc_attr__('Search', 'genesis'));
    $onfocus = "if ('" . esc_js($search_text) . "' === this.value) {this.value = '';}";
    $onblur = "if ('' === this.value) {this.value = '" . esc_js($search_text) . "';}";
    //* Empty label, by default. Filterable.
    $label = apply_filters('genesis_search_form_label', '');
    $value_or_placeholder = get_search_query() == '' ? 'placeholder' : 'value';
    if (genesis_html5()) {
        $form = sprintf('<form %s>', genesis_attr('search-form'));
        if (genesis_a11y('search-form')) {
            if ('' == $label) {
                $label = apply_filters('genesis_search_text', __('Search this website', 'genesis'));
            }
            $form_id = uniqid('searchform-');
            $form .= sprintf('<meta itemprop="target" content="%s"/><label class="search-form-label screen-reader-text" for="%s">%s</label><input itemprop="query-input" type="search" name="s" id="%s" %s="%s" /><input type="submit" value="%s" /></form>', home_url('/?s={s}'), esc_attr($form_id), esc_html($label), esc_attr($form_id), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        } else {
            $form .= sprintf('%s<meta itemprop="target" content="%s"/><input itemprop="query-input" type="search" name="s" %s="%s" /><input type="submit" value="%s"  /></form>', esc_html($label), home_url('/?s={s}'), $value_or_placeholder, esc_attr($search_text), esc_attr($button_text));
        }
    } else {
        $form = sprintf('<form method="get" class="searchform search-form" action="%s" role="search" >%s<input type="text" value="%s" name="s" class="s search-input" onfocus="%s" onblur="%s" /><input type="submit" class="searchsubmit search-submit" value="%s" /></form>', home_url('/'), esc_html($label), esc_attr($search_text), esc_attr($onfocus), esc_attr($onblur), esc_attr($button_text));
    }
    return apply_filters('genesis_search_form', $form, $search_text, $button_text, $label);
}
Example #4
0
function generatePayment($data)
{
    if (empty($data['amount'])) {
        $data['amount'] = 10;
    }
    $return['result'] = true;
    $donationOptions = get_theme_mod('donation_options');
    $paypalEmail = $donationOptions['email'];
    $donor_data['post_title'] = $data['first_name'] . ' ' . $data['last_name'];
    $donor_data['post_type'] = 'donor';
    $donor_id = wp_insert_post($donor_data);
    update_post_meta($donor_id, 'donor_email', $data['email']);
    update_post_meta($donor_id, 'donor_phone', $data['phone']);
    update_post_meta($donor_id, 'donor_address', $data['address']);
    update_post_meta($donor_id, 'donor_note', $data['notes']);
    update_post_meta($donor_id, 'donor_amount', $data['amount']);
    if (!empty($data['sign_up'])) {
        update_post_meta($donor_id, 'donor_subscribe', $data['sign_up']);
    }
    if ($data['donation_id'] == 0) {
        update_post_meta($donor_id, 'donor_donation', '');
        $returnUrl = home_url();
        $items['item_name'] = __('Site Donation', STM_DOMAIN);
    } else {
        update_post_meta($donor_id, 'donor_donation', get_the_title($data['donation_id']));
        $returnUrl = get_permalink($data['donation_id']);
        $items['item_name'] = get_the_title($data['donation_id']);
    }
    $items['item_number'] = $data['donation_id'];
    $items['amount'] = $data['amount'];
    $items = http_build_query($items);
    $return = 'https://' . paypal_url() . '/cgi-bin/webscr?cmd=_xclick&business=' . $paypalEmail . '&' . $items . '&no_shipping=1&no_note=1&currency_code=' . $donationOptions['currency'] . '&bn=PP%2dBuyNowBF&charset=UTF%2d8&invoice=' . $donor_id . '&return=' . $returnUrl . '&rm=2&notify_url=' . $returnUrl;
    return $return;
}
Example #5
0
function roots_nice_search_redirect()
{
    if (is_search() && strpos($_SERVER['REQUEST_URI'], '/wp-admin/') === false && strpos($_SERVER['REQUEST_URI'], '/search/') === false) {
        wp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), get_query_var('s'))));
        exit;
    }
}
    /**
     * Output the form
     *
     * @param array $atts
     */
    public static function output($atts, $content = null)
    {
        global $post, $wp;
        extract(shortcode_atts(self::options(), $atts));
        if ($content == null) {
            $content = self::content();
        }
        $current_url = add_query_arg($wp->query_string, '', home_url($wp->request));
        if (!isset($_GET['sp-unsubscribe'])) {
            ?>
<form method="post" action="<?php 
            echo home_url();
            ?>
">
			<input type="hidden" name="sendpress" value="post" />
			<input type="hidden" name="sp-shortcode" value="SC-Unsubscribe-Form" />
			<input type="hidden" name="sp-current-page" value="<?php 
            echo esc_url($current_url);
            ?>
" />
			<input type="text" name="sp-email" class="sp-input" placeholder="<?php 
            echo $placeholder;
            ?>
"/>
			<input type="submit" value="<?php 
            echo $btntxt;
            ?>
" />
			</form><?php 
        } else {
            echo do_shortcode($content);
        }
    }
 function gdlr_print_hotel_availability_item($settings = array())
 {
     $item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
     global $gdlr_spaces, $hotel_option;
     $margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
     $margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
     $current_date = current_time('Y-m-d');
     $next_date = date('Y-m-d', strtotime($current_date . "+1 days"));
     $value = array('gdlr-check-in' => $current_date, 'gdlr-night' => 1, 'gdlr-check-out' => $next_date, 'gdlr-room-number' => 1, 'gdlr-adult-number' => 1, 'gdlr-children-number' => 0);
     $ret = gdlr_get_item_title($settings);
     $ret .= '<div class="gdlr-hotel-availability-wrapper';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= ' gdlr-hotel-branches-enable';
     }
     $ret .= '" ' . $margin_style . $item_id . ' >';
     $ret .= '<form class="gdlr-hotel-availability gdlr-item" id="gdlr-hotel-availability" method="post" action="' . esc_url(add_query_arg(array($hotel_option['booking-slug'] => ''), home_url('/'))) . '" >';
     if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
         $ret .= gdlr_get_reservation_branch_combobox(array('title' => __('Hotel Branches', 'gdlr-hotel'), 'slug' => 'gdlr-hotel-branches', 'id' => 'gdlr-hotel-branches', 'value' => ''));
     }
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check In', 'gdlr-hotel'), 'slug' => 'gdlr-check-in', 'id' => 'gdlr-check-in', 'value' => $value['gdlr-check-in']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Night', 'gdlr-hotel'), 'slug' => 'gdlr-night', 'id' => 'gdlr-night', 'value' => $value['gdlr-night']));
     $ret .= gdlr_get_reservation_datepicker(array('title' => __('Check Out', 'gdlr-hotel'), 'slug' => 'gdlr-check-out', 'id' => 'gdlr-check-out', 'value' => $value['gdlr-check-out']));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Adults', 'gdlr-hotel'), 'slug' => 'gdlr-adult-number', 'id' => '', 'value' => $value['gdlr-adult-number'], 'multiple' => true));
     $ret .= gdlr_get_reservation_combobox(array('title' => __('Children', 'gdlr-hotel'), 'slug' => 'gdlr-children-number', 'id' => '', 'value' => $value['gdlr-children-number'], 'multiple' => true));
     $ret .= '<div class="gdlr-hotel-availability-submit" >';
     $ret .= '<input type="hidden" name="hotel_data" value="1" >';
     $ret .= '<input type="hidden" name="gdlr-room-number" value="1" />';
     $ret .= '<input type="submit" class="gdlr-reservation-bar-button gdlr-button with-border" value="' . __('Check Availability', 'gdlr-hotel') . '" >';
     $ret .= '</div>';
     $ret .= '<div class="clear"></div>';
     $ret .= '</form>';
     $ret .= '</div>';
     return $ret;
 }
Example #8
0
function fa_cache_avatar($avatar, $id_or_email, $size, $default, $alt)
{
    $avatar = str_replace(array("www.gravatar.com", "0.gravatar.com", "1.gravatar.com", "2.gravatar.com"), "cn.gravatar.com", $avatar);
    $tmp = strpos($avatar, 'http');
    $url = get_avatar_url($id_or_email, $size);
    $url = str_replace(array("www.gravatar.com", "0.gravatar.com", "1.gravatar.com", "2.gravatar.com"), "cn.gravatar.com", $url);
    $avatar2x = get_avatar_url($id_or_email, $size * 2);
    $avatar2x = str_replace(array("www.gravatar.com", "0.gravatar.com", "1.gravatar.com", "2.gravatar.com"), "cn.gravatar.com", $avatar2x);
    $g = substr($avatar, $tmp, strpos($avatar, "'", $tmp) - $tmp);
    $tmp = strpos($g, 'avatar/') + 7;
    $f = substr($g, $tmp, strpos($g, "?", $tmp) - $tmp);
    $w = home_url();
    $e = ABSPATH . 'avatar/' . $size . '*' . $f . '.jpg';
    $e2x = ABSPATH . 'avatar/' . $size * 2 . '*' . $f . '.jpg';
    $t = 1209600;
    if ((!is_file($e) || time() - filemtime($e) > $t) && (!is_file($e2x) || time() - filemtime($e2x) > $t)) {
        copy(htmlspecialchars_decode($g), $e);
        copy(htmlspecialchars_decode($avatar2x), $e2x);
    } else {
        $avatar = $w . '/avatar/' . $size . '*' . $f . '.jpg';
        $avatar2x = $w . '/avatar/' . $size * 2 . '*' . $f . '.jpg';
        if (filesize($e) < 1000) {
            copy($w . '/avatar/default.jpg', $e);
        }
        if (filesize($e2x) < 1000) {
            copy($w . '/avatar/default.jpg', $e2x);
        }
        $avatar = "<img alt='{$alt}' src='{$avatar}' srcset='{$avatar2x}' class='avatar avatar-{$size} photo' height='{$size}' width='{$size}' />";
    }
    return $avatar;
}
Example #9
0
/**
 * This function calibrefx_update_check is to ...
 */
function calibrefx_update_check()
{
    global $wp_version;
    /** Get time of last update check */
    $calibrefx_update = get_transient('calibrefx-update');
    /** If it has expired, do an update check */
    if (!$calibrefx_update) {
        $url = 'http://api.calibrefx.com/themes-update/';
        $options = apply_filters('calibrefx_update_remote_post_options', array('body' => array('theme_name' => 'calibrefx', 'theme_version' => FRAMEWORK_VERSION, 'url' => home_url(), 'wp_version' => $wp_version, 'php_version' => phpversion(), 'user-agent' => "WordPress/{$wp_version};")));
        $response = wp_remote_post($url, $options);
        $calibrefx_update = wp_remote_retrieve_body($response);
        /** If an error occurred, return FALSE, store for 48 hour */
        if ('error' == $calibrefx_update || is_wp_error($calibrefx_update) || !is_serialized($calibrefx_update)) {
            set_transient('calibrefx-update', array('new_version' => FRAMEWORK_VERSION), 60 * 60 * 48);
            return false;
        }
        /** Else, unserialize */
        $calibrefx_update = maybe_unserialize($calibrefx_update);
        /** And store in transient for 48 hours */
        set_transient('calibrefx-update', $calibrefx_update, 60 * 60 * 48);
    }
    /** If we're already using the latest version, return false */
    if (version_compare(FRAMEWORK_VERSION, $calibrefx_update['new_version'], '>=')) {
        return false;
    }
    return $calibrefx_update;
}
    /**
     * Renders Remote Viewing portion of Plugin Settings Page
     *
     * @since 1.0
     *
     * @return void
     */
    static function remote_viewing_section()
    {
        $value = get_option('simple_system_status_remote_url');
        $url = home_url() . '/?simple_system_status=' . $value;
        ?>
		<p><?php 
        _e('Users with this URL can view a plain-text version of your System Status.<br />This link can be handy in support forums, as access to this information can be removed after you receive the help you need.<br />Generating a new URL will safely void access to all who have the existing URL.', WC_QD_TXT);
        ?>
</p>
		<p><input type="text" readonly="readonly" class="sss-url sss-url-text" onclick="this.focus();this.select()" value="<?php 
        echo esc_url($url);
        ?>
" title="<?php 
        _e('To copy the System Status, click below then press Ctrl + C (PC) or Cmd + C (Mac).', WC_QD_TXT);
        ?>
" />&nbsp;&nbsp;<a href="<?php 
        echo esc_url($url);
        ?>
" target="_blank" class="sss-tiny sss-url-text-link"><?php 
        _e('test url', WC_QD_TXT);
        ?>
</a></p>
		<p class="submit">
			<input type="submit" onClick="return false;" class="button-secondary" name="generate-new-url" value="<?php 
        _e('Generate New URL', WC_QD_TXT);
        ?>
" />
		</p>
		<?php 
    }
function comber_login_guest()
{
    if (isset($_POST['comber_user_login']) && wp_verify_nonce($_POST['comber_login_nonce'], 'comber-login-nonce')) {
        // this returns the user ID and other info from the user name
        $user = get_userdatabylogin($_POST['comber_user_login']);
        if (!$user) {
            // if the user name doesn't exist
            comber_errors()->add('empty_username', __('Invalid username'));
        }
        if (!isset($_POST['comber_user_pass']) || $_POST['comber_user_pass'] == '') {
            // if no password was entered
            comber_errors()->add('empty_password', __('Please enter a password'));
        }
        // check the user's login with their password
        if (!wp_check_password($_POST['comber_user_pass'], $user->user_pass, $user->ID)) {
            // if the password is incorrect for the specified user
            comber_errors()->add('empty_password', __('Incorrect password'));
        }
        // retrieve all error messages
        $errors = comber_errors()->get_error_messages();
        // only log the user in if there are no errors
        if (empty($errors)) {
            wp_setcookie($_POST['comber_user_login'], $_POST['comber_user_pass'], true);
            wp_set_current_user($user->ID, $_POST['comber_user_login']);
            do_action('wp_login', $_POST['comber_user_login']);
            wp_redirect(home_url($_POST['current_page']));
            exit;
        } else {
            wp_redirect(home_url($_POST['current_page'] . '/?login=true&fail=true'));
            exit;
        }
    }
}
Example #12
0
 /**
  * Instantiates Env Manager object
  * 
  */
 protected function __construct()
 {
     $uploads_data = wp_upload_dir();
     $template_url = get_bloginfo('template_url');
     // Instantiate paths collection object
     $this->__urls = new Collection(array('home' => home_url(), 'admin' => admin_url(), 'plugins' => plugins_url(), 'content' => content_url(), 'uploads' => $uploads_data['baseurl'], 'themes' => str_replace('/' . basename($template_url), '', $template_url), 'theme' => $template_url));
 }
Example #13
0
/** Output custom styles CSS file **/
function tb_link_custom_styles()
{
    $output = '';
    if (apply_filters('tb_custom_styles', $output)) {
        echo '<link rel="stylesheet" href="' . home_url() . '/tb-custom-styles.css?' . time() . '" type="text/css" media="screen" />' . "\n";
    }
}
 /**
  * s2Member's PayPal® Auto-Return/PDT handler ( inner processing routine ).
  *
  * @package s2Member\PayPal
  * @since 110720
  *
  * @param array $vars Required. An array of defined variables passed by {@link s2Member\PayPal\c_ws_plugin__s2member_paypal_return_in::paypal_return()}.
  * @return array|bool The original ``$paypal`` array passed in ( extracted ) from ``$vars``, or false when conditions do NOT apply.
  */
 public static function cp($vars = array())
 {
     extract($vars);
     /* Extract all vars passed in from: ``c_ws_plugin__s2member_paypal_notify_in::paypal_notify()``. */
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_before_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     $paypal["s2member_log"][] = "Customer must wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_during_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if ($custom_success_redirection) {
         /* Using a custom success redirection URL? */
         $paypal["s2member_log"][] = "Redirecting Customer to a custom URL on success: " . $custom_success_redirection . ". However, the Customer MUST wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     } else {
         /* Else we use the default redirection URL for this scenario, which is the Home Page. */
         $paypal["s2member_log"][] = "Redirecting Customer to the Home Page. Customer must wait for Email Confirmation `proxy_use`: ( `ty-email` ).";
     }
     /**/
     echo c_ws_plugin__s2member_return_templates::return_template($paypal["subscr_gateway"], _x('<strong>Thank you! ( you MUST check your email before proceeding ).</strong><br /><br />* Note: It can take <em>( up to 15 minutes )</em> for Email Confirmation with important details. If you don\'t receive email confirmation in the next 15 minutes, please contact Support.', "s2member-front", "s2member") . ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"] || c_ws_plugin__s2member_utils_conds::pro_is_installed() && !empty($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_" . $paypal["subscr_gateway"] . "_sandbox"]) ? '<br /><br />' . _x('<strong>** Sandbox Mode **</strong> You may NOT receive this Email in Sandbox Mode. Sandbox addresses are usually bogus (for testing).', "s2member-front", "s2member") : ''), $custom_success_redirection ? _x("Check Your Email ( Then Click Here )", "s2member-front", "s2member") : esc_html("Back To Home Page", "s2member"), $custom_success_redirection ? $custom_success_redirection : home_url("/"));
     /**/
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__s2member_during_paypal_return_after_explicit_ty_email", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     return apply_filters("c_ws_plugin__s2member_paypal_return_in_proxy_ty_email", $paypal, get_defined_vars());
 }
    /**
     * Display the logo or site title
     */
    function siteorigin_north_display_logo()
    {
        $logo = siteorigin_setting('branding_logo');
        if (!empty($logo)) {
            $logo_id = attachment_url_to_postid($logo);
            $attrs = apply_filters('siteorigin_north_logo_attributes', array());
            ?>
<a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            echo wp_get_attachment_image($logo_id, 'full', false, $attrs);
            ?>
</a><?php 
        } else {
            ?>
<h1 class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1><?php 
        }
    }
Example #16
0
 public function index()
 {
     if (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) {
         $data['title'] = 'Elixir Industrial Equipment Inc. Cebu-Branch';
         $data['companyName'] = 'Elixir Industrial Equipment Inc.';
         $data['clients'] = $this->model->show_client();
         $user = $this->load_model('user');
         $data['current_user'] = $user->show_current_users_info($_SESSION['user_id']);
         $product = $this->load_model('product');
         $data['category'] = $product->show_category();
         $data['itemUnit'] = $product->show_item_unit();
         $notification = $this->load_model('product');
         $data['notification'] = $notification->product_lowItems();
         if ($data['current_user']['user_type'] == 2) {
             $this->load_template('home', $data, 'client');
         } else {
             if ($data['current_user']['user_type'] != 0) {
                 redirect_to(home_url());
             } else {
                 $this->load_template('home', $data, 'client');
             }
         }
     } else {
         redirect_to(home_url());
     }
 }
Example #17
0
function og_url($id)
{
    if ($id) {
        return image_url($id);
    }
    return home_url() . '/images/icons/fb-icon.png';
}
 public function widget($args, $instance)
 {
     if (!is_singular()) {
         return;
     }
     $the_id = get_the_ID();
     if (!comments_open($the_id)) {
         return;
     } else {
         $html = $args['before_widget'];
         if (!empty($instance['title'])) {
             $html .= $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
         }
         $api_url = esc_url(home_url('/')) . 'wp-json/wp/v2/comments';
         $author = __('NAME:', 'rest-api-widgets');
         $mailaddress = __('MAIL:', 'rest-api-widgets');
         $content = __('COMMENTS:', 'rest-api-widgets');
         $send_btn = __('SEND', 'rest-api-widgets');
         $success_text = __('Success! Reload now.', 'rest-api-widgets');
         $fail_text = __('Fail :(', 'rest-api-widgets');
         $html .= "<form action={$api_url} method='post' id='rest-api-widgets-comment'>";
         $html .= '<dl>';
         $html .= "<dt>{$author}</dt><dd><input name='author_name' value=''></dd>";
         $html .= "<dt>{$mailaddress}</dt><dd><input name='author_email' value=''></dd>";
         $html .= "<dt>{$content}</dt><dd><textarea name='content' id=' cols='30' rows='10'></textarea></dd>";
         $html .= '</dl>';
         $html .= "<input type='hidden' name='post' value='{$the_id}'>";
         $html .= "<input type='hidden' name='success_text' value='{$success_text}'>";
         $html .= "<input type='hidden' name='fail_text' value='{$fail_text}'>";
         $html .= "<button>{$send_btn}</button>";
         $html .= '</form>';
     }
     echo $html . $args['after_widget'];
 }
Example #19
0
function espresso_display_finalize_payment_header($data)
{
    global $org_options;
    ?>
	<div class="event_espresso_attention event-messages ui-state-highlight">
		<span class="ui-icon ui-icon-alert"></span>
		<p><strong><?php 
    _e('Attention!', 'event_espresso');
    ?>
</strong><br />
	<?php 
    _e('If using one of the offline payment options, please make note of the information below, then', 'event_espresso');
    ?>
			<a href="<?php 
    echo home_url() . '/?page_id=' . $org_options['return_url'];
    ?>
&amp;payment_type=cash_check&amp;id=<?php 
    echo $data['attendee_id'] . '&r_id=' . $data['registration_id'];
    ?>
" class="inline-link" title="<?php 
    _e('Finalize your registration', 'event_espresso');
    ?>
"><?php 
    _e('click here to finalize your registration', 'event_espresso');
    ?>
</a>
		</p>
	</div>
	<?php 
}
/**
 * Replaces the Wordpress logo with a custom logo on the admin login screen and makes it link back to the site homepage.
 * 
 * @param  string $logo_path The absolute path to the logo image
 * @param  array $dims An associative array containing the 'width' and 'height' of the image. These values will be used directly as the css property values for width and height so units are required.
 */
function bp_login_logo($logo_path, $dims)
{
    add_action('login_enqueue_scripts', function () use($logo_path, $dims) {
        ?>
        <style type="text/css">
            body.login div#login h1 a {
                background-image: url(<?php 
        echo $logo_path;
        ?>
);
                -webkit-background-size: 100%;
                background-size: 100%;
                width: <?php 
        echo $dims['width'];
        ?>
;
                height: <?php 
        echo $dims['height'];
        ?>
;
            }
        </style>
    <?php 
    });
    add_filter('login_headerurl', function () {
        return home_url();
    });
}
Example #21
0
 /**
  * Constructor for the gateway.
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     $this->id = 'ecpay';
     $this->icon = apply_filters('woocommerce_ecpay_icon', plugins_url('icon/green_log_40.gif', __FILE__));
     $this->has_fields = false;
     $this->method_title = __('ecpay', 'woocommerce');
     // Load the form fields.
     $this->init_form_fields();
     // Load the settings.
     $this->init_settings();
     // Define user set variables
     $this->title = $this->settings['title'];
     $this->description = $this->settings['description'];
     $this->mer_id = $this->settings['mer_id'];
     $this->check_code = $this->settings['check_code'];
     $this->notify_url = trailingslashit(home_url());
     $this->gateway = "https://ecpay.com.tw/form_Sc_to5.php";
     // Actions
     add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
     add_action('woocommerce_thankyou_ecpay', array($this, 'thankyou_page'));
     //需與id名稱大小寫相同
     add_action('woocommerce_receipt_ecpay', array($this, 'receipt_page'));
     //add_action('init', array(&$this, 'check_ecpay_response'));
     // Customer Emails
     //add_action('woocommerce_email_before_order_table', array(&$this, 'email_instructions'), 10, 2);
 }
 function mh_newsdesk_lite_logo()
 {
     $header_img = get_header_image();
     $header_title = get_bloginfo('name');
     $header_desc = get_bloginfo('description');
     echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr($header_title) . '" rel="home">' . "\n";
     echo '<div class="logo-wrap" role="banner">' . "\n";
     if ($header_img) {
         echo '<img src="' . esc_url($header_img) . '" height="' . get_custom_header()->height . '" width="' . get_custom_header()->width . '" alt="' . esc_attr($header_title) . '" />' . "\n";
     }
     if (0 && display_header_text()) {
         $text_color = get_header_textcolor();
         if ($text_color != get_theme_support('custom-header', 'default-text-color')) {
             echo '<style type="text/css" id="mh-header-css">';
             echo '.logo-title, .logo-tagline { color: #' . esc_attr($text_color) . '; }';
             echo '</style>' . "\n";
         }
         echo '<div class="logo">' . "\n";
         if ($header_title) {
             echo '<h1 class="logo-title">' . esc_attr($header_title) . '</h1>' . "\n";
         }
         if ($header_desc) {
             echo '<h2 class="logo-tagline">' . esc_attr($header_desc) . '</h2>' . "\n";
         }
         echo '</div>' . "\n";
     }
     echo '</div>' . "\n";
     echo '</a>' . "\n";
 }
Example #23
0
    /**
     * Custom header image markup displayed on the Appearance > Header admin panel.
     *
     * @see landscape_custom_header_setup().
     *
     * @since landscape 1.0
     */
    function landscape_admin_header_image()
    {
        ?>
	<div id="headimg">
		<?php 
        if ('blank' == get_header_textcolor() || '' == get_header_textcolor()) {
            $style = ' style="display:none;"';
        } else {
            $style = ' style="color:#' . get_header_textcolor() . ';"';
        }
        ?>
		<h1><a id="name"<?php 
        echo $style;
        ?>
 onclick="return false;" href="<?php 
        echo esc_url(home_url('/'));
        ?>
"><?php 
        bloginfo('name');
        ?>
</a></h1>
		<div id="desc"<?php 
        echo $style;
        ?>
><?php 
        bloginfo('description');
        ?>
</div>
	</div>
<?php 
    }
function slimmy_search_form($form)
{
    $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . home_url('/') . '" >
	<input type="text" class="input-search input-search-icon width-100" placeholder="Search" value="' . get_search_query() . '" name="s" id="s" />
	</form>';
    return $form;
}
 function zn_logo($logo = null, $use_transparent = false, $tag = null, $class = null)
 {
     $transparent_logo = '';
     if (!$tag) {
         if (is_front_page()) {
             $tag = 'h1';
         } else {
             $tag = 'h3';
         }
     }
     if ('transparent_header' == get_post_meta(zn_get_the_id(), 'header_style', true) && $use_transparent) {
         $transparent_logo = zget_option('transparent_logo', 'general_options');
     }
     if ($logo || ($logo = zget_option('logo', 'general_options'))) {
         // TODO: remove this as it is slow withouth the full path
         $logo_size = array('300', '100');
         //print_z($logo_size);
         $hwstring = image_hwstring($logo_size[0], $logo_size[1]);
         $logo = '<img class="non-transparent" src="' . set_url_scheme($logo) . '" ' . $hwstring . ' alt="' . get_bloginfo('name') . '" title="' . get_bloginfo('description') . '" />';
         if ($transparent_logo && $transparent_logo != ' ') {
             $logo .= '<img class="only-transparent" src="' . set_url_scheme($transparent_logo) . '" alt="' . get_bloginfo('name') . '" title="' . get_bloginfo('description') . '" />';
         }
         $logo = "<{$tag} class='logo {$class}' id='logo'><a href='" . home_url('/') . "'>" . $logo . "</a></{$tag}>";
     } else {
         $logo = '<img src="' . THEME_BASE_URI . '/images/logo.png" alt="' . get_bloginfo('name') . '" title="' . get_bloginfo('description') . '" />';
         $logo = "<{$tag} class='logo {$class}' id='logo'><a href='" . home_url('/') . "'>" . $logo . "</a></{$tag}>";
     }
     return $logo;
 }
Example #26
0
 function __construct()
 {
     $this->id = 'meowallet_payment';
     $this->icon = apply_filters('woocommerce_mw_icon', mw_plugin_dir . 'assets/mw.png');
     $this->method_title = __('MEO Wallet', 'meowallet');
     $this->has_fields = true;
     $this->notify_url = str_replace('https:', 'http:', add_query_arg('wc-api', 'WC_MEOWallet_Plugin', home_url('/')));
     $this->init_form_fields();
     $this->init_settings();
     $this->enabled = $this->get_option('enabled');
     $this->title = $this->get_option('title');
     $this->description = $this->get_option('description');
     $this->apikey_live = $this->get_option('apikey_live');
     $this->environment = $this->get_option('environment');
     $this->apikey_sandbox = $this->get_option('apikey_sandbox');
     $this->to_euro_rate = $this->get_option('to_euro_rate');
     $this->log = new WC_Logger();
     add_action('woocommerce_api_wc_gateway_mw', array(&$this, 'meowallet_response'));
     add_action('woocommerce_update_options_payment_gateways_' . $this->id, array(&$this, 'process_admin_options'));
     add_action('wp_enqueue_scripts', array(&$this, 'meowallet_ckeckout_scripts'));
     add_action('print_admin_scripts_wc_ps', array(&$this, 'meowallet_admin_scripts'));
     add_action('print_admin_scripts_wc_settings', array(&$this, 'meowallet_admin_scripts'));
     add_action('validate_request', array($this, '_requests'));
     // http://stackoverflow.com/questions/22577727/problems-adding-action-links-to-wordpress-plugin
     //$prefix = is_network_admin() ? 'network_admin_' : '';
     //add_filter("{$prefix}plugin_action_links_$plugin_basename",array($this,'plugin_action_links'),10,4);
     add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'plugin_action_links'));
 }
Example #27
0
function soloUsuarioRegistrado()
{
    if (!is_user_logged_in()) {
        wp_redirect(home_url(), 302);
        exit;
    }
}
 public function __construct()
 {
     $plugin_dir = plugin_dir_url(__FILE__);
     global $woocommerce;
     $this->id = 'twocheckoutpp';
     $this->icon = apply_filters('woocommerce_twocheckoutpp_icon', '' . $plugin_dir . 'paypal.png');
     $this->has_fields = true;
     // Load the settings
     $this->init_form_fields();
     $this->init_settings();
     // Define user set variables
     $this->title = $this->get_option('title');
     $this->seller_id = $this->get_option('seller_id');
     $this->secret_word = $this->get_option('secret_word');
     $this->description = $this->get_option('description');
     $this->notify_url = str_replace('https:', 'http:', add_query_arg('wc-api', 'WC_Gateway_Twocheckoutpp', home_url('/')));
     $this->debug = $this->get_option('debug');
     self::$log_enabled = $this->debug;
     // Actions
     add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page'));
     // Save options
     add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
     // Payment listener/API hook
     add_action('woocommerce_api_wc_gateway_twocheckoutpp', array($this, 'check_ipn_response'));
     if (!$this->is_valid_for_use()) {
         $this->enabled = false;
     }
 }
 public function send_recipient_email($name = '', $email = '', $gift_message = '', $payment_id = 0)
 {
     if (!class_exists('RCP_Discounts')) {
         return false;
     }
     global $edd_options;
     $db = new RCP_Discounts();
     $site_name = get_bloginfo('name');
     $discount = $db->get_by('code', md5($name . $email . $payment_id));
     $subject = sprintf(__('Gift Certificate to %s', 'rcp-gifts'), $site_name);
     $from_name = isset($edd_options['from_name']) ? $edd_options['from_name'] : get_bloginfo('name');
     $from_email = isset($edd_options['from_email']) ? $edd_options['from_email'] : get_option('admin_email');
     $body = '<p>' . __("Hello!", "rcp-gifts") . '</p>';
     $body .= '<p>' . sprintf(__("Someone has gifted you a membership to %s", "rcp-gifts"), $site_name) . '</p>';
     if (!empty($gift_message) && __('Enter the a message to send to the recipient', 'rcp-gifts') != $gift_message) {
         $body .= '<p>' . __("The following message was included with the gift: ", "rcp-gifts") . '</p>';
         $body .= '<blockquote>' . $gift_message . '</blockquote>';
     }
     $body .= '<p>' . sprintf(__("Enter %s during registration to redeem your gift.", "rcp-gifts"), $discount->code) . '</p>';
     $body .= '<p>' . sprintf(__("Visit %s to claim your membership gift.", "rcp-gifts"), '<a href="' . home_url() . '">' . home_url() . '</a>') . '</p>';
     $emails = new EDD_Emails();
     $emails->__set('from_address', $from_email);
     $emails->__set('from_name', $from_name);
     $emails->send($email, $subject, $body);
 }
Example #30
0
function custom_remove_no_admin_access()
{
    if (!defined('DOING_AJAX') && !current_user_can('manage_options')) {
        wp_redirect(home_url());
        die;
    }
}