Junaid Bhura
Forum Replies Created
-
Forum: Plugins
In reply to: [Fly Dynamic Image Resizer] HTTPS protocolAs of now, the URLs will use the protocol of the site
Forum: Plugins
In reply to: [Fly Dynamic Image Resizer] Windows server support – forward slashesHello,
Glad you find the plugin useful!Thanks for pointing this out. I’ve released a new version, once updated, this issue should be fixed.
Forum: Plugins
In reply to: [WP Super Cache] Problem with SuperCache and Polylang (multiple domains)You can use this code in your functions.php file. This will clear the cache for posts when you update it. I’m not sure how the delete all cached pages would work as there are no hooks:
// Fix Polylang WP Super Cache problem function jb_clear_polylang_super_cache( $post_ID, $post_after, $post_before ) { if ( ! empty( $post_after ) ) { $parsed_url = parse_url( get_permalink( $post_after->ID ) ); if ( $parsed_url ) { global $cache_path; $language = pll_get_post_language( $post_after->ID ); $cache_dir = $cache_path . 'supercache/' . $parsed_url['host'] . $parsed_url['path']; $files = get_all_supercache_filenames( $cache_dir ); if ( $files ) { foreach( $files as $cache_file ) { prune_super_cache( $cache_dir . $cache_file, true ); } } } } } add_action( 'post_updated', 'jb_clear_polylang_super_cache', 10, 3 );
Forum: Plugins
In reply to: [Polylang] Github RepositoryIt would be much better for Polylang to have a Github repository now because I’m sure there are a lot of people who have tried doing the same as me but did not write to you.
It is very easy to set up, so that you can have both SVN and GIT in the same folder:
https://danielbachhuber.com/2012/09/30/git-in-my-subversion/
https://vip.wordpress.com/documentation/using-git-with-subversion/I am definitely not going to send you any changes using your contact form. And I’m sure most developers will prefer not to do so.
I guess it’s your choice.
Forum: Plugins
In reply to: [Polylang] "WP SEO" sitemap and translation subdomain issueHi I’ve come up with a solution which lets you have different sitemaps for different translation domains. You can add this in your functions.php file:
FYI: https://github.com/Yoast/wordpress-seo/pull/1904#issuecomment-115528216
/** * Make sure we turn off the Yoast sitmemap transient caching * * @return boolean */ function jb_disable_sitemap_caching() { return false; } add_filter( 'wpseo_enable_xml_sitemap_transient_caching', 'jb_disable_sitemap_caching' ); /** * Makes sure the sitemap only contains translation domain's URLs * by adding a JOIN statement * * @param string $join * @param string $post_type * @return string */ function jb_seo_sitemap_join( $join, $post_type ) { global $wpdb; $join .= " INNER JOIN $wpdb->term_relationships AS pll_lng ON pll_lng.object_id = ID"; return $join; } add_filter( 'wpseo_typecount_join', 'jb_seo_sitemap_join', 100, 2 ); /** * Makes sure the sitemap only contains translation domain's URLs * by adding a WHERE statement * * @param string $join * @param string $post_type * @return string */ function jb_seo_sitemap_where( $where, $post_type ) { global $wpdb; global $polylang; $where .= $wpdb->prepare( " AND pll_lng.term_taxonomy_id = %d", $polylang->curlang->term_taxonomy_id ); return $where; } add_filter( 'wpseo_typecount_where', 'jb_seo_sitemap_where', 100, 2 );
Forum: Plugins
In reply to: [Polylang] How to pass a language parameter to wp_nav_menu ?Hi based on Chouby’s answer, here’s a simple function to get the menu ID based on the menu’s theme_location:
function get_language_menu_id( $theme_location = '' ) { // Check for theme location if ( $theme_location == '' ) return 0; // Get Polylang options $options = get_option( 'polylang' ); if ( $options && isset( $options['nav_menus']['your_theme_name'][ $theme_location ] ) ) { $current_language = pll_current_language(); if ( isset( $options['nav_menus']['your_theme_name'][ $theme_location ][ $current_language ] ) ) return $options['nav_menus']['your_theme_name'][ $theme_location ][ $current_language ]; } // Something went wrong return 0; }
Forum: Plugins
In reply to: [Polylang] What is the long-term plan for this plugin?Great to know! You’ve been doing a great job. Good luck and I hope you get to release a “pro” version or something like that in the future which might benefit you more.
Forum: Plugins
In reply to: Plugin for invoking COD options based on Postal CodeHi there,
There is a plugin that does exactly that: https://gremlin.io/shop/woocommerce-plugins/restrict-check-cod-payment-method-zip-pin-codes-woocommerce
You can upload a CSV file with the PIN / ZIP / Postal codes that you support, and the user can check availability on the product page or anywhere on your site!
Also, if the user’s shipping postal code does not match what you’ve uploaded, the shipping method is disabled on the checkout page.
Okay thanks for the clarification!
Omg, this works! Thanks, man!
Omg, this works! Thanks, man!
+ 1
How exactly do you use it? I’ve tried:
apply_filters( 'wpseo_metabox_prio', 'low' );
in my functions.php but doesn’t work. I think its because the plugins get loaded before the theme does and its too late to use it in the functions.php file. Is there an elegant way without changing the plugin code?
+ 1
How exactly do you use it? I’ve tried:
apply_filters( 'wpseo_metabox_prio', 'low' );
in my functions.php but doesn’t work. I think its because the plugins get loaded before the theme does and its too late to use it in the functions.php file. Is there an elegant way without changing the plugin code?