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;
 }
Example #2
1
 function filter_add_to_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 esc_url($ref_url);
 }
 function route_action()
 {
     $nonce_action = $_REQUEST['bpmod-action'];
     $action = $_REQUEST['bpmod-action'];
     if ('bulk_contents' == $_REQUEST['bpmod-action'] || 'bulk_users' == $_REQUEST['bpmod-action']) {
         $action .= '_' . $_REQUEST['bulk-action'];
     }
     $in_ajax = defined('DOING_AJAX');
     if ($in_ajax) {
         check_ajax_referer($nonce_action);
         $response_func = array(&$this, 'ajax_' . $action);
     } else {
         check_admin_referer($nonce_action);
         $response_func = array(&$this, 'action_' . $action);
         $this->redir = remove_query_arg(array('err_ids', 'marked_spammer', 'unmarked_spammer', 'content_ignored', 'content_moderated', 'content_deleted'), wp_get_referer());
     }
     $handle_func = array(&$this, 'handle_' . $action);
     $response_func = array(&$this, ($in_ajax ? 'ajax_' : 'action_') . $action);
     if (is_callable($handle_func)) {
         $result = (array) call_user_func($handle_func);
         if ($result && is_callable($response_func)) {
             call_user_func_array($response_func, $result);
         }
     }
     //fallback if nothing has been called
     if ($in_ajax) {
         die(-1);
     } else {
         bp_core_redirect($this->redir);
     }
 }
Example #4
1
    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @since Farmtoyou 1.0
     *
     * @global WP_Query   $wp_query   WordPress Query object.
     * @global WP_Rewrite $wp_rewrite WordPress Rewrite object.
     */
    function farmtoyou_paging_nav()
    {
        global $wp_query, $wp_rewrite;
        // Don't print empty markup if there's only one page.
        if ($wp_query->max_num_pages < 2) {
            return;
        }
        $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
        $pagenum_link = html_entity_decode(get_pagenum_link());
        $query_args = array();
        $url_parts = explode('?', $pagenum_link);
        if (isset($url_parts[1])) {
            wp_parse_str($url_parts[1], $query_args);
        }
        $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
        $pagenum_link = trailingslashit($pagenum_link) . '%_%';
        $format = $wp_rewrite->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
        $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit($wp_rewrite->pagination_base . '/%#%', 'paged') : '?paged=%#%';
        // Set up paginated links.
        $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $wp_query->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('&larr; Previous', 'farmtoyou'), 'next_text' => __('Next &rarr;', 'farmtoyou')));
        if ($links) {
            ?>
	<nav class="navigation paging-navigation" role="navigation">
		<div class="pagination loop-pagination">
			<?php 
            echo $links;
            ?>
		</div><!-- .pagination -->
	</nav><!-- .navigation -->
	<?php 
        }
    }
Example #5
0
 function removeWpVersionFromLink($src)
 {
     if (strpos($src, 'ver=')) {
         $src = remove_query_arg('ver', $src);
     }
     return $src;
 }
Example #6
0
 public function callback_submit_options()
 {
     global $wpsc_shipping_modules;
     foreach ($wpsc_shipping_modules as $shipping) {
         if (is_object($shipping)) {
             $shipping->submit_form();
         }
     }
     //This is for submitting shipping details to the shipping module
     if (!isset($_POST['update_gateways'])) {
         $_POST['update_gateways'] = '';
     }
     if (!isset($_POST['custom_shipping_options'])) {
         $_POST['custom_shipping_options'] = array();
     }
     update_option('custom_shipping_options', array_map('sanitize_text_field', $_POST['custom_shipping_options']));
     $shipadd = 0;
     foreach ($wpsc_shipping_modules as $shipping) {
         foreach ((array) $_POST['custom_shipping_options'] as $shippingoption) {
             if ($shipping->getInternalName() == $shippingoption) {
                 $shipadd++;
             }
         }
     }
     if (isset($_POST['wpsc_options']['shipping_discount_value'])) {
         update_option('shipping_discount_value', wpsc_string_to_float($_POST['wpsc_options']['shipping_discount_value']));
     }
     if (!get_option('do_not_use_shipping') && !get_option('custom_shipping_options') && !(bool) get_option('shipwire')) {
         update_option('do_not_use_shipping', '1');
         return array('shipping_disabled' => 1);
     } else {
         $_SERVER['REQUEST_URI'] = esc_url_raw(remove_query_arg('shipping_disabled'));
     }
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $remove = array_diff(array_keys($_GET), $this->baseUrlParamNames);
     if ($remove) {
         $this->baseUrl = remove_query_arg($remove);
     } else {
         $this->baseUrl = $_SERVER['REQUEST_URI'];
     }
     parent::__construct();
     // add special filter for url fields
     $this->input->addFilter(create_function('$str', 'return "http://" == $str || "ftp://" == $str ? "" : $str;'));
     // enqueue required sripts and styles
     global $wp_styles;
     if (!is_a($wp_styles, 'WP_Styles')) {
         $wp_styles = new WP_Styles();
     }
     wp_enqueue_style('pmwi-admin-style', PMWI_ROOT_URL . '/static/css/admin.css', array(), PMWI_VERSION);
     if (version_compare(get_bloginfo('version'), '3.8-RC1') >= 0) {
         wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_ROOT_URL . '/static/css/admin-wp-3.8.css');
     }
     wp_enqueue_script('pmwi-script', PMWI_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
     wp_enqueue_script('pmwi-admin-script', PMWI_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'), PMWI_VERSION);
     global $woocommerce;
     $woocommerce_witepanel_params = array('remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'wpai_woocommerce_addon_plugin'), 'remove_attribute' => __('Remove this attribute?', 'wpai_woocommerce_addon_plugin'), 'name_label' => __('Name', 'wpai_woocommerce_addon_plugin'), 'remove_label' => __('Remove', 'wpai_woocommerce_addon_plugin'), 'click_to_toggle' => __('Click to toggle', 'wpai_woocommerce_addon_plugin'), 'values_label' => __('Value(s)', 'wpai_woocommerce_addon_plugin'), 'text_attribute_tip' => __('Enter some text, or some attributes by pipe (|) separating values.', 'wpai_woocommerce_addon_plugin'), 'visible_label' => __('Visible on the product page', 'wpai_woocommerce_addon_plugin'), 'used_for_variations_label' => __('Used for variations', 'wpai_woocommerce_addon_plugin'), 'new_attribute_prompt' => __('Enter a name for the new attribute term:', 'wpai_woocommerce_addon_plugin'), 'calc_totals' => __("Calculate totals based on order items, discount amount, and shipping? Note, you will need to (optionally) calculate tax rows and cart discounts manually.", 'wpai_woocommerce_addon_plugin'), 'calc_line_taxes' => __("Calculate line taxes? This will calculate taxes based on the customers country. If no billing/shipping is set it will use the store base country.", 'wpai_woocommerce_addon_plugin'), 'copy_billing' => __("Copy billing information to shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'load_billing' => __("Load the customer's billing information? This will remove any currently entered billing information.", 'wpai_woocommerce_addon_plugin'), 'load_shipping' => __("Load the customer's shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'featured_label' => __('Featured', 'wpai_woocommerce_addon_plugin'), 'tax_or_vat' => $woocommerce->countries->tax_or_vat(), 'prices_include_tax' => get_option('woocommerce_prices_include_tax'), 'round_at_subtotal' => get_option('woocommerce_tax_round_at_subtotal'), 'meta_name' => __('Meta Name', 'wpai_woocommerce_addon_plugin'), 'meta_value' => __('Meta Value', 'wpai_woocommerce_addon_plugin'), 'no_customer_selected' => __('No customer selected', 'wpai_woocommerce_addon_plugin'), 'tax_label' => __('Tax Label:', 'wpai_woocommerce_addon_plugin'), 'compound_label' => __('Compound:', 'wpai_woocommerce_addon_plugin'), 'cart_tax_label' => __('Cart Tax:', 'wpai_woocommerce_addon_plugin'), 'shipping_tax_label' => __('Shipping Tax:', 'wpai_woocommerce_addon_plugin'), 'plugin_url' => $woocommerce->plugin_url(), 'ajax_url' => admin_url('admin-ajax.php'), 'add_order_item_nonce' => wp_create_nonce("add-order-item"), 'add_attribute_nonce' => wp_create_nonce("add-attribute"), 'calc_totals_nonce' => wp_create_nonce("calc-totals"), 'get_customer_details_nonce' => wp_create_nonce("get-customer-details"), 'search_products_nonce' => wp_create_nonce("search-products"), 'calendar_image' => $woocommerce->plugin_url() . '/assets/images/calendar.png', 'post_id' => null);
     wp_localize_script('woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params);
     wp_enqueue_style('pmwi-woo-style', $woocommerce->plugin_url() . '/assets/css/admin.css');
 }
Example #8
0
 /**
  * Set up the view with data and do things that are specific for this view
  *
  * @since 1.0.0
  *
  * @param string $action Action for this view
  * @param array $data Data for this view
  */
 public function setup($action, $data)
 {
     parent::setup($action, $data);
     add_thickbox();
     $this->admin_page->enqueue_script('list', array('jquery'), array('list' => array('shortcode_popup' => __('To embed this table into a post or page, use this Shortcode:', 'tablepress'), 'donation-message-already-donated' => __('Thank you very much! Your donation is highly appreciated. You just contributed to the further development of TablePress!', 'tablepress'), 'donation-message-maybe-later' => sprintf(__('No problem! I still hope you enjoy the benefits that TablePress adds to your site. If you should change your mind, you\'ll always find the &#8220;Donate&#8221; button on the <a href="%s">TablePress website</a>.', 'tablepress'), 'http://tablepress.org/'))));
     if ($data['messages']['first_visit']) {
         $this->add_header_message('<strong><em>' . __('Welcome!', 'tablepress') . '</em></strong><br />' . __('Thank you for using TablePress for the first time!', 'tablepress') . ' ' . sprintf(__('If you encounter any questions or problems, please visit the <a href="%1$s">FAQ</a>, the <a href="%2$s">documentation</a>, and the <a href="%3$s">Support</a> section on the <a href="%4$s">plugin website</a>.', 'tablepress'), 'http://tablepress.org/faq/', 'http://tablepress.org/documentation/', 'http://tablepress.org/support/', 'http://tablepress.org/') . '<br /><br />' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'first_visit', 'return' => 'list'), __('Hide this message', 'tablepress')));
     }
     if ($data['messages']['wp_table_reloaded_warning']) {
         $this->add_header_message('<strong><em>' . __('Attention!', 'tablepress') . '</em></strong><br />' . __('You have activated the plugin WP-Table Reloaded, which can not be used together with TablePress.', 'tablepress') . '<br />' . __('It is strongly recommended that you switch from WP-Table Reloaded to TablePress, which not only fixes many problems, but also has more and better features than WP-Table Reloaded.', 'tablepress') . '<br />' . sprintf(__('Please follow the <a href="%s">migration guide</a> to move your tables and then deactivate WP-Table Reloaded!', 'tablepress'), 'http://tablepress.org/migration-from-wp-table-reloaded/') . '<br />' . '<a href="' . TablePress::url(array('action' => 'import')) . '" class="button button-primary button-large" title="' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '" style="color:#ffffff;margin-top:5px;">' . __('Import your tables from WP-Table Reloaded', 'tablepress') . '</a>', 'error');
     }
     if ($data['messages']['donation_message']) {
         $this->add_header_message('<img alt="' . __('Tobias Bäthge, developer of TablePress', 'tablepress') . '" src="https://secure.gravatar.com/avatar/50f1cff2e27a1f522b18ce229c057bc5?s=94" height="94" width="94" style="float:left;margin-right:10px;" />' . __('Hi, my name is Tobias, I\'m the developer of the TablePress plugin.', 'tablepress') . '<br /><br />' . __('Thanks for using it! You\'ve installed TablePress over a month ago.', 'tablepress') . ' ' . sprintf(_n('If everything works and you are satisfied with the results of managing your %s table, isn\'t that worth a coffee or two?', 'If everything works and you are satisfied with the results of managing your %s tables, isn\'t that worth a coffee or two?', $data['table_count'], 'tablepress'), $data['table_count']) . '<br/>' . sprintf(__('<a href="%s">Donations</a> help me to continue user support and development of this <em>free</em> software &mdash; things for which I spend countless hours of my free time! Thank you very much!', 'tablepress'), 'http://tablepress.org/donate/') . '<br/><br />' . __('Sincerly, Tobias', 'tablepress') . '<br /><br />' . sprintf('<a href="%s" target="_blank"><strong>%s</strong></a>', 'http://tablepress.org/donate/', __('Sure, I\'ll buy you a coffee and support TablePress!', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'already-donated'), __('I already donated.', 'tablepress')) . '&nbsp;&nbsp;&nbsp;&nbsp;&middot;&nbsp;&nbsp;&nbsp;&nbsp;' . $this->ajax_link(array('action' => 'hide_message', 'item' => 'donation_nag', 'return' => 'list', 'target' => 'maybe-later'), __('No, thanks. Don\'t ask again.', 'tablepress')));
     }
     if ($data['messages']['show_plugin_update']) {
         $message = '<strong><em>' . sprintf(__('Thank you for updating to TablePress %s!', 'tablepress'), TablePress::version) . '</em></strong><br />';
         if (!empty($data['messages']['plugin_update_message'])) {
             $message .= $data['messages']['plugin_update_message'] . '<br />';
         }
         $message .= sprintf(__('Please read the <a href="%s">release announcement</a> for more information.', 'tablepress'), 'http://tablepress.org/news/') . ' ' . sprintf(__('If you like the new features and enhancements, <a href="%s">giving a donation</a> towards the further support and development of TablePress is recommended. Thank you!', 'tablepress'), 'http://tablepress.org/donate/') . '<br /><br />';
         $message .= $this->ajax_link(array('action' => 'hide_message', 'item' => 'plugin_update', 'return' => 'list'), __('Hide this message', 'tablepress'));
         $this->add_header_message($message);
     }
     $this->process_action_messages(array('success_delete' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 1, 'tablepress'), 'success_delete_plural' => _n('The table was deleted successfully.', 'The tables were deleted successfully.', 2, 'tablepress'), 'error_delete' => __('Error: The table could not be deleted.', 'tablepress'), 'error_save' => __('Error: The table could not be saved.', 'tablepress'), 'success_copy' => _n('The table was copied successfully.', 'The tables were copied successfully.', 1, 'tablepress'), 'success_copy_plural' => _n('The table was copied successfully.', 'The tables were copied successfully.', 2, 'tablepress'), 'error_copy' => __('Error: The table could not be copied.', 'tablepress'), 'error_no_table' => __('Error: You did not specify a valid table ID.', 'tablepress'), 'error_load_table' => __('Error: This table could not be loaded!', 'tablepress'), 'error_bulk_action_invalid' => __('Error: This bulk action is invalid!', 'tablepress'), 'error_no_selection' => __('Error: You did not select any tables!', 'tablepress'), 'error_delete_not_all_tables' => __('Notice: Not all selected tables could be deleted!', 'tablepress'), 'error_copy_not_all_tables' => __('Notice: Not all selected tables could be copied!', 'tablepress'), 'success_import' => __('The tables were imported successfully.', 'tablepress'), 'success_import_wp_table_reloaded' => __('The tables were imported successfully from WP-Table Reloaded.', 'tablepress')));
     $this->add_text_box('head', array($this, 'textbox_head'), 'normal');
     $this->add_text_box('tables-list', array($this, 'textbox_tables_list'), 'normal');
     add_screen_option('per_page', array('label' => __('Tables', 'tablepress'), 'default' => 20));
     // Admin_Controller contains function to allow changes to this in the Screen Options to be saved
     $this->wp_list_table = new TablePress_All_Tables_List_Table();
     $this->wp_list_table->set_items($this->data['tables']);
     $this->wp_list_table->prepare_items();
     // cleanup Request URI string, which WP_List_Table uses to generate the sort URLs
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('message', 'table_id'), $_SERVER['REQUEST_URI']);
 }
Example #9
0
 public function admin_settings()
 {
     $uri = 'options-general.php?page=' . $this->args['domain'];
     $sub = isset($_GET['sub']) ? trim($_GET['sub']) : 'general';
     $subs = $this->getFilters($this->component . '_settings_subs', array());
     $messages = $this->getFilters($this->component . '_settings_messages', array());
     $titles = $this->getFilters($this->component . '_settings_titles', array());
     echo '<div class="wrap -settings-wrap">';
     printf('<h1>%s</h1>', isset($titles['title']) ? $titles['title'] : $this->args['title']);
     gPluginFormHelper::headerNav($uri, $sub, $subs);
     if (!empty($_GET['message'])) {
         if (empty($messages[$_REQUEST['message']])) {
             gPluginHTML::notice($_REQUEST['message'], 'notice-error');
         } else {
             echo $messages[$_REQUEST['message']];
         }
         $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
     }
     $file = $this->constants['plugin_dir'] . 'admin/' . $this->component . '.admin.' . $sub . '.php';
     if (file_exists($file)) {
         require_once $file;
     } else {
         do_action($this->args['domain'] . '_' . $this->component . '_settings_sub_' . $sub, $uri, $sub);
     }
     echo '<div class="clear"></div></div>';
 }
 public function shortcode($atts, $content = null)
 {
     extract(shortcode_atts(array('fullwidth' => 'true', 'height' => '500', 'src' => '', 'margin_top' => '0', 'margin_bottom' => '0'), $atts));
     $fullwidth = apply_filters('dt_sanitize_flag', $fullwidth);
     $margin_top = intval($margin_top);
     $margin_bottom = intval($margin_bottom);
     $height = absint($height);
     $height = $height ? $height : 500;
     if (!$src && !$content) {
         return '';
     }
     $classes = array('map-container');
     if ($fullwidth) {
         $classes[] = 'full';
     }
     $style = array('margin-top: ' . $margin_top . 'px', 'margin-bottom: ' . $margin_bottom . 'px');
     $style = implode(';', $style);
     $classes = implode(' ', $classes);
     if (!$src && $content) {
         if (preg_match('/iframe/', $content)) {
             $content = str_replace(array('&#8221;', '&#8243;'), '"', $content);
             preg_match('/src=(["\'])(.*?)\\1/', htmlspecialchars_decode($content), $match);
             if (!empty($match[2])) {
                 $src = $match[2];
             } else {
                 return '';
             }
         } else {
             $src = $content;
         }
     }
     $src = add_query_arg('output', 'embed', remove_query_arg('output', $src));
     $output = '<div class="' . esc_attr($classes) . '" style="' . esc_attr($style) . '"><iframe src="' . esc_url($src) . '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="500" height="' . $height . '"></iframe></div>';
     return $output;
 }
    public function to_html()
    {
        $settings = $this->data['settings'];
        $fields = array('plugin_enabled' => array('id' => 'plugin_enabled', 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER, 'title' => __('Content Protection', 'membership2'), 'desc' => __('This setting toggles the content protection on this site.', 'membership2'), 'value' => MS_Plugin::is_enabled(), 'data_ms' => array('action' => MS_Controller_Settings::AJAX_ACTION_TOGGLE_SETTINGS, 'setting' => 'plugin_enabled')), 'hide_admin_bar' => array('id' => 'hide_admin_bar', 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER, 'title' => __('Hide admin toolbar', 'membership2'), 'desc' => __('Hide the admin toolbar for non administrator users.', 'membership2'), 'value' => $settings->hide_admin_bar, 'data_ms' => array('action' => MS_Controller_Settings::AJAX_ACTION_TOGGLE_SETTINGS, 'setting' => 'hide_admin_bar')));
        $fields = apply_filters('ms_view_settings_prepare_general_fields', $fields);
        $setup = MS_Factory::create('MS_View_Settings_Page_Setup');
        $action_url = esc_url_raw(remove_query_arg(array('msg')));
        ob_start();
        MS_Helper_Html::settings_tab_header();
        ?>

		<form action="<?php 
        echo esc_url($action_url);
        ?>
" method="post" class="cf">
			<div class="cf">
				<div class="ms-half">
					<?php 
        MS_Helper_Html::html_element($fields['plugin_enabled']);
        ?>
				</div>
				<div class="ms-half">
					<?php 
        MS_Helper_Html::html_element($fields['hide_admin_bar']);
        ?>
				</div>
			</div>
			<?php 
        MS_Helper_Html::html_separator();
        MS_Helper_Html::html_element($setup->html_full_form());
        ?>
		</form>
		<?php 
        return ob_get_clean();
    }
Example #12
0
function flat_paging_nav()
{
    // Don't print empty markup if there's only one page.
    if ($GLOBALS['wp_query']->max_num_pages < 2) {
        return;
    }
    $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
    $pagenum_link = html_entity_decode(get_pagenum_link());
    $query_args = array();
    $url_parts = explode('?', $pagenum_link);
    if (isset($url_parts[1])) {
        wp_parse_str($url_parts[1], $query_args);
    }
    $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
    $pagenum_link = trailingslashit($pagenum_link) . '%_%';
    $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
    $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%';
    // Set up paginated links.
    $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 4, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('<i class="fa fa-chevron-left"></i>', 'flat'), 'next_text' => __('<i class="fa fa-chevron-right"></i>', 'flat')));
    $allowed_html = array('a' => array('href' => array(), 'class' => array()), 'span' => array('class' => array()), 'i' => array('class' => array()));
    if ($links) {
        ?>
		<nav class="navigation paging-navigation" role="navigation">
			<div class="nav-links">
				<?php 
        echo wp_kses($links, $allowed_html);
        ?>
			</div>
		</nav>
	<?php 
    }
}
/**
 * Remove version on static files
 */
function remove_staticfiles_version($src)
{
    if (strpos($src, '?ver=')) {
        $src = remove_query_arg('ver', $src);
    }
    return $src;
}
Example #14
0
    function pagination($pages = '', $range = 4)
    {
        // Don't print empty markup if there's only one page.
        if ($GLOBALS['wp_query']->max_num_pages < 2) {
            return;
        }
        $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
        $pagenum_link = html_entity_decode(get_pagenum_link());
        $query_args = array();
        $url_parts = explode('?', $pagenum_link);
        if (isset($url_parts[1])) {
            wp_parse_str($url_parts[1], $query_args);
        }
        $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
        $pagenum_link = trailingslashit($pagenum_link) . '%_%';
        $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
        $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%';
        // Set up paginated links.
        $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('<i class="fa fa-angle-left"></i>', 'crunchpress'), 'next_text' => __('<i class="fa fa-angle-right"></i>', 'crunchpress')));
        if ($links) {
            ?>
			<div class="pagination-all pagination" role="navigation">
				<ul id='pagination'>
					<li>
						<?php 
            echo $links;
            ?>
					</li>
				</ul><!-- .pagination -->
			</div><!-- .navigation -->
			<?php 
        }
    }
Example #15
0
 function gazeta_the_posts_pagination($query, $echo = true)
 {
     $pagination = '';
     global $wp_query;
     if (empty($query)) {
         $query = $wp_query;
     }
     if ($query->max_num_pages < 2) {
         return;
     }
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     $pagenum_link = html_entity_decode(get_pagenum_link());
     $query_args = array();
     $url_parts = explode('?', $pagenum_link);
     if (isset($url_parts[1])) {
         wp_parse_str($url_parts[1], $query_args);
     }
     $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
     $pagenum_link = trailingslashit($pagenum_link) . '%_%';
     $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
     $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%';
     $args = array('base' => $pagenum_link, 'format' => $format, 'total' => $query->max_num_pages, 'current' => $paged, 'mid_size' => 3, 'type' => 'list', 'add_args' => array_map('urlencode', $query_args), 'prev_text' => '<i class="fa fa-angle-double-left"></i>', 'next_text' => '<i class="fa fa-angle-double-right"></i>', 'before_page_number' => '<span>', 'after_page_number' => '</span>');
     // Set up paginated links.
     $pagination = paginate_links(apply_filters('gazeta_old_navigation_args', $args));
     if ($pagination) {
         if ($echo === false) {
             return '<nav class="navigation pagination"><div class="nav-links">' . $pagination . '</div></nav>';
         } else {
             echo '<nav class="navigation pagination"><div class="nav-links">';
             echo $pagination;
             echo '</div></nav>';
         }
     }
 }
Example #16
0
    static function Display()
    {
        global $wpdb, $user_ID;
        wpfb_loadclass('Admin', 'Output');
        $_POST = stripslashes_deep($_POST);
        $_GET = stripslashes_deep($_GET);
        $action = !empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : '');
        $clean_uri = remove_query_arg(array('message', 'action', 'file_id', 'cat_id', 'deltpl', 'hash_sync'));
        // keep search keyword
        WPFB_Admin::PrintFlattrHead();
        ?>
<div class="wrap"><?php 
        switch ($action) {
            default:
                ?>
<div id="wpfilebase-donate">
<p><?php 
                _e('If you like WP-Filebase I would appreciate a small donation to support my work. You can additionally add an idea to make WP-Filebase even better. Just click the button below. Thank you!', WPFB);
                ?>
</p>
<?php 
                WPFB_Admin::PrintPayPalButton();
                WPFB_Admin::PrintFlattrButton();
                ?>
</div>
<?php 
                break;
        }
        ?>
</div> <!-- wrap -->
<?php 
    }
/**
 * Tools
 *
 * Shows the tools panel which contains QUADS-specific tools including the
 * built-in import/export system.
 *
 * @since       0.9.0
 * @author      Daniel J Griffiths, René Hermenau
 * @return      void
 */
function quads_tools_page()
{
    $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'import_export';
    ?>
	<div class="wrap">
		<?php 
    screen_icon();
    ?>
		<h2 class="nav-tab-wrapper">
			<?php 
    foreach (quads_get_tools_tabs() as $tab_id => $tab_name) {
        $tab_url = add_query_arg(array('tab' => $tab_id));
        $tab_url = remove_query_arg(array('quads-message'), $tab_url);
        $active = $active_tab == $tab_id ? ' nav-tab-active' : '';
        echo '<a href="' . esc_url($tab_url) . '" title="' . esc_attr($tab_name) . '" class="nav-tab' . $active . '">' . esc_html($tab_name) . '</a>';
    }
    ?>
		</h2>
		<div class="metabox-holder">
			<?php 
    do_action('quads_tools_tab_' . $active_tab);
    ?>
		</div><!-- .metabox-holder -->
	</div><!-- .wrap -->
<?php 
}
function remove_wp_ver_par($src)
{
    if (strpos($src, 'ver=' . get_bloginfo('version'))) {
        $src = remove_query_arg('ver', $src);
    }
    return $src;
}
Example #19
0
 /**
  * Filter for the post meta box. look for a NGG image if the ID is "ngg-<imageID>"
  * 
  * @param string $content
  * @return string html output
  */
 function admin_post_thumbnail($content, $post_id = null)
 {
     if ($post_id == null) {
         global $post;
         if (!is_object($post)) {
             return $content;
         }
         $post_id = $post->ID;
     }
     $thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
     // in the case it's a ngg image it return ngg-<imageID>
     if (strpos($thumbnail_id, 'ngg-') === false) {
         global $wp_version;
         if (version_compare($wp_version, '3.5', '>=') && $thumbnail_id <= 0) {
             $iframe_src = get_upload_iframe_src('image');
             $iframe_src = remove_query_arg('TB_iframe', $iframe_src);
             $iframe_src = add_query_arg('tab', 'nextgen', $iframe_src);
             $iframe_src = add_query_arg('chromeless', '1', $iframe_src);
             $iframe_src = add_query_arg('TB_iframe', '1', $iframe_src);
             $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__('Set NextGEN featured image', 'nggallery') . '" href="' . nextgen_esc_url($iframe_src) . '" id="set-ngg-post-thumbnail" class="thickbox">%s</a></p>';
             $content .= sprintf($set_thumbnail_link, esc_html__('Set NextGEN featured image', 'nggallery'));
         }
         return $content;
     }
     // cut off the 'ngg-'
     $thumbnail_id = substr($thumbnail_id, 4);
     return $this->_wp_post_thumbnail_html($thumbnail_id);
 }
Example #20
0
function remove_ver_script($src)
{
    if (strpos($src, 'ver=')) {
        $src = remove_query_arg('ver', $src);
        return $src;
    }
}
Example #21
0
function remove_cssjs_ver($src)
{
    if (strpos($src, '?ver=')) {
        $src = remove_query_arg('ver', $src);
    }
    return $src;
}
Example #22
0
 function __construct()
 {
     parent::__construct();
     // Enable "basic" UI for entering key/secret
     if (!KEYRING__HEADLESS_MODE) {
         add_action('keyring_google-contacts_manage_ui', array($this, 'basic_ui'));
         add_filter('keyring_google-contacts_basic_ui_intro', array($this, 'basic_ui_intro'));
     }
     // Set scope
     add_filter('keyring_google-contacts_request_token_params', array($this, 'request_token_params'));
     // Handle Google's annoying limitation of not allowing us to redirect to a dynamic URL
     add_action('pre_keyring_google-contacts_verify', array($this, 'redirect_incoming_verify'));
     $this->set_endpoint('authorize', 'https://accounts.google.com/o/oauth2/auth', 'GET');
     $this->set_endpoint('access_token', 'https://accounts.google.com/o/oauth2/token', 'POST');
     $this->set_endpoint('self', 'https://www.googleapis.com/oauth2/v1/userinfo', 'GET');
     $creds = $this->get_credentials();
     $this->redirect_uri = $creds['redirect_uri'];
     $this->key = $creds['key'];
     $this->secret = $creds['secret'];
     $this->consumer = new OAuthConsumer($this->key, $this->secret, $this->callback_url);
     $this->signature_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->authorization_header = 'Bearer';
     // Oh, you
     $this->authorization_parameter = false;
     // Need to reset the callback because Google is very strict about where it sends people
     if (!empty($creds['redirect_uri'])) {
         $this->callback_url = $creds['redirect_uri'];
     } else {
         $this->callback_url = remove_query_arg(array('nonce', 'kr_nonce'), $this->callback_url);
     }
     // At least strip nonces, since you can't save them in your app config
 }
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;
}
 /**
  * Handles the subscription upgrade/downgrade process.
  *
  * @since 1.4
  */
 public static function subscription_switch_handler()
 {
     global $woocommerce, $post;
     // If the current user doesn't own the subscription, remove the query arg from the URL
     if (isset($_GET['switch-subscription'])) {
         // Visiting a switch link for someone elses subscription
         if (!WC_Subscriptions_Manager::user_owns_subscription($_GET['switch-subscription'])) {
             wp_redirect(remove_query_arg('switch-subscription'));
             exit;
         } else {
             if (isset($_GET['auto-switch'])) {
                 $switch_message = __('You have an active subscription to this product. Choosing a new subscription will replace your existing subscription.', 'woocommerce-subscriptions');
             } else {
                 $switch_message = __('Choose a new subscription.', 'woocommerce-subscriptions');
             }
             WC_Subscriptions::add_notice($switch_message, 'notice');
         }
     } elseif ((is_cart() || is_checkout()) && false !== self::cart_contains_subscription_switch()) {
         WC_Subscriptions::add_notice(__('Once sign up is complete, this will replace your existing subscription.', 'woocommerce-subscriptions'), 'notice');
     } elseif (is_product() && ($product = get_product($post))) {
         // Automatically initiate the switch process for limited variable subscriptions
         if (($product->is_type(array('variable-subscription', 'subscription_variation')) || 0 !== $product->post->post_parent) && WC_Subscriptions_Product::is_subscription($product->id) && 'yes' === $product->limit_subscriptions) {
             // Check if the user has an active subscription for this product, and if so, initiate the switch process
             $subscriptions = WC_Subscriptions_Manager::get_users_subscriptions();
             foreach ($subscriptions as $subscription_key => $subscription) {
                 if ($subscription['product_id'] == $product->id && 'active' == $subscription['status']) {
                     wp_redirect(add_query_arg('auto-switch', 'true', self::get_switch_link($subscription_key)));
                     exit;
                 }
             }
         }
     }
 }
Example #25
0
function remove_wp_ver_css_js($src)
{
    if (strpos($src, 'ver=')) {
        $src = remove_query_arg('ver', $src);
    }
    return $src;
}
Example #26
0
 protected function init_tabs()
 {
     // Remove unwanted query args from urls
     $_SERVER['REQUEST_URI'] = remove_query_arg(array('firstrun', 'pruneads', 'resetstats'), $_SERVER['REQUEST_URI']);
     $this->tabs->add('general', __('General', APP_TD));
     $this->tabs->add('categories', __('Categories', APP_TD));
     $this->tabs->add('listings', __('Listings', APP_TD));
     $this->tabs->add('security', __('Security', APP_TD));
     $this->tabs->add('advertise', __('Advertising', APP_TD));
     $this->tabs->add('advanced', __('Advanced', APP_TD));
     $this->tab_sections['general']['appearance'] = array('title' => __('Appearance', APP_TD), 'fields' => array(array('title' => __('Design', APP_TD), 'desc' => sprintf(__('Customize the look and feel of your website by visiting the <a href="%s">WordPress customizer</a>.', APP_TD), 'customize.php'), 'type' => 'text', 'name' => '_blank', 'extra' => array('style' => 'display: none;'), 'tip' => ''), array('title' => __('Favicon', APP_TD), 'desc' => $this->wrap_upload('favicon_url', '<br />' . sprintf(__('<a target="_blank" href="%s">Create your own</a> favicon or paste an image URL directly. Must be a 16x16 .ico file.', APP_TD), 'http://www.favicon.cc/')), 'type' => 'text', 'name' => 'favicon_url', 'tip' => __('This will replace the default favicon logo.(i.e. http://www.yoursite.com/favicon.ico)', APP_TD))));
     $this->tab_sections['general']['configuration'] = array('title' => __('Social', APP_TD), 'fields' => array(array('title' => __('Feedburner URL', APP_TD), 'desc' => sprintf(__('%1$s Sign up for a free <a target="_blank" href="%2$s">Feedburner account</a>.', APP_TD), '<i class="social-ico dashicons-before feedburnerico"></i>', 'https://feedburner.google.com'), 'type' => 'text', 'name' => 'feedburner_url', 'tip' => __('Automatically redirect your default RSS feed to Feedburner.', APP_TD)), array('title' => __('Twitter ID', APP_TD), 'desc' => sprintf(__('%1$s Sign up for a free <a target="_blank" href="%2$s">Twitter account</a>.', APP_TD), '<i class="social-ico dashicons-before twitterico"></i>', 'https://twitter.com'), 'type' => 'text', 'name' => 'twitter_username', 'tip' => __('Automatically redirect your Twitter link to your Twitter page.', APP_TD)), array('title' => __('Facebook ID', APP_TD), 'desc' => sprintf(__('%1$s Sign up for a free <a target="_blank" href="%2$s">Facebook account</a>.', APP_TD), '<i class="social-ico dashicons-before facebookico"></i>', 'https://www.facebook.com'), 'type' => 'text', 'name' => 'facebook_id', 'tip' => __('Display a Facebook icon in the header that links to your page.', APP_TD)), array('title' => __('Analytics Code', APP_TD), 'desc' => sprintf(__('%1$sSign up for a free <a target="_blank" href="%2$s">Google Analytics account</a>.', APP_TD), '<i class="social-ico dashicons-before googleico"></i>', 'https://www.google.com/analytics/'), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'google_analytics', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => __('You can use Google Analytics or other providers as well.', APP_TD))));
     $this->tab_sections['general']['google_maps'] = array('title' => __('Google Maps', APP_TD), 'fields' => array(array('title' => __('Region Biasing', APP_TD), 'desc' => sprintf(__('Find your two-letter <a href="%s" target="_blank">region code</a>', APP_TD), esc_attr('http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes')), 'type' => 'text', 'name' => 'gmaps_region', 'tip' => __("If you set this to 'IT' and a user enters 'Florence' in the location search field, it will target 'Florence, Italy' rather than 'Florence, Alabama'.", APP_TD), 'extra' => array('class' => 'small-text')), array('title' => __('Language', APP_TD), 'desc' => sprintf(__('Find your two-letter <a href="%s" target="_blank">language code</a>', APP_TD), 'http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes'), 'type' => 'text', 'name' => 'gmaps_lang', 'tip' => __('Used to format the address and map controls.', APP_TD), 'extra' => array('class' => 'small-text')), array('title' => __('Distance Unit', APP_TD), 'type' => 'select', 'name' => 'distance_unit', 'values' => array('km' => __('Kilometers', APP_TD), 'mi' => __('Miles', APP_TD)), 'tip' => '')));
     $this->tab_sections['general']['search_settings'] = array('title' => __('Search', APP_TD), 'fields' => array(array('title' => __('Pages', APP_TD), 'name' => 'search_ex_pages', 'type' => 'checkbox', 'desc' => __('Exclude from search results', APP_TD), 'tip' => ''), array('title' => __('Blog Posts', APP_TD), 'name' => 'search_ex_blog', 'type' => 'checkbox', 'desc' => __('Exclude from search results', APP_TD), 'tip' => ''), array('title' => __('Refine Price Slider', APP_TD), 'name' => 'refine_price_slider', 'type' => 'checkbox', 'desc' => __('Use a price slider instead of input fields in the "refine search" widget', APP_TD), 'tip' => '')));
     $this->tab_sections['categories']['category_menu_options'] = array('title' => __('Categories Menu', APP_TD), 'fields' => $this->categories_options('cat_menu'));
     $this->tab_sections['categories']['category_dir_options'] = array('title' => __('Categories Page', APP_TD), 'fields' => $this->categories_options('cat_dir'));
     $this->tab_sections['categories']['search_dropdown'] = array('title' => __('Search Categories', APP_TD), 'fields' => array(array('title' => __('Depth', APP_TD), 'type' => 'select', 'name' => 'search_depth', 'values' => array('0' => __('Show All', APP_TD), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'), 'tip' => __("This sets the depth of categories shown in the category drop-down. Use 'Show All' unless you have a lot of sub-categories and do not want them all listed.", APP_TD)), array('title' => __('Hierarchy', APP_TD), 'name' => 'cat_hierarchy', 'type' => 'checkbox', 'desc' => __('Indent sub-categories within the drop-down', APP_TD), 'tip' => ''), array('title' => __('Show Count', APP_TD), 'name' => 'cat_count', 'type' => 'checkbox', 'desc' => __('Display the ad total next to each category in the drop-down', APP_TD), 'tip' => ''), array('title' => __('Hide Empty', APP_TD), 'name' => 'cat_hide_empty', 'type' => 'checkbox', 'desc' => __('Hide empty categories within the drop-down', APP_TD), 'tip' => '')));
     $this->tab_sections['general']['messages'] = array('title' => __('Messages', APP_TD), 'fields' => array(array('title' => __('Home Page', APP_TD), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'ads_welcome_msg', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => __('Appears in the sidebar of your home page. (HTML is allowed)', APP_TD)), array('title' => __('New Ad', APP_TD), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'ads_form_msg', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => __('Appears at the top of the classified ads listing page. (HTML is allowed)', APP_TD)), array('title' => __('Membership', APP_TD), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'membership_form_msg', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => __('Appears at the top of the membership package purchase page. (HTML is allowed)', APP_TD)), array('title' => __('Terms', APP_TD), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'ads_tou_msg', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => __('Appears on the last step of your classified ad listing page. This is usually your legal disclaimer or rules for posting new ads. (HTML is allowed)', APP_TD))));
     $this->tab_sections['listings']['configuration'] = array('title' => __('General', APP_TD), 'fields' => array(array('title' => __('Editing', APP_TD), 'name' => 'ad_edit', 'type' => 'checkbox', 'desc' => __('Allow users to edit and republish their ads', APP_TD), 'tip' => __('They can manage and edit ads from their dashboard.', APP_TD)), array('title' => __('Relisting', APP_TD), 'name' => 'allow_relist', 'type' => 'checkbox', 'desc' => __('Allow users to relist and pay for their expired ads', APP_TD), 'tip' => __('An email will be sent with a link to relist their ad.', APP_TD)), array('title' => __('Listing Period', APP_TD), 'type' => 'number', 'name' => 'prun_period', 'desc' => __('Days each ad will be listed ', APP_TD), 'tip' => __('This option is overridden by ad packs if you are charging for ads and using the Fixed Price Per Ad option. ', APP_TD), 'extra' => array('class' => 'small-text')), array('title' => __('Parent Posting', APP_TD), 'type' => 'select', 'name' => 'ad_parent_posting', 'values' => array('yes' => __('Yes', APP_TD), 'no' => __('No', APP_TD), 'whenEmpty' => __('When Empty', APP_TD)), 'desc' => __("Allow users to post in top-level categories", APP_TD), 'tip' => __("If set to 'When Empty', it allows posting to top-level categories only if they have no child categories.", APP_TD))));
     $this->tab_sections['listings']['adpage'] = array('title' => __('Ad Page', APP_TD), 'fields' => array(array('title' => __('Inquiry Form', APP_TD), 'name' => 'ad_inquiry_form', 'type' => 'checkbox', 'desc' => __('Require visitors to be logged in before they can contact ad owners', APP_TD), 'tip' => __('In most cases you should keep this set to no to encourage visitors to ask questions without having to create an account.', APP_TD)), array('title' => __('Allow HTML', APP_TD), 'name' => 'allow_html', 'type' => 'checkbox', 'desc' => __('Permit users to use HTML within their ad listings', APP_TD), 'tip' => __('Turns on the TinyMCE editor on text area fields and allows the ad owner to use html markup. Other fields do not allow html by default.', APP_TD)), array('title' => __('View Counter', APP_TD), 'name' => 'ad_stats_all', 'type' => 'checkbox', 'desc' => __("Show a page views counter on each ad listing and blog post", APP_TD), 'tip' => __("This will show a 'total views' and 'today's views' at the bottom of each ad listing and blog post.", APP_TD)), array('title' => __('Gravatar', APP_TD), 'name' => 'ad_gravatar_thumb', 'type' => 'checkbox', 'desc' => __("Show a picture of the user on their ad listing", APP_TD), 'tip' => __("A placeholder image will be used if they don't have a Gravatar setup.", APP_TD))));
     $this->tab_sections['listings']['moderate'] = array('title' => __('Moderate', APP_TD), 'fields' => array(array('title' => __('Ads', APP_TD), 'type' => 'checkbox', 'name' => 'moderate_ads', 'desc' => __('Manually approve and publish each new ad', APP_TD), 'tip' => __('Left unchecked, ads go live immediately without being moderated (unless it has not been paid for).', APP_TD)), array('title' => __('Edited Ads', APP_TD), 'type' => 'checkbox', 'name' => 'moderate_edited_ads', 'desc' => __('Manually approve and publish user edited ads', APP_TD), 'tip' => __('Left unchecked, edited ads stay live without being moderated.', APP_TD)), array('title' => __('Prune Ads', APP_TD), 'name' => 'post_prune', 'type' => 'checkbox', 'desc' => __('Automatically remove expired listings', APP_TD), 'tip' => __('Left unchecked, ads will remain live but marked as expired. If enabled, ads will be set to draft (not deleted). Frequency can be set via the cron job option on the advanced tab.', APP_TD))));
     $this->tab_sections['listings']['images'] = array('title' => __('Ad Images', APP_TD), 'fields' => array(array('title' => __('Allow Images', APP_TD), 'name' => 'ad_images', 'type' => 'checkbox', 'desc' => __('Allow the user to upload and display images in their ad', APP_TD), 'tip' => ''), array('title' => __('Require Images', APP_TD), 'name' => 'require_images', 'type' => 'checkbox', 'desc' => __('Require at least one image uploaded per ad', APP_TD), 'tip' => ''), array('title' => __('Preview Image', APP_TD), 'name' => 'ad_image_preview', 'type' => 'checkbox', 'desc' => __('Display a larger image when you mouse over the thumbnail', APP_TD), 'tip' => __('Affects the home, category, and search results pages.', APP_TD)), array('title' => __('Max Images', APP_TD), 'type' => 'select', 'name' => 'num_images', 'values' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10'), 'desc' => __('Images allowed per ad', APP_TD)), array('title' => __('Max Size', APP_TD), 'type' => 'select', 'name' => 'max_image_size', 'values' => array('100' => '100KB', '250' => '250KB', '500' => '500KB', '1024' => '1MB', '2048' => '2MB', '5120' => '5MB', '7168' => '7MB', '10240' => '10MB'), 'desc' => __('Maximum size per image', APP_TD))));
     $this->tab_sections['security']['settings'] = array('title' => __('Access', APP_TD), 'fields' => array(array('title' => __('Backend Access', APP_TD), 'desc' => sprintf(__("Restrict access by <a target='_blank' href='%s'>specific role</a>.", APP_TD), 'http://codex.wordpress.org/Roles_and_Capabilities'), 'type' => 'select', 'name' => 'admin_security', 'values' => array('manage_options' => __('Admins Only', APP_TD), 'edit_others_posts' => __('Admins, Editors', APP_TD), 'publish_posts' => __('Admins, Editors, Authors', APP_TD), 'edit_posts' => __('Admins, Editors, Authors, Contributors', APP_TD), 'read' => __('All Access', APP_TD), 'disable' => __('Disable', APP_TD)), 'tip' => '')));
     $this->tab_sections['security']['recaptcha'] = array('title' => __('reCaptcha', APP_TD), 'fields' => array(array('title' => __('Enable', APP_TD), 'name' => 'captcha_enable', 'type' => 'checkbox', 'desc' => sprintf(__("A free <a target='_blank' href='%s'>anti-spam service</a> provided by Google", APP_TD), 'https://www.google.com/recaptcha/'), 'tip' => __('Displays a verification box on your registration page to prevent your website from spam and abuse.', APP_TD)), array('title' => __('Public Key', APP_TD), 'desc' => '', 'type' => 'text', 'name' => 'captcha_public_key', 'desc' => ''), array('title' => __('Private Key', APP_TD), 'desc' => '', 'type' => 'text', 'name' => 'captcha_private_key', 'tip' => ''), array('title' => __('Theme', APP_TD), 'type' => 'select', 'name' => 'captcha_theme', 'values' => array('red' => __('Red', APP_TD), 'white' => __('White', APP_TD), 'blackglass' => __('Black', APP_TD), 'clean' => __('Clean', APP_TD)), 'tip' => '')));
     $this->tab_sections['advertise']['header'] = array('title' => __('Header Ad (468x60)', APP_TD), 'fields' => array(array('title' => __('Enable', APP_TD), 'name' => 'adcode_468x60_enable', 'type' => 'checkbox', 'desc' => __('Displayed in the header', APP_TD), 'tip' => ''), array('title' => __('Code', APP_TD), 'desc' => sprintf(__('Supports many popular providers such as <a target="_blank" href="%s">Google AdSense</a> and <a target="_blank" href="%s">BuySellAds</a>.', APP_TD), 'https://www.google.com/adsense/', 'https://www.buysellads.com/'), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'adcode_468x60', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => ''), array('title' => __('Image', APP_TD), 'desc' => $this->wrap_upload('adcode_468x60_url', '<br />' . __('Enter the URL to your ad creative.', APP_TD)), 'type' => 'text', 'name' => 'adcode_468x60_url', 'tip' => __('If you would rather use an image ad instead of code provided by your advertiser, use this field.', APP_TD)), array('title' => __('Destination', APP_TD), 'desc' => __('The URL of your landing page.', APP_TD), 'type' => 'text', 'name' => 'adcode_468x60_dest', 'tip' => __('When a visitor clicks on your ad image, this is the destination they will be sent to.', APP_TD))));
     $this->tab_sections['advertise']['content'] = array('title' => __('Content Ad (336x280)', APP_TD), 'fields' => array(array('title' => __('Enable', APP_TD), 'name' => 'adcode_336x280_enable', 'type' => 'checkbox', 'desc' => __('Displayed on single ad, category, and search result pages', APP_TD), 'tip' => ''), array('title' => __('Code', APP_TD), 'desc' => sprintf(__('Supports many popular providers such as <a target="_blank" href="%s">Google AdSense</a> and <a target="_blank" href="%s">BuySellAds</a>.', APP_TD), 'https://www.google.com/adsense/', 'https://www.buysellads.com/'), 'type' => 'textarea', 'sanitize' => 'appthemes_clean', 'name' => 'adcode_336x280', 'extra' => array('rows' => 10, 'cols' => 50, 'class' => 'large-text code'), 'tip' => ''), array('title' => __('Image', APP_TD), 'desc' => $this->wrap_upload('adcode_336x280_url', '<br />' . __('Enter the URL to your ad creative.', APP_TD)), 'type' => 'text', 'name' => 'adcode_336x280_url', 'tip' => __('If you would rather use an image ad instead of code provided by your advertiser, use this field.', APP_TD)), array('title' => __('Destination', APP_TD), 'desc' => __('The URL of your landing page.', APP_TD), 'type' => 'text', 'name' => 'adcode_336x280_dest', 'tip' => __('When a visitor clicks on your ad image, this is the destination they will be sent to.', APP_TD))));
     $this->tab_sections['advanced']['settings'] = array('title' => __('Maintenance', APP_TD), 'fields' => array(array('title' => __('Prune Ads', APP_TD), 'name' => '_blank', 'type' => '', 'desc' => sprintf(__('<a href="%s">Prune expired ads</a>', APP_TD), 'admin.php?page=app-settings&pruneads=1'), 'extra' => array('style' => 'display: none;'), 'tip' => __('Click the link to manually run the function that checks all ads expiration and prunes any ads that are expired. This event will run only one time.', APP_TD)), array('title' => __('Reset Stats', APP_TD), 'name' => '_blank', 'type' => '', 'desc' => sprintf(__('<a href="%s">Reset stats counters</a>', APP_TD), 'admin.php?page=app-settings&resetstats=1'), 'extra' => array('style' => 'display: none;'), 'tip' => __('Click the link to run the function that reset the stats counters for all ads and posts.', APP_TD))));
     $this->tab_sections['advanced']['user'] = array('title' => __('User', APP_TD), 'fields' => array(array('title' => __('Set Password', APP_TD), 'name' => 'allow_registration_password', 'type' => 'checkbox', 'desc' => __('Let the user create their own password vs a system generated one', APP_TD), 'tip' => ''), array('title' => __('Disable Toolbar', APP_TD), 'name' => 'remove_admin_bar', 'type' => 'checkbox', 'desc' => __('Hide the WordPress toolbar for logged in users', APP_TD), 'tip' => ''), array('title' => __('Disable Embeds', APP_TD), 'name' => 'disable_embeds', 'type' => 'checkbox', 'desc' => __("Don't allow users to embed videos, images, or any other media", APP_TD), 'tip' => ''), array('title' => __('Disable Login Page', APP_TD), 'name' => 'disable_wp_login', 'type' => 'checkbox', 'desc' => __('Prevents users from accessing <code>wp-login.php</code> directly', APP_TD), 'tip' => '')));
     $this->tab_sections['advanced']['developer'] = array('title' => __('Developer', APP_TD), 'fields' => array(array('title' => __('Disable Stylesheets', APP_TD), 'name' => 'disable_stylesheet', 'type' => 'checkbox', 'desc' => __('Turn off all styles (advanced users only)', APP_TD), 'tip' => __("If you are interested in creating a child theme or just want to completely disable the core theme styles, enable this option.", APP_TD)), array('title' => __('Enable Debug Mode', APP_TD), 'name' => 'debug_mode', 'type' => 'checkbox', 'desc' => __('Print out the <code>$wp_query->query_vars</code> array at the top of your website', APP_TD), 'tip' => ''), array('title' => __('Use Google CDN', APP_TD), 'name' => 'google_jquery', 'type' => 'checkbox', 'desc' => __("Speed up your website and save bandwidth by using their hosted jQuery", APP_TD), 'tip' => ''), array('title' => __('Hide Version', APP_TD), 'name' => 'remove_wp_generator', 'type' => 'checkbox', 'desc' => __("Remove the WordPress version meta tag from your website", APP_TD), 'tip' => __("An added security measure so snoopers won't be able to tell what version of WordPress you're running.", APP_TD)), array('title' => __('Cache Expires', APP_TD), 'desc' => __('This number is in seconds so one day equals 86400.', APP_TD), 'type' => 'text', 'name' => 'cache_expires', 'tip' => __('To speed up page loading on your site, ClassiPress uses a caching mechanism on certain features (i.e. category drop-down, home page). The cache automatically gets flushed whenever a category has been added/modified, however this value sets the frequency your cache is regularly emptied. We recommend keeping this at the default (every hour = 3600 seconds).', APP_TD), 'extra' => array('class' => 'regular-text')), array('title' => __('Cron Schedule', APP_TD), 'type' => 'select', 'name' => 'ad_expired_check_recurrance', 'desc' => __('Frequency to check for and take offline expired ads', APP_TD), 'values' => array('none' => __('None', APP_TD), 'hourly' => __('Hourly', APP_TD), 'twicedaily' => __('Twice Daily', APP_TD), 'daily' => __('Daily', APP_TD)), 'tip' => __('Twice daily is recommended. Hourly may cause performance issues if you have a lot of ads. Note: This feature only works if you have enabled the Prune Ads option. ', APP_TD))));
     $this->tab_sections['advanced']['permalinks'] = array('title' => __('Custom URLs', APP_TD), 'fields' => array(array('title' => __('Permalinks', APP_TD), 'type' => '', 'name' => '_blank', 'desc' => sprintf(__('<a href="%s">Setup permalinks</a>', APP_TD), 'options-permalink.php'), 'extra' => array('style' => 'display: none;'))));
     $this->tab_sections['advanced']['legacy'] = array('title' => __('Legacy', APP_TD), 'fields' => array(array('title' => __('Ad Box Right Side', APP_TD), 'type' => 'select', 'name' => 'ad_right_class', 'values' => array('full' => __('Normal Full Width', APP_TD), '' => __('Legacy Ads Width', APP_TD)), 'tip' => __('Sometimes the main ad listings box is too narrow or it wraps due to legacy ad sizes.', APP_TD))));
 }
    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @return void
     */
    function my_simone_paging_nav()
    {
        // Don't print empty markup if there's only one page.
        if ($GLOBALS['wp_query']->max_num_pages < 2) {
            return;
        }
        $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
        $pagenum_link = html_entity_decode(get_pagenum_link());
        $query_args = array();
        $url_parts = explode('?', $pagenum_link);
        if (isset($url_parts[1])) {
            wp_parse_str($url_parts[1], $query_args);
        }
        $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
        $pagenum_link = trailingslashit($pagenum_link) . '%_%';
        $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
        $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%';
        // Set up paginated links.
        $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $GLOBALS['wp_query']->max_num_pages, 'current' => $paged, 'mid_size' => 2, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('← Previous', 'my-simone'), 'next_text' => __('Next →', 'my-simone'), 'type' => 'list'));
        if ($links) {
            ?>
	<nav class="navigation paging-navigation" role="navigation">
		<h1 class="screen-reader-text"><?php 
            _e('Posts navigation', 'my-simone');
            ?>
</h1>
			<?php 
            echo $links;
            ?>
	</nav><!-- .navigation -->
	<?php 
        }
    }
Example #28
0
function foogallery_album_remove_gallery_from_link()
{
    $gallery = foogallery_album_get_current_gallery();
    $slug = foogallery_album_gallery_url_slug();
    $url = untrailingslashit(remove_query_arg($slug));
    return str_replace($slug . '/' . $gallery, '', $url);
}
Example #29
0
function themepark_remove_cssjs_ver($src)
{
    if (strpos($src, 'ver=' . get_bloginfo('version'))) {
        $src = remove_query_arg('ver', $src);
    }
    return $src;
}
Example #30
0
    /**
     * Display navigation to next/previous set of posts when applicable.
     *
     * @since Anciela 1.0
     */
    function anciela_paging_nav($query = null)
    {
        // Don't print empty markup if there's only one page.
        if ($query == null) {
            $query = $GLOBALS['wp_query'];
        }
        if ($query->max_num_pages < 2) {
            return;
        }
        $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
        $pagenum_link = html_entity_decode(get_pagenum_link());
        $query_args = array();
        $url_parts = explode('?', $pagenum_link);
        if (isset($url_parts[1])) {
            wp_parse_str($url_parts[1], $query_args);
        }
        $pagenum_link = remove_query_arg(array_keys($query_args), $pagenum_link);
        $pagenum_link = trailingslashit($pagenum_link) . '%_%';
        $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos($pagenum_link, 'index.php') ? 'index.php/' : '';
        $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit('page/%#%', 'paged') : '?paged=%#%';
        // Set up paginated links.
        $links = paginate_links(array('base' => $pagenum_link, 'format' => $format, 'total' => $query->max_num_pages, 'current' => $paged, 'mid_size' => 1, 'add_args' => array_map('urlencode', $query_args), 'prev_text' => __('&larr; Plus récents', 'anciela'), 'next_text' => __('Plus anciens &rarr;', 'anciela')));
        if ($links) {
            ?>
	<nav class="navigation paging-navigation" role="navigation">
        <?php 
            echo $links;
            ?>
	</nav><!-- .navigation -->
	<?php 
        }
    }