public function update_qs_add_to_cart_url($cart_url)
 {
     $ref_url = wp_get_referer();
     $ref_url = remove_query_arg(array('added-to-cart', 'add-to-cart'), $ref_url);
     $ref_url = add_query_arg(array('add-to-cart' => $this->id), $ref_url);
     return $ref_url;
 }
示例#2
1
 /**
  * Get fonts URL.
  *
  * @return string
  */
 function educator_theme_fonts_url()
 {
     $fonts = array();
     $fonts[] = get_theme_mod('headings_font', 'Open Sans');
     $fonts[] = get_theme_mod('body_font', 'Open Sans');
     $font_families = array();
     $available_fonts = apply_filters('ib_theme_get_fonts', array());
     foreach ($fonts as $font_name) {
         if (isset($font_families[$font_name])) {
             continue;
         }
         if (isset($available_fonts[$font_name])) {
             $font = $available_fonts[$font_name];
             $font_families[$font_name] = urlencode($font_name);
             if (!empty($font['font_styles'])) {
                 $font_families[$font_name] .= ':' . $font['font_styles'];
             }
         }
     }
     if (empty($font_families)) {
         return false;
     }
     $query_args = array(array('family' => implode('|', $font_families)));
     $charater_sets = get_theme_mod('charater_sets', 'latin,latin-ext');
     if (!empty($charater_sets)) {
         $query_args['subset'] = educator_sanitize_character_sets($charater_sets);
     }
     return add_query_arg($query_args, '//fonts.googleapis.com/css');
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $woocommerce, $woocommerce_settings, $current_section, $current_tab;
     if (!current_user_can('manage_woocommerce')) {
         wp_die(__('You do not have sufficient permissions to access this page.', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN));
     }
     do_action('woocommerce_mailpoet_settings_start');
     $mailpoet_settings = $this->get_settings();
     // Get current section
     $current_section = empty($_REQUEST['section']) ? 'general' : sanitize_text_field(urldecode($_REQUEST['section']));
     $current = $current_section ? '' : ' class="current"';
     // Creates each settings section.
     $mailpoet_section = apply_filters('woocommerce_mailpoet_settings_sections', array('general' => __('General', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN), 'lists' => __('Lists', MAILPOET_WOOCOMMERCE_TEXT_DOMAIN)));
     foreach ($mailpoet_section as $section => $title) {
         $title = ucwords($title);
         $current = $section == $current_section ? ' class="current"' : '';
         $links[] = '<a href="' . add_query_arg('section', $section, admin_url('admin.php?page=woocommerce_settings&tab=mailpoet')) . '"' . $current . '>' . esc_html($title) . '</a>';
     }
     echo '<ul class="subsubsub"><li>' . implode('| </li><li>', $links) . '</li></ul><br class="clear" />';
     woocommerce_admin_fields($mailpoet_settings);
     if ($current_section == 'lists') {
         include_once MailPoet_WooCommerce_Add_on()->plugin_path() . '/includes/admin/settings/settings-newsletters.php';
         $mailpoet_list = mailpoet_lists();
         do_action('woocommerce_mailpoet_list_newsletters', $mailpoet_list);
     }
 }
function mm_ux_log($args = array())
{
    $url = "https://ssl.google-analytics.com/collect";
    global $title;
    if (empty($_SERVER['REQUEST_URI'])) {
        return;
    }
    $path = explode('wp-admin', $_SERVER['REQUEST_URI']);
    if (empty($path) || empty($path[1])) {
        $path = array("", " ");
    }
    $defaults = array('v' => '1', 'tid' => 'UA-39246514-3', 't' => 'pageview', 'cid' => md5(get_option('siteurl')), 'uid' => md5(get_option('siteurl') . get_current_user_id()), 'cn' => 'mojo_wp_plugin', 'cs' => 'mojo_wp_plugin', 'cm' => 'plugin_admin', 'ul' => get_locale(), 'dp' => $path[1], 'sc' => '', 'ua' => @$_SERVER['HTTP_USER_AGENT'], 'dl' => $path[1], 'dh' => get_option('siteurl'), 'dt' => $title, 'ec' => '', 'ea' => '', 'el' => '', 'ev' => '');
    if (isset($_SERVER['REMOTE_ADDR'])) {
        $defaults['uip'] = $_SERVER['REMOTE_ADDR'];
    }
    $params = wp_parse_args($args, $defaults);
    $test = get_transient('mm_test', '');
    if (isset($test['key']) && isset($test['name'])) {
        $params['cm'] = $params['cm'] . "_" . $test['name'] . "_" . $test['key'];
    }
    //use test account for testing
    if (defined('WP_DEBUG') && WP_DEBUG) {
        $params['tid'] = 'UA-19617272-27';
    }
    $z = wp_rand(0, 1000000000);
    $query = http_build_query(array_filter($params));
    $args = array('body' => $query, 'method' => 'POST', 'blocking' => false);
    $url = add_query_arg(array('z' => $z), $url);
    wp_remote_post($url, $args);
}
function igthemes_font_url()
{
    $fonts_url = '';
    $fonts = array();
    $subsets = 'latin,latin-ext';
    /*
     * Translators: If there are characters in your language that are not supported,
     * translate this to 'off'. Do not translate into your own language.
     */
    if ('off' !== _x('on', 'Open Sans font: on or off', 'store-wp')) {
        $fonts[] = 'Open Sans:300italic,400italic,700italic,300,400,700';
    }
    /*
     * Translators: To add an additional character subset specific to your language,
     * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     */
    $subset = _x('no-subset', 'Add new subset (greek, cyrillic, vietnamese)', 'store-wp');
    if ('cyrillic' == $subset) {
        $subsets .= ',cyrillic,cyrillic-ext';
    } elseif ('greek' == $subset) {
        $subsets .= ',greek,greek-ext';
    } elseif ('devanagari' == $subset) {
        $subsets .= ',devanagari';
    }
    if ($fonts) {
        $fonts_url = add_query_arg(array('family' => urlencode(implode('|', $fonts)), 'subset' => urlencode($subsets)), '//fonts.googleapis.com/css');
    }
    return $fonts_url;
}
/**
 * Add contextual help to the Themes and Post edit screens.
 *
 * @since Twenty Fourteen 1.0
 */
function twentyfourteen_contextual_help()
{
    if ('admin_head-edit.php' === current_filter() && 'post' !== $GLOBALS['typenow']) {
        return;
    }
    get_current_screen()->add_help_tab(array('id' => 'twentyfourteen', 'title' => __('Twenty Fourteen', 'twentyfourteen'), 'content' => '<ul>' . '<li>' . sprintf(__('The home page features your choice of up to 6 posts prominently displayed in a grid or slider, controlled by a <a href="%1$s">tag</a>; you can change the tag and layout in <a href="%2$s">Appearance &rarr; Customize</a>. If no posts match the tag, <a href="%3$s">sticky posts</a> will be displayed instead.', 'twentyfourteen'), esc_url(add_query_arg('tag', _x('featured', 'featured content default tag slug', 'twentyfourteen'), admin_url('edit.php'))), admin_url('customize.php'), admin_url('edit.php?show_sticky=1')) . '</li>' . '<li>' . sprintf(__('Enhance your site design by using <a href="%s">Featured Images</a> for posts you&rsquo;d like to stand out (also known as post thumbnails). This allows you to associate an image with your post without inserting it. Twenty Fourteen uses featured images for posts and pages&mdash;above the title&mdash;and in the Featured Content area on the home page.', 'twentyfourteen'), 'https://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail') . '</li>' . '<li>' . sprintf(__('For an in-depth tutorial, and more tips and tricks, visit the <a href="%s">Twenty Fourteen documentation</a>.', 'twentyfourteen'), 'https://codex.wordpress.org/Twenty_Fourteen') . '</li>' . '</ul>'));
}
 public function step_forward($step = 1, $part = '')
 {
     $step++;
     $redirect = add_query_arg(array('page' => 'affiliate-wp-migrate', 'type' => 'wp-affiliate', 'part' => $part, 'step' => $step), admin_url('index.php'));
     wp_redirect($redirect);
     exit;
 }
示例#8
0
 /**
  * @see CPAC_Column_Actions::get_actions()
  * @since 2.4.7
  */
 public function get_actions($id)
 {
     $actions = array();
     $user_object = new WP_User($id);
     $screen = get_current_screen();
     if ('site-users-network' == $screen->id) {
         $url = "site-users.php?id={$this->site_id}&amp;";
     } else {
         $url = 'users.php?';
     }
     if (get_current_user_id() == $user_object->ID) {
         $edit_link = 'profile.php';
     } else {
         $edit_link = esc_url(add_query_arg('wp_http_referer', urlencode(stripslashes($_SERVER['REQUEST_URI'])), "user-edit.php?user_id={$user_object->ID}"));
     }
     if (current_user_can('edit_user', $user_object->ID)) {
         $edit = "<strong><a href=\"{$edit_link}\">{$user_object->user_login}</a></strong><br />";
         $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
     } else {
         $edit = "<strong>{$user_object->user_login}</strong><br />";
     }
     if (!is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('delete_user', $user_object->ID)) {
         $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("users.php?action=delete&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Delete') . "</a>";
     }
     if (is_multisite() && get_current_user_id() != $user_object->ID && current_user_can('remove_user', $user_object->ID)) {
         $actions['remove'] = "<a class='submitdelete' href='" . wp_nonce_url($url . "action=remove&amp;user={$user_object->ID}", 'bulk-users') . "'>" . __('Remove') . "</a>";
     }
     return $actions;
 }
示例#9
0
/**
 * Render Wish List Columns
 *
 * @since 1.0
 * @param string $column_name Column name
 * @param int $post_id Download (Post) ID
 * @return void
 */
function edd_wl_render_admin_columns($column_name, $post_id)
{
    if (get_post_type($post_id) == 'edd_wish_list') {
        $items = get_post_meta(get_the_ID(), 'edd_wish_list', true);
        switch ($column_name) {
            case 'downloads':
                if ($items) {
                    echo count($items);
                } else {
                    echo 0;
                }
                break;
            case 'total':
                echo edd_wl_get_list_total(get_the_ID());
                break;
            case 'list_author':
                $post = get_post();
                if (0 == $post->post_author) {
                    echo __('Guest', 'edd-wish-lists');
                } else {
                    printf('<a href="%s">%s</a>', esc_url(add_query_arg(array('post_type' => $post->post_type, 'author' => get_the_author_meta('ID')), 'edit.php')), get_the_author());
                }
                break;
        }
    }
}
示例#10
0
function jetpack_instagram_handler($matches, $atts, $url)
{
    global $content_width;
    static $did_script;
    // keep a copy of the passed-in URL since it's modified below
    $passed_url = $url;
    $max_width = 698;
    $min_width = 320;
    if (is_feed()) {
        $media_url = sprintf('http://instagr.am/p/%s/media/?size=l', $matches[2]);
        return sprintf('<a href="%s" title="%s"><img src="%s" alt="Instagram Photo" /></a>', esc_url($url), esc_attr__('View on Instagram', 'jetpack'), esc_url($media_url));
    }
    $atts = shortcode_atts(array('width' => isset($content_width) ? $content_width : $max_width, 'hidecaption' => false), $atts);
    $atts['width'] = absint($atts['width']);
    if ($atts['width'] > $max_width || $min_width > $atts['width']) {
        $atts['width'] = $max_width;
    }
    // remove the modal param from the URL
    $url = remove_query_arg('modal', $url);
    // force .com instead of .am for https support
    $url = str_replace('instagr.am', 'instagram.com', $url);
    // The oembed endpoint expects HTTP, but HTTP requests 301 to HTTPS
    $instagram_http_url = str_replace('https://', 'http://', $url);
    $instagram_https_url = str_replace('http://', 'https://', $url);
    $url_args = array('url' => $instagram_http_url, 'maxwidth' => $atts['width']);
    if ($atts['hidecaption']) {
        $url_args['hidecaption'] = 'true';
    }
    $url = esc_url_raw(add_query_arg($url_args, 'https://api.instagram.com/oembed/'));
    // Don't use object caching here by default, but give themes ability to turn it on.
    $response_body_use_cache = apply_filters('instagram_cache_oembed_api_response_body', false, $matches, $atts, $passed_url);
    $response_body = false;
    if ($response_body_use_cache) {
        $cache_key = 'oembed_response_body_' . md5($url);
        $response_body = wp_cache_get($cache_key, 'instagram_embeds');
    }
    if (!$response_body) {
        // Not using cache (default case) or cache miss
        $instagram_response = wp_remote_get($url, array('redirection' => 0));
        if (is_wp_error($instagram_response) || 200 != $instagram_response['response']['code'] || empty($instagram_response['body'])) {
            return "<!-- instagram error: invalid oratv resource -->";
        }
        $response_body = json_decode($instagram_response['body']);
        if ($response_body_use_cache) {
            // if caching it is short-lived since this is a "Cache-Control: no-cache" resource
            wp_cache_set($cache_key, $response_body, 'instagram_embeds', HOUR_IN_SECONDS + mt_rand(0, HOUR_IN_SECONDS));
        }
    }
    if (!empty($response_body->html)) {
        if (!$did_script) {
            $did_script = true;
            add_action('wp_footer', 'jetpack_instagram_add_script');
        }
        // there's a script in the response, which we strip on purpose since it's added above
        $ig_embed = preg_replace('@<(script)[^>]*?>.*?</\\1>@si', '', $response_body->html);
    } else {
        $ig_embed = jetpack_instagram_iframe_embed($instagram_https_url, $atts);
    }
    return $ig_embed;
}
示例#11
0
 /**
  * Get HTML markup for the post's "avatar" image according conditional
  * fallback model.
  *
  * Accepts an ordered array of named avatar $fallbacks. Also accepts a string
  * of space-separated classes to add to the default classes.
  * @param   Ai1ec_Event $event          The event to get the avatar for
  * @param   array|null  $fallback_order Order of fallback in searching for
  *                                      images, or null to use default
  * @param   string      $classes        A space-separated list of CSS classes
  *                                      to apply to the outer <div> element.
  * @param   boolean     $wrap_permalink Whether to wrap the element in a link
  *                                      to the event details page.
  *
  * @return  string                   String of HTML if image is found
  */
 public function get_event_avatar(Ai1ec_Event $event, $fallback_order = null, $classes = '', $wrap_permalink = true)
 {
     $source = $size = null;
     $url = $this->get_event_avatar_url($event, $fallback_order, $source, $size);
     if (empty($url)) {
         return '';
     }
     $url = esc_attr($url);
     $classes = esc_attr($classes);
     // Set the alt tag (helpful for SEO).
     $alt = $event->get('post')->post_title;
     $location = $this->_registry->get('view.event.location')->get_short_location($event);
     if (!empty($location)) {
         $alt .= ' @ ' . $location;
     }
     $alt = esc_attr($alt);
     $size_attr = $size[0] ? "width=\"{$size['0']}\" height=\"{$size['1']}\"" : "";
     $html = '<img src="' . $url . '" alt="' . $alt . '" ' . $size_attr . ' />';
     if ($wrap_permalink) {
         $permalink = add_query_arg('instance_id', $event->get('instance_id'), get_permalink($event->get('post_id')));
         $html = '<a href="' . $permalink . '">' . $html . '</a>';
     }
     $classes .= ' ai1ec-' . $source;
     $classes .= $size[0] > $size[1] ? ' ai1ec-landscape' : ' ai1ec-portrait';
     $html = '<div class="ai1ec-event-avatar timely ' . $classes . '">' . $html . '</div>';
     return $html;
 }
/**
 * Admin Messages
 *
 * @access      private
 * @since       1.0 
 * @return      void
*/
function edd_admin_messages()
{
    global $typenow;
    if ('download' != $typenow) {
        return;
    }
    $edd_access_level = edd_get_menu_access_level();
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'discount_updated' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-discount-updated', __('Discount code updated.', 'edd'), 'updated');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'discount_update_failed' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-discount-updated-fail', __('There was a problem updating your discount code, please try again.', 'edd'), 'error');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'payment_deleted' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-payment-deleted', __('The payment has been deleted.', 'edd'), 'updated');
    }
    if (isset($_GET['edd-message']) && $_GET['edd-message'] == 'email_sent' && current_user_can($edd_access_level)) {
        add_settings_error('edd-notices', 'edd-payment-sent', __('The purchase receipt has been resent.', 'edd'), 'updated');
    }
    if (!get_option('edd_payment_totals_upgraded')) {
        // the payment history needs updated for version 1.1.9
        $url = add_query_arg('edd-action', 'upgrade_payments');
        $upgrade_notice = sprintf(__('The payment history needs updated. %s'), '<a href="' . wp_nonce_url($url, 'edd_upgrade_payments_nonce') . '">' . __('Click to Upgrade', 'edd') . '</a>');
        add_settings_error('edd-notices', 'edd-payments-upgrade', $upgrade_notice, 'error');
    }
    settings_errors('edd-notices');
}
示例#13
0
/**
 * Processes gateway select on checkout. Only for users without ajax / javascript
 *
 * @since 1.7
 *
 * @param $data
 */
function edd_process_gateway_select($data)
{
    if (isset($_POST['gateway_submit'])) {
        wp_redirect(add_query_arg('payment-mode', $_POST['payment-mode']));
        exit;
    }
}
/**
 * Append additional parameters to the oEmbed URL
 *
 * @used-by Filter: 'oembed_fetch_url'
 *
 * @param string $provider URL of the oEmbed provider.
 * @param string $url      URL of the content to be embedded.
 * @param array  $args     Optional arguments, usually passed from a shortcode.
 */
function oembed_query_args($provider, $url, $args = [])
{
    if (isset($args['autoplay']) && (bool) $args['autoplay']) {
        $provider = add_query_arg('autoplay', 1, $provider);
    }
    return $provider;
}
 /**
  * Set the path by type
  * @uses add_query_arg()
  * @return MslsAdminIcon
  */
 public function set_path()
 {
     if ('post' != $this->type) {
         $this->path = add_query_arg(array('post_type' => $this->type), $this->path);
     }
     return $this;
 }
示例#16
0
 function process_submission()
 {
     if (!current_user_can('pp_manage_settings')) {
         wp_die(__ppw('Cheatin&#8217; uh?'));
     }
     if (!empty($_REQUEST['pp_refresh_updates'])) {
         delete_site_transient('update_plugins');
         pp_get_version_info(true, false, true);
         wp_update_plugins();
         wp_redirect(admin_url('admin.php?page=pp-settings&pp_refresh_done=1'));
         exit;
     }
     if (!empty($_REQUEST['pp_renewal'])) {
         $opt_val = get_option('pp_support_key');
         $renewal_token = !is_array($opt_val) || count($opt_val) < 2 ? '' : substr($opt_val[1], 0, 16);
         $url = site_url('');
         $arr_url = parse_url($url);
         $site = urlencode(str_replace($arr_url['scheme'] . '://', '', $url));
         wp_redirect('http://presspermit.com/renewal/?pkg=press-permit-pro&site=' . $site . '&rt=' . $renewal_token);
         exit;
     }
     if (!empty($_REQUEST['pp_upload_config']) || !empty($_REQUEST['pp_support_forum'])) {
         require_once dirname(__FILE__) . '/admin/support_pp.php';
         $args = array();
         if (isset($_REQUEST['post_id'])) {
             $args['post_id'] = (int) $_REQUEST['post_id'];
         }
         if (isset($_REQUEST['term_taxonomy_id'])) {
             $args['term_taxonomy_id'] = (int) $_REQUEST['term_taxonomy_id'];
         }
         if (!empty($_REQUEST['pp_support_forum'])) {
             //$forum = ( ! empty( $_REQUEST['pp_forum'] ) ) ? sanitize_url($_REQUEST['pp_forum']) : 'pp2-technical-issues';
             $url = "http://presspermit.com/forums/";
             if (!empty($_REQUEST['pp_topic'])) {
                 $url = add_query_arg('pp_topic', $_REQUEST['pp_topic'], $url);
             }
             wp_redirect($url);
         }
         $success = _pp_support_upload($args);
         if (empty($_REQUEST['pp_support_forum'])) {
             if (-1 === $success) {
                 $flag = 'pp_config_no_change';
             } elseif ($success) {
                 $flag = 'pp_config_uploaded';
             } else {
                 $flag = 'pp_config_failed';
             }
             wp_redirect(admin_url("admin.php?page=pp-settings&{$flag}=1"));
         }
         exit;
     }
     if (isset($_POST['pp_submit'])) {
         $this->handle_submission('update');
     } elseif (isset($_POST['pp_defaults'])) {
         $this->handle_submission('default');
     } elseif (isset($_POST['pp_role_usage_defaults'])) {
         delete_option('pp_role_usage');
         pp_refresh_options();
     }
 }
 function after()
 {
     if (empty($this->upgrader->result['destination_name'])) {
         return;
     }
     $theme_info = $this->upgrader->theme_info();
     if (empty($theme_info)) {
         return;
     }
     $name = $theme_info['Name'];
     $stylesheet = $this->upgrader->result['destination_name'];
     $template = !empty($theme_info['Template']) ? $theme_info['Template'] : $stylesheet;
     $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => 1, 'TB_iframe' => 'true'), trailingslashit(esc_url(get_option('home')))));
     $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
     $install_actions = array('preview' => '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $name)) . '">' . __('Preview') . '</a>', 'activate' => '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $name)) . '">' . __('Activate') . '</a>');
     if (is_network_admin() && current_user_can('manage_network_themes')) {
         $install_actions['network_enable'] = '<a href="' . esc_url(wp_nonce_url('themes.php?action=enable&amp;theme=' . $template, 'enable-theme_' . $template)) . '" title="' . esc_attr__('Enable this theme for all sites in this network') . '" target="_parent">' . __('Network Enable') . '</a>';
     }
     $install_actions['themes_page'] = '<a href="' . self_admin_url('themes.php') . '" title="' . esc_attr__('Themes page') . '" target="_parent">' . __('View Installed Themes', 'wp-app-store') . '</a>';
     if (!$this->result || is_wp_error($this->result) || is_network_admin()) {
         unset($install_actions['activate'], $install_actions['preview']);
     }
     $install_actions = apply_filters('install_theme_complete_actions', $install_actions, $this->api, $stylesheet, $theme_info);
     if (!empty($install_actions)) {
         $this->feedback(implode(' | ', (array) $install_actions));
     }
 }
    protected function tfoot_append()
    {
        $prev = isset($_REQUEST['prev']) ? esc_attr($_REQUEST['prev']) : '';
        $clear_cart_url = add_query_arg(array('prev' => $prev, '_wp_nonce' => wp_create_nonce('wpsc-clear-cart')), wpsc_get_cart_url('clear'));
        ?>
		<tr class="wpsc-cart-item-table-actions">
			<td></td>
			<td colspan="<?php 
        echo count($this->columns) - 1;
        ?>
">
				<a class="wpsc-button wpsc-button-small wpsc-clear-cart" href="<?php 
        echo esc_url($clear_cart_url);
        ?>
"><?php 
        esc_html_e('Clear Cart', 'wp-e-commerce');
        ?>
</a>
				<input type="hidden" name="action" value="update_quantity" />
				<input type="hidden" name="prev" value="<?php 
        echo $prev;
        ?>
">
			</td>
		</tr>
		<?php 
    }
示例#19
0
 /**
  * Mange column data
  *
  * Default Column for listing table
  */
 function column_default($item, $column_name)
 {
     switch ($column_name) {
         case 'seller_store':
             return $item[$column_name];
         case 'curr_user_name':
             return $item[$column_name];
         case 'curr_user_email':
             return $item[$column_name];
         case 'user_rating':
             return $item[$column_name] . ' / 5';
         case 'user_comment':
             return $item[$column_name];
         case 'post_status':
             $seller_review_params = array('seller_review_id' => $item['ID'], 'seller_review_status' => $item['post_status']);
             $seller_review_query = add_query_arg($seller_review_params, admin_url());
             return '<a class="button" href="' . $seller_review_query . '">' . ucwords($item[$column_name]) . '</a>';
         case 'post_date':
             $format = get_option('date_format') . ' ' . get_option('time_format');
             $datetime = !empty($item[$column_name]) ? date_i18n($format, strtotime($item[$column_name])) : '';
             return $datetime;
         default:
             return $item[$column_name];
     }
 }
 private function prepare_fields()
 {
     $gateway = $this->data['gateway'];
     $subscription = $this->data['ms_relationship'];
     $membership = $subscription->get_membership();
     $invoice = $subscription->get_current_invoice();
     $member = $subscription->get_member();
     $fields = array('sid' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'sid', 'value' => $gateway->seller_id), 'mode' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'mode', 'value' => '2CO'), 'type' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'li_0_type', 'value' => 'product'), 'name' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'li_0_name', 'value' => $membership->name), 'price' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'li_0_price', 'value' => $invoice->total), 'tangible' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'li_0_tangible', 'value' => 'N'), 'skip_landing' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'skip_landing', 'value' => '1'), 'user_id' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'user_id', 'value' => $member->id), 'email' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'email', 'value' => $member->email), 'currency' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'currency', 'value' => $invoice->currency), 'merchant_order_id' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'merchant_order_id', 'value' => $invoice->id), 'return_url' => array('type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'id' => 'x_receipt_link_url', 'value' => esc_url_raw(add_query_arg(array('ms_relationship_id' => $subscription->id), MS_Model_Pages::get_page_url(MS_Model_Pages::MS_PAGE_REG_COMPLETE, false)))));
     if (MS_Model_Membership::PAYMENT_TYPE_RECURRING == $membership->payment_type) {
         #'li_0_reccurance' = '2 days'   // Can use # Week / # Month / # Year
         #'li_0_duration' = 'Forever'    // Same as _recurrence, with additional "Forever" option
     }
     if (false !== strpos($gateway->pay_button_url, '://')) {
         $fields['submit'] = array('id' => 'submit', 'type' => MS_Helper_Html::INPUT_TYPE_IMAGE, 'value' => $gateway->pay_button_url);
     } else {
         $fields['submit'] = array('id' => 'submit', 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT, 'value' => __('Signup', MS_TEXT_DOMAIN));
         if ($gateway->pay_button_url) {
             $fields['submit']['value'] = $gateway->pay_button_url;
         }
     }
     // Don't send to gateway if free
     if (0 === $invoice->total) {
         $this->data['action_url'] = null;
     } else {
         if ($gateway->is_live_mode()) {
             $this->data['action_url'] = 'https://www.2checkout.com/checkout/purchase';
         } else {
             $this->data['action_url'] = 'https://sandbox.2checkout.com/checkout/purchase';
         }
     }
     return $fields;
 }
示例#21
0
 function filter_woocommerce_ajax_params($woocommerce_params)
 {
     global $sitepress, $post;
     $value = array();
     $value = $woocommerce_params;
     if ($sitepress->get_current_language() !== $sitepress->get_default_language()) {
         $value['ajax_url'] = add_query_arg('lang', ICL_LANGUAGE_CODE, $woocommerce_params['ajax_url']);
         $value['checkout_url'] = add_query_arg('action', 'woocommerce-checkout', $value['ajax_url']);
     }
     if (!isset($post->ID)) {
         return $value;
     }
     $ch_pages = wp_cache_get('ch_pages', 'wcml_ch_pages');
     if (empty($ch_pages)) {
         $ch_pages = array('checkout_page_id' => get_option('woocommerce_checkout_page_id'), 'pay_page_id' => get_option('woocommerce_pay_page_id'), 'cart_page_id' => get_option('woocommerce_cart_page_id'));
         $ch_pages['translated_checkout_page_id'] = apply_filters('translate_object_id', $ch_pages['checkout_page_id'], 'page', false);
         $ch_pages['translated_pay_page_id'] = apply_filters('translate_object_id', $ch_pages['pay_page_id'], 'page', false);
         $ch_pages['translated_cart_page_id'] = apply_filters('translate_object_id', $ch_pages['cart_page_id'], 'page', false);
     }
     wp_cache_set('ch_pages', $ch_pages, 'wcml_ch_pages');
     if ($ch_pages['translated_cart_page_id'] == $post->ID) {
         $value['is_cart'] = 1;
         $value['cart_url'] = get_permalink($ch_pages['translated_cart_page_id']);
     } else {
         if ($ch_pages['translated_checkout_page_id'] == $post->ID || $ch_pages['checkout_page_id'] == $post->ID) {
             $value['is_checkout'] = 1;
             $_SESSION['wpml_globalcart_language'] = $sitepress->get_current_language();
         } else {
             if ($ch_pages['translated_pay_page_id'] == $post->ID) {
                 $value['is_pay_page'] = 1;
             }
         }
     }
     return $value;
 }
示例#22
0
/**
 * Add the settings link to the MailChimp plugin row
 *
 * @param array $links - Links for the plugin
 * @return array - Links
 */
function mailchimpSD_plugin_action_links($links)
{
    $settings_page = add_query_arg(array('page' => 'mailchimpSF_options'), admin_url('options-general.php'));
    $settings_link = '<a href="' . esc_url($settings_page) . '">' . __('Settings', 'mailchimp_i18n') . '</a>';
    array_unshift($links, $settings_link);
    return $links;
}
示例#23
0
 /**
  *    generate_add_to_iCal_button
  *
  * @access    public
  * @param $html
  * @param $datetime
  * @return    string
  */
 public static function generate_add_to_iCal_button($html, $datetime)
 {
     // first verify a proper datetime object has been received
     if ($datetime instanceof EE_Datetime) {
         // set whether a link or submit button is shown
         $iCal_type = apply_filters('FHEE__EED_Ical__generate_add_to_iCal_button__iCal_type', 'submit');
         // generate a link to the route we registered in set_hooks()
         $URL = add_query_arg(array('ee' => 'download_ics_file', 'ics_id' => $datetime->ID()), site_url());
         // what type ?
         switch ($iCal_type) {
             // submit buttons appear as buttons and are very compatible with a theme's style
             case 'submit':
                 $html .= '<form id="download-iCal-frm-' . $datetime->ID() . '" class="download-iCal-frm" action="' . $URL . '" method="post" >';
                 $html .= '<input type="submit" class="ee-ical-sbmt" value="&#xf145;" title="' . __('Add to iCal Calendar', 'event_espresso') . '"/>';
                 $html .= '</form>';
                 break;
                 // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
             // buttons are just links that have been styled to appear as buttons, but may not be blend with a theme as well as submit buttons
             case 'button':
                 $html .= '<a class="ee-ical-btn small ee-button ee-roundish" href="' . $URL . '" title="' . __('Add to iCal Calendar', 'event_espresso') . '">';
                 $html .= ' <span class="dashicons dashicons-calendar"></span>';
                 $html .= '</a>';
                 break;
                 // links are just links that use the calendar dashicon
             // links are just links that use the calendar dashicon
             case 'icon':
                 $html .= '<a class="ee-ical-lnk" href="' . $URL . '" title="' . __('Add to iCal Calendar', 'event_espresso') . '">';
                 $html .= ' <span class="dashicons dashicons-calendar"></span>';
                 $html .= '</a>';
                 break;
         }
     }
     return $html;
 }
/**
 * Generates a Photon URL.
 *
 * @see http://developer.wordpress.com/docs/photon/
 *
 * @param string $image_url URL to the publicly accessible image you want to manipulate
 * @param array|string $args An array of arguments, i.e. array( 'w' => '300', 'resize' => array( 123, 456 ) ), or in string form (w=123&h=456)
 * @return string The raw final URL. You should run this through esc_url() before displaying it.
 */
function jetpack_photon_url($image_url, $args = array(), $scheme = null)
{
    $image_url = trim($image_url);
    $image_url = apply_filters('jetpack_photon_pre_image_url', $image_url, $args, $scheme);
    $args = apply_filters('jetpack_photon_pre_args', $args, $image_url, $scheme);
    if (empty($image_url)) {
        return $image_url;
    }
    $image_url_parts = @parse_url($image_url);
    // Unable to parse
    if (!is_array($image_url_parts) || empty($image_url_parts['host']) || empty($image_url_parts['path'])) {
        return $image_url;
    }
    if (is_array($args)) {
        // Convert values that are arrays into strings
        foreach ($args as $arg => $value) {
            if (is_array($value)) {
                $args[$arg] = implode(',', $value);
            }
        }
        // Encode values
        // See http://core.trac.wordpress.org/ticket/17923
        $args = rawurlencode_deep($args);
    }
    // You can't run a Photon URL through Photon again because query strings are stripped.
    // So if the image is already a Photon URL, append the new arguments to the existing URL.
    if (in_array($image_url_parts['host'], array('i0.wp.com', 'i1.wp.com', 'i2.wp.com'))) {
        $photon_url = add_query_arg($args, $image_url);
        return jetpack_photon_url_scheme($photon_url, $scheme);
    }
    // This setting is Photon Server dependent
    if (!apply_filters('jetpack_photon_any_extension_for_domain', false, $image_url_parts['host'])) {
        // Photon doesn't support query strings so we ignore them and look only at the path.
        // However some source images are served via PHP so check the no-query-string extension.
        // For future proofing, this is a blacklist of common issues rather than a whitelist.
        $extension = pathinfo($image_url_parts['path'], PATHINFO_EXTENSION);
        if (empty($extension) || in_array($extension, array('php'))) {
            return $image_url;
        }
    }
    $image_host_path = $image_url_parts['host'] . $image_url_parts['path'];
    // Figure out which CDN subdomain to use
    srand(crc32($image_host_path));
    $subdomain = rand(0, 2);
    srand();
    $photon_url = "http://i{$subdomain}.wp.com/{$image_host_path}";
    // This setting is Photon Server dependent
    if (isset($image_url_parts['query']) && apply_filters('jetpack_photon_add_query_string_to_domain', false, $image_url_parts['host'])) {
        $photon_url .= '?q=' . rawurlencode($image_url_parts['query']);
    }
    if ($args) {
        if (is_array($args)) {
            $photon_url = add_query_arg($args, $photon_url);
        } else {
            // You can pass a query string for complicated requests but where you still want CDN subdomain help, etc.
            $photon_url .= '?' . $args;
        }
    }
    return jetpack_photon_url_scheme($photon_url, $scheme);
}
 function bp_wire_posts_template($item_id, $component_slug, $can_post, $per_page, $max)
 {
     global $bp;
     if ($bp->current_component == $bp->wire->slug) {
         $this->table_name = $bp->profile->table_name_wire;
         // If the user is viewing their own wire, delete the notifications.
         if ('all-posts' == $bp->current_action && bp_is_home()) {
             bp_core_delete_notifications_for_user_by_type($bp->loggedin_user->id, 'xprofile', 'new_wire_post');
         }
     } else {
         $this->table_name = $bp->{$component_slug}->table_name_wire;
     }
     $this->pag_page = isset($_REQUEST['wpage']) ? intval($_REQUEST['wpage']) : 1;
     $this->pag_num = isset($_REQUEST['num']) ? intval($_REQUEST['num']) : $per_page;
     $this->wire_posts = BP_Wire_Post::get_all_for_item($item_id, $this->table_name, $this->pag_page, $this->pag_num);
     $this->total_wire_post_count = (int) $this->wire_posts['count'];
     $this->wire_posts = $this->wire_posts['wire_posts'];
     $this->wire_post_count = count($this->wire_posts);
     if ((int) get_site_option('non-friend-wire-posting') && ($bp->current_component == $bp->profile->slug || $bp->current_component == $bp->wire->slug)) {
         $this->can_post = 1;
     } else {
         $this->can_post = $can_post;
     }
     $this->pag_links = paginate_links(array('base' => add_query_arg('wpage', '%#%', $bp->displayed_user->domain), 'format' => '', 'total' => ceil($this->total_wire_post_count / $this->pag_num), 'current' => $this->pag_page, 'prev_text' => '&laquo;', 'next_text' => '&raquo;', 'mid_size' => 1));
 }
示例#26
0
 /**
  * Returns an array of search suggestions from the unofficial completion API located 
  * at the endpoint specified in this class. &q=query
  * 
  * Parses the output into an array of associative arrays with keys of term, volume and
  * current. "current" is a boolean that determines whether the result in question is the searched
  * for term.
  * 
  * @return array|WP_Error WP_Error if something goes wrong. Otherwise, an array as described above.
  */
 public static function get_suggestions($search_term)
 {
     $search_term = trim($search_term);
     if (empty($search_term)) {
         return new WP_Error('empty_term', __('Please provide a search term.', 'scribeseo'));
     }
     $response = wp_remote_get(add_query_arg(array('q' => urlencode($search_term)), self::ENDPOINT));
     if (is_wp_error($response)) {
         return $response;
     }
     $result = array();
     // turn on user error handing
     $user_errors = libxml_use_internal_errors(true);
     $complete_suggestions = simplexml_load_string(wp_remote_retrieve_body($response));
     // get any errors
     $xml_errors = libxml_get_errors();
     // restore error handling setting
     libxml_use_internal_errors($user_errors);
     if (!empty($xml_errors)) {
         return new WP_Error('xml_error', __('The XML from the Google Completion API could not be loaded appropriately.', 'scribeseo'));
     }
     $complete_suggestions_po = json_decode(json_encode($complete_suggestions));
     if (!is_object($complete_suggestions_po) || !isset($complete_suggestions_po->CompleteSuggestion)) {
         return new WP_Error('xml_error', __('The XML from the Google Completion API could not be loaded appropriately.', 'scribeseo'));
     }
     foreach ($complete_suggestions_po->CompleteSuggestion as $suggestion) {
         $term = $suggestion->suggestion->{'@attributes'}->data;
         $volume = intval($suggestion->num_queries->{'@attributes'}->int);
         $volume_nice = number_format_i18n($volume);
         $current = $term == $search_term;
         $result[] = compact('term', 'volume', 'volume_nice', 'current');
     }
     return $result;
 }
示例#27
0
 public function __construct()
 {
     echo '<div class="wrap ws-menu-page">' . "\n";
     echo '<div class="ws-menu-page-toolbox">' . "\n";
     c_ws_plugin__s2member_menu_pages_tb::display();
     echo '</div>' . "\n";
     echo '<h2>Specs / Info</h2>' . "\n";
     echo '<table class="ws-menu-page-table">' . "\n";
     echo '<tbody class="ws-menu-page-table-tbody">' . "\n";
     echo '<tr class="ws-menu-page-table-tr">' . "\n";
     echo '<td class="ws-menu-page-table-l">' . "\n";
     echo '<img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-icon.png" class="ws-menu-page-brand-icon" alt="." />' . "\n";
     echo '<a href="' . esc_attr(add_query_arg("c_check_ver", urlencode(c_ws_plugin__s2member_readmes::parse_readme_value("Version")), c_ws_plugin__s2member_readmes::parse_readme_value("Plugin URI"))) . '" target="_blank"><img src="' . esc_attr($GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]) . '/images/brand-updates.png" class="ws-menu-page-brand-updates" alt="." /></a>' . "\n";
     do_action("ws_plugin__s2member_during_info_page_before_left_sections", get_defined_vars());
     if (apply_filters("ws_plugin__s2member_during_info_page_during_left_sections_display_readme", true, get_defined_vars())) {
         do_action("ws_plugin__s2member_during_info_page_during_left_sections_before_readme", get_defined_vars());
         echo '<div class="ws-menu-page-readme">' . "\n";
         do_action("ws_plugin__s2member_during_info_page_during_left_sections_during_readme", get_defined_vars());
         echo c_ws_plugin__s2member_readmes::parse_readme() . "\n";
         echo '</div>' . "\n";
         do_action("ws_plugin__s2member_during_info_page_during_left_sections_after_readme", get_defined_vars());
     }
     do_action("ws_plugin__s2member_during_info_page_after_left_sections", get_defined_vars());
     echo '</td>' . "\n";
     echo '<td class="ws-menu-page-table-r">' . "\n";
     c_ws_plugin__s2member_menu_pages_rs::display();
     echo '</td>' . "\n";
     echo '</tr>' . "\n";
     echo '</tbody>' . "\n";
     echo '</table>' . "\n";
     echo '</div>' . "\n";
 }
示例#28
0
/**
* Infuse theme update details when WordPress runs its update checker.
*
* @since 2.0
*
* @param object $value  The WordPress update object.
* @return object $value Amended WordPress update object on success, default if object is empty.
*/
function memberlite_update_themes_filter($value)
{
    // If no update object exists, return early.
    if (empty($value)) {
        return $value;
    }
    // get update_info information
    $update_info = memberlite_getUpdateInfo();
    // no info?
    if (empty($update_info)) {
        return $value;
    }
    //get data for theme
    $theme_file_abs = ABSPATH . 'wp-content/themes/' . $update_info['Slug'];
    $theme_file = $theme_file_abs . "/style.css";
    $theme_data = wp_get_theme($update_info['Slug']);
    //compare versions
    if (!empty($update_info['License']) && version_compare($theme_data['Version'], $update_info['Version'], '<')) {
        $value->response[$update_info['Slug']] = array('theme' => $update_info['Slug'], 'new_version' => $update_info['Version'], 'url' => $update_info['ThemeURI'], 'package' => $update_info['Download']);
        //get license key if one is available
        $key = get_option("pmpro_license_key", "");
        if (!empty($key) && pmpro_license_isValid($key, "plus")) {
            $value->response[$update_info['Slug']]['package'] = add_query_arg("key", $key, $value->response[$update_info['Slug']]['package']);
        } else {
            global $memberlite_license_error;
            //only want to show this once
            if (empty($memberlite_license_error)) {
                $memberlite_license_error = true;
                echo "<div class='error'><p>" . sprintf(__('A valid PMPro Plus license key is required to update Memberlite. <a href="%s">Please validate your PMPro Plus license key</a>.', 'memberlite'), admin_url('options-general.php?page=pmpro_license_settings')) . "</p></div>";
            }
        }
    }
    // Return the update object.
    return $value;
}
示例#29
0
 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;
 }
示例#30
0
文件: load.php 项目: thecancerus/o2
 function infinite_scroll_ajax_url($ajax_url)
 {
     if (isset($_GET['replies']) && 'none' == $_GET['replies']) {
         $ajax_url = add_query_arg(array('replies' => 'none'), $ajax_url);
     }
     return $ajax_url;
 }