Giter Club home page Giter Club logo

polylang's Introduction

Welcome to the Polylang repository on GitHub. Here you can browse the source, discuss open issues and keep track of the development.

If you are not a developer, we recommend to download Polylang from WordPress directory.

Before starting, make sure that you have the following software installed and working on your computer:

  1. A local WordPress (6.2 or later) instance
  2. Git to clone the Polylang repository (or your fork of the Polylang repository).
  3. Node.js which provides NPM. They are both required by Webpack that Polylang uses to build and minify CSS and javascript files. We recommend to install Node.js LTS version.
  4. Composer because Polylang uses its autoloader to work and it is required to install development tools such as PHP CodeSniffer that ensures your code follows coding standards.

The simplest way is to clone locally this repository and build it directly in your local WordPress instance by following the steps below:

  1. Go to your local WordPress instance wp-content/plugins/ folder:
    cd your/local/wordpress/path/wp-content/plugins
  2. Clone there the polylang repository (or your fork) from GitHub:
    git clone https://github.com/polylang/polylang.git
  3. Go to your local Polylang clone folder from there: cd polylang
  4. Run the composer command: composer build
  5. Activate Polylang as if you had installed it from WordPress.org:
    See https://wordpress.org/plugins/polylang/#installation

Note: we recommend for Windows users to use Git Bash provided with Git for Windows instead of the command or powershell terminal.

polylang's People

Contributors

aladram avatar chesio avatar chouby avatar dann2012 avatar dependabot[bot] avatar diggy avatar esamattis avatar farhadsakhaei avatar hug0-drelon avatar jnachtigall avatar joryhogeveen avatar maecatnou avatar manooweb avatar marian-kadanka avatar marianne380 avatar mcguffin avatar mch0lic avatar nicoladj77 avatar nicomollet avatar ocean90 avatar onatcer avatar pahan35 avatar raaaahman avatar sanniel avatar screenfeed avatar sebastienserre avatar southan avatar stevekaeser avatar szepeviktor avatar vicocotea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polylang's Issues

Provide origin page duplicate feature

WPML has really cool button allows you to copy existing page content to new translated page in case you want to add a new language. As far as I understand, Polylang has no such feature, so you need to rebuild the content from the scratch or use some additional plugins..
Will you guys support this at some point? Or I have to go with a workaround?

use_balanceTags and String Translation issues

If the use_balanceTags option in WordPress is active, the wp_insert_post call in the export_to_db function in the mo.php file "fixes" malformed HTML content in text widgets and other translatable fields and thus causes the unserialize call in the import_from_db function from the same file to throw an "Error at offset..." notice and, consequently, makes the String Translation module in Polylang to malfunction.

Polylang 2.0.8 - Uncaught TypeError: Cannot read property 'indexOf' of undefined in post.js

The new release 2.0.8 release and in particular this change in js/post.js is blocking savings Product Attributes in WooCommerce.

The javascript error is Uncaught TypeError: Cannot read property 'indexOf' of undefined in post.js. I think options.data is not defined and creates this error.

How to reproduce:

  1. in Admin > Products edit a product
  2. Add a new Attribute to the Product in the Product Data metabox
  3. Click Save attributes button

See screenshot.

Synchronization in Taxonomies

Polylang Version 1.9.2

Checked on fresh wordpress install without any additional plugins.

  • Added two languages, created in them two categories, on top, other sub category.
    
  • Synchronization in Taxonomies enabled.
    
  • Added 5 posts into sub category.
    

Categories structure:
Cat 1 (0 posts) -> Sub Cat 2 (5 posts)

Problem is in:
When I go into created 'Cat 1' category, when I save it again, then all posts from sub category are assigned to the 'Cat 1'.

Deactivated languages appear in XML sitemaps - 404 crawl errors!

I'm having a problem with Yoast SEO (and probably other XML sitemap generators) and deactivated languages because they still show in the sitemaps.
Google Search Console reports these as crawl-errors since these pages aren't available when not logged in.

I'd say this feature should use a filter for compatibility to prevent these languages from apearing in the sitemaps.

'Cheatin' uh?' notice when switching languages (multidomain)

I believe this is a single-login function that does this.

action: pll_xdata_set
key: the-key

Switching languages while logged in into one language domain is currently not working (v2.0.3)

Just wondering, should this be a get instead of a post?

Alternate Hreflangs links. Conflict with Yoast plugin

Polylang Version 1.9.2
Yoast Version 3.2.5

Checked on fresh wordpress install without any additional plugins.

  • Added two languages, created in them two categories. One top, other sub.
    
  • After installing Yoast, added 5 posts in all langs into sub category.
    

Categories structure:
Cat 1 (0 posts) -> Sub Cat 2 (5 posts)

Problem is in:
When going into single post, and view source of html code, alternate links are almost the same. One link is good, other link have categories from first link language. This can be various what language will have good link, what other not.

Yesterday I spent all day to figure out this, and find some in yoast class-primary-category.php. When disabling filter 'post_link_category', all is fine with generated polylang hreflang links.

Support RTL content in LTR admin langauge

I am working on a site where the admin is in English but we have content in Arabic.

With the following code I was able to change the content direction in TinyMCE if the post language was RTL.

function prefix_tinymce_settings( $mceInit, $editor_id ) {

    if ( ! function_exists( 'PLL' ) ) {
        return $mceInit;
    }

    $curlang = PLL()->curlang;
    if ( $curlang->is_rtl ) {
        $mceInit['directionality'] = 'rtl';
    }

    return $mceInit;
}
add_filter( 'tiny_mce_before_init', 'prefix_tinymce_settings', 10, 2 );

function prefix_admin_body_class( $classes ) {
    if ( ! function_exists( 'PLL' ) ) {
        return $classes;
    }

    $curlang = PLL()->curlang;
    if ( $curlang->is_rtl ) {
        // Right: Add a leading space and a trailing space.
        $classes .= ' polylang-rtl ';
    }

    return $classes;
}
add_filter( 'admin_body_class', 'prefix_admin_body_class' );

The reason for adding a new admin body class is so that we can change the direction of the title and any other fields.

.polylang-rtl #titlewrap {
    direction: rtl;
}

Here is a screenshot how it would look like.

image

Polylang lang_choice dropdown widget displays without Label - non-accessible form control

ref: [(http://webaim.org/techniques/forms/controls#select)]

Line 44-46 on include/widget-languages.php

	if ( $title ) {
				echo $args['before_title'] . $title . $args['after_title'];
			}

Suggestion without theme fallback:

if ( $title ) {
  echo $instance['dropdown'] ? '<label for="lang_choice_'.$args['widget_id'].'">' . $title : $args['before_title'] . $title;
  echo $instance['dropdown'] ? '</label>' : $args['after_title'];
}

Suggestion with Theme Fallback:

  if ( $title ) {
    echo $instance['dropdown'] ? '<label  for="lang_choice_'.$args['widget_id'].'">' . $args['before_title'] . $title : $args['before_title'] . $title;
    echo $instance['dropdown'] ? $args['after_title'] . '</label>' : $args['after_title'];
  }

This way them devs could still wrap the title from the $before_title and $after_title hooks, with

<sapn class="visuallyhidden">Widget Title</span> or <h2>Widget Title</h2>

I couldn't determine where the 'lang_choice_' portion of the select(dropdown) id comes from. perhaps someone more familiar with the code could look into integrating this?

Share slugs not working correctly for CPT's and main blog page

It works just fine for default pages but I have two issues since the last update:

Main posts page (in my case: /blog/)
It's no problem to add the correct slug, but on the front-end this doesn't work ( /en/blog/ gets redirected to /blog/ ).

CPT (in my case /product/*).
All default language products are working: /product/*
But products in other languages don't (404): /en/product/*

I am trying to find the problem but so far no luck. Disabling plugins is not helping.

Getting: ( ! ) Notice: Undefined offset: 3 in /plugins/polylang-pro/admin/admin-filters-term.php on line 725

Call Stack

Time Memory Function Location

1 0.0019 450416 {main}( ) .../edit-tags.php:0
2 0.4747 23930336 get_option( ) .../edit-tags.php:355
3 0.4747 23930384 apply_filters( ) .../option.php:136
4 0.4747 23930760 PLL_Admin_Filters_Term->option_default_category( ) .../plugin.php:235

and

( ! ) Notice: Undefined offset: 3 in /plugins/polylang-pro/admin/admin-filters-term.php on line 725
Call Stack

Time Memory Function Location

1 0.0019 450416 {main}( ) .../edit-tags.php:0
2 0.4747 23930336 get_option( ) .../edit-tags.php:355
3 0.4747 23930384 apply_filters( ) .../option.php:136
4 0.4747 23930760 PLL_Admin_Filters_Term->option_default_category( ) .../plugin.php:235

With latest WP 4.5.1 and Polylang Pro 1.9.0 when I try to translate categories

Cannot save string translations

My permalink is /%category%/%postname%/
(The language is set from the directory name in pretty permalinks)
(Remove /language/ in pretty permalinks)
(Hide URL language information for default language)

My front page is non static.

Link to my site is http://wimutti.org/ and http://wimutti.org/en/

I tried to disabled plugins but not working.

I tried to translated strings and click on Save Changes but nothing saved.

Relational issues with ACF Pro

Relationship or Post Objects doesn't work. Trying to have a relationship flexible content wrapper that needs to be translated and have different content for example Swedish and English.
When I update the Swedish version with a post that doesn't exist in english it creates an empty field. And with save takes a random post.

Tried Polylang Fix Relationships (https://github.com/mcguffin/polylang-fix-relationships) and I really don't want to go back to WPML just for this.

Using latest Advanced Custom Fields PRO (5.4.1) and Polylang Pro (2.0.2) with an Custom Post Types.

Any ideas?

(Custom) post types and (custom) taxonomies don't show in settings when not public

When CPT's or CT's are added but not set to public they don't show in the settings tab for polylang.
BUT: they CAN be translated in the admin!

When a tax or post is not public they can still be used for various cases. Even for generating content in the frontend! This just means that the post or tax pages are not accessible directly.

So, I would say the private CPT's and CT's should be in the settings tab to enable/disable translations for them.

Make `is_active_sidebar()` language specific

I was using is_active_sidebar() to check if there is a widget in the sidebar. I had set the widget in the sidebar to only show on the German page but is_active_sidebar() was still returning true on the French page even though there were not any widgets for the French page.

This is the solution that I came up for the problem.

/**
 * Unset widgets if not used for the current language so that is_active_sidebar() works per language.
 */
function prefix_active_sidebars_widgets( $sidebars_widgets ) {

	if ( ! isset( $sidebars_widgets['sidebar-front'] ) ) {
		return $sidebars_widgets;
	}

	if ( ! isset( $sidebars_widgets['sidebar-front'][0] ) ) {
		return $sidebars_widgets;
	}
	// Fetch the widget name.
	$widget_name = substr( $sidebars_widgets['sidebar-front'][0], 0, strrpos( $sidebars_widgets['sidebar-front'][0], '-') );
	$widget_option = get_option( 'widget_' .$widget_name );

	foreach ( $sidebars_widgets['sidebar-front'] as $key => $widget ) {
		// Fetch widget id.
		$widget_id = absint( strrchr( $widget, '-' ) );
		if ( isset( $widget_option[ $widget_id ]['pll_lang'] ) && function_exists('pll_current_language') && $widget_option[ $widget_id ]['pll_lang'] !== pll_current_language() ) {
			unset( $sidebars_widgets['sidebar-front'][ $key ] );
		}
	}

	return $sidebars_widgets;
}
add_filter( 'sidebars_widgets', 'prefix_active_sidebars_widgets' );

Setting a static front page in customizer fails silently if translations are not added

When trying to set a static front page via customizer before adding translations to said front page, it will fail silently without any errors => quite confusing even for a seasoned developer.

Trying to set the static front page from Settings -> Reading before adding translations also fails, but it displays a helpful error message:

the error

https://developer.wordpress.org/themes/advanced-topics/customizer-api/#setting-validation

conflict with permalink configuration

for everyone's sake please somebody fix the problem with pretty urls conflict with polylang.

i have all the latest updates installed.. all in place.. yet menu langs always remains same.

coming to the problem: polylang or wp itsel is not able to detect the language when "Permalinks -> Post name" used.

Link two post language manually

Hi, I am currently developing a plugin for multiposting on multisite wordpress.

I wanted the plugin to work with polylang, it works well when it comes to setting the right language, but i can't find a way to connect to its other translations ( when i post from a blog to the others, otherwise on the same site, it works ).

Do you have any idea how I can set manually the link between translations of the same post ?

Thank's by advance ! :)

Select for page linking not working

Issue:
When I try to link pages together (translations), I don't get the autocomplete box appearing, and console displays some errors.
Result is that I can't link pages together in the Language box.

Versions:
WP: 4.5.1
Polylang 1.9

image

Multiple domains on SSL

Not sure if this a config problem or a bug.

When I have Polylang configurated to use different domains that both have a SSL conection this doesn't seem to work.
This website is on a multisite and we use domain mapping to link both domains to the same blog.
In theory this should work the same as a single installation with a main domain and a domain alias without 301 redirection.

Somehow polylang only accepts a non-SSL domain for a translation (the main language works).
If we do set it to a SLL domain the homepage shows the default language, and the other pages get a redirect loop.

Pro: slug translation check fails if "post-formats" theme support is added without arguments

If i add theme support for post-formats without arguments like this:

add_theme_support( 'post-formats' );

then get_theme_support( 'post-formats' ) will return true. See here: Codex: get theme support

If that is the case, a foreach loop in modules/translate-slugs/translate-slugs-model.php fails because it's trying to loop a boolean instead of an array.

// Line 189
// get_theme_support sends an array of array
if ( false !== $formats = get_theme_support( 'post-formats' ) ) {
    foreach ( $formats[0] as $format ) {
        $slugs[ 'post-format-' . $format ]['slug'] = $format;
        $slugs[ 'post-format-' . $format ]['translations'][ $language->slug ] = $mo->translate( $format );
    }
}

Instead of checking for false, perhaps the condition should check that get_theme_support returns an array?

I don't know if there's any reason to add support for post-formats without actually defining any, but this line was in a theme boilerplate I was using and caused a bit of confusion at first.

Non standard port urls are redirected to standard port

An initial tag search result page returns fine with Polylang active, but when clicking on a pagination link, the port is trimmed from the URL, causing link failure.

Deactivating Polylang restores working pagination links.

For example, the pagination link is:
http://127.0.0.1/wordpress/tag/artists-performers/page/2/

when it should be:
http://127.0.0.1:8081/wordpress/tag/artists-performers/page/2/

After much troubleshooting, I found what seems to be a fix, on line 360 of frontend-filters-links.php.

Original:
$redirect_url = ( ! $redirect_url = redirect_canonical( $requested_url, false ) ) ? $requested_url : $redirect_url;

As I understand it, the ternary operator in the line tries to compare $redirect_url and redirect_canonical, but up to that point in the function, $redirect_url is undefined, so any comparison would be expected to fail. Changing $redirect_url to $requested_url in the ternary operator seems to fix things.

Revised:
$redirect_url = ( ! $requested_url = redirect_canonical( $requested_url, false ) ) ? $requested_url : $redirect_url;

Does this fix make any sense, or might it cause problems under other circumstances? If the original line is indeed correct, is there a hook I can use to repair the URL specifically for my site?

Any insight would be appreciated.

Note: I am presently developing on a local server, and do not know if this behaviour would occur on a live server, but I have seen other threads with similar search pagination problems. I have tested with the latest build in GitHub without success.

load_plugin_textdomain() in WordPress 4.6RC + Polylang 2.0.2

Hi!

I'm testing WordPress 4.6RC in a dev site with Polylang installed and configured. A private plugin I developed is no longer loading its .mo files in the admin (in the frontend is working correctly) from the plugin's language folder using the following code:

add_action( 'plugins_loaded', 'my_plugins_loaded' );
function my_plugins_loaded() {
    load_plugin_textdomain( 'my-plugin-domain', false, dirname( plugin_basename( __FILE__ ) ) .  '/languages' );
}

I had no issues in 4.5.3. The following tickets show that 4.6 will load languages files differently:

https://core.trac.wordpress.org/ticket/34213
https://core.trac.wordpress.org/ticket/34114
https://make.wordpress.org/core/2016/07/06/bootstrapload-updates-in-4-6/

If I disable Polylang, my private plugin loads its local .mo files in the admin as expected.

Any ideas?

Deactivate site on subdomain / other domain

Deactivating a website requires a user to log in. But when you use a subdomain or other domain and you use the default domain to access the admin this is a bit of a hassle.

Ofcourse it is logical that this won't work since you don't have the login cookies when on a other or subdomain but maybe there is something to do about this?

Perhaps a temprary metakey with the users IP address that removes itself after logout?

How to get original string from translation

How would I go about getting the original string from the translated version of the string? For example:

Original String (en_US): Full Name
Translation (de_DE): Vor- und Nachname

I'd like to have some kind of a function that looked something like this:

prefix_get_original_pll_translation( 'Vor- und Nachname', 'en_US' ) which returned Full Name. I was hoping pll_translate_string() would be able to handle this, but it only seems to work when translating the original language to an alternate, but not an alternate back to the original.

Is this possible?

Strings translation option

Hi Chouby

Could you please take a look at this topic: https://wordpress.org/support/topic/slight-annoyance-when-editing-strings-manually-saving-them-returns-to-page-1?replies=3 ?

`

/* Your own code for setting $this->_column_headers */

    $per_page = 20; /* this seems to be what you're using, or maybe it's WP's default? You could also do $per_page = $this->get_pagination_arg('per_page'); which ought to work */

    /* Let's figure out what page the user is currently
     * looking at.
     */
    $current_page = $this->get_pagenum();

    /**
     * REQUIRED for pagination.
     */
    $total_items = count($items);

    /**
     * The WP_List_Table class does not handle pagination for us, so we need
     * to ensure that the data is trimmed to only the current page. We can use
     * array_slice() to
     */
    $items = array_slice($items,(($current_page-1)*$per_page),$per_page);

    $this->items = $items;

  /**
     * REQUIRED. We also have to register our pagination options & calculations.
     */
    $this->set_pagination_args( array(
        'total_items' => $total_items,                  //WE have to calculate the total number of items
        'per_page'    => $per_page,                     //WE have to determine how many items to show on a page
        'total_pages' => ceil($total_items/$per_page)   //WE have to calculate the total number of pages
    ) );

`

bbPress & BuddyPress compatibility

Hi,

There are some compatibility issues with bbPress & BuddyPress:
The current user is being initialized without using $wp->init()

In admin/admin-base.php, line 57 in "init()", replace this:
add_filter( 'setup_theme', array( $this, 'init_user' ) );

to this:
add_filter( 'init', array( $this, 'init_user' ) );

Switching language for subcategory

Hello. I have PHP 7.0.11 , Wordpress 4.6.1 and Polylang 2.0.5 (and I try polylang from github, master branch).

I add subcategory and can not switching language with help pll_the_languages function.
Link leads to the home page.

  • Permalinks: "Post name"
  • Link to a sub-category for the current language is correct, for other languages is not correct and leads to the main page.
  • Subcategory linked through the appropriate fields in the admin panel.

P.S. When I do var_dump inside function pll_the_languages:
var_dump(PLL()->links);

I see empty field:
["translation_url:ru"]=>string(0) ""
inside PLL_Cache object

Missing argument 3 for icl_t()

Plugin Polylang giving conflict with theme file "Goliath".
Warning: Missing argument 3 for icl_t(), called in /home/pubsi387/public_html/mysite/wp-content/themes/goliath/theme/theme-functions.php on line 1403 and defined in /home/pubsi387/public_html/mysite/wp-content/plugins/polylang/modules/wpml/wpml-compat.php on line 256

Stopped giving the error after deleting the "IF" on line 256 of the file in Polylang.

Has anyone seen this error or incompatibility with other themes?
I'm using the latest version = 1.9.1.

Menu shown in default language on the backend.

We are using Shortcode on the backend to visually show the shortcode. The shortcode includes code wp_nav_menu() to display the menu.

The front end shows the menu in the correct language but on the backend the menu is shown in the default language.

Static front page pagination issue

Using Polylang on a two language / two domain setting with Binder Pro theme breaks pagination on static front page showing offset post loop.

Any page other than the main one gets its number removed, even when input into address bar manually. So instead of site.com/page/2 I get site.com/page and, thus, a 404.
Deactivating Polylang makes the links work.

The theme uses WP_Query to build the loop. Maybe I could change something in that?
Any hints in the right directions greatly appreciated. Thank you!

Here is the theme's template which creates this loop:

<?php
/**
 * The template used for displaying Blog Modules content
 *
 */
?>

<?php 
$mod_id = get_the_ID();

// Get Blog Module Data
$blog_layout    = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_layout', true ) );
$blog_columns   = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_columns', true ) );
$blog_margins   = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_margins', true ) );
$blog_anim      = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_anim', true ) );
$blog_perpage   = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_perpage', true ) );
$show_nav       = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_show_nav', true ) );
$picker_method  = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_method', true ) );
$offset         = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_offset', true ) );
$exclude        = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_exclude', true ) );
$blog_perpage   = $blog_perpage != '' ? $blog_perpage : get_option( 'posts_per_page' );

// Define Animations
$anim = $blog_layout == 'masonry' ? 'anim-grid' : '';

// Now, let's query for blog posts
global $paged;
$page_var = is_front_page() ? 'page' : 'paged';
$paged = (get_query_var($page_var)) ? get_query_var($page_var) : 1;
$offset = $paged == 1 ? $offset : ( $offset + ( $paged - 1 ) * $blog_perpage );
$args = array(
    'post_type' =>  'post',
    'posts_per_page' => $blog_perpage,
    'paged' => $paged,
    'offset' => $offset,
    'post__not_in' => explode( ',', $exclude )
 );

// Modify Query depending on the selected Show Method
if ( $picker_method == 'tax' ) {
    // Bring Selected Categories
    $sel_terms = esc_attr( get_post_meta( $mod_id, 'quadro_mod_blog_terms', true ) );
    if ( $sel_terms != '' ) {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
}
elseif ( $picker_method == 'format' ) {
    // Bring selected post formats
    $args = quadro_add_selected_formats( $mod_id, 'quadro_mod_blog_formats', $args );
}
elseif ( $picker_method == 'custom' ) {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts( $mod_id, 'quadro_mod_pick_blog', $args );
}

$wp_query = new WP_Query( $args );
?>

<section id="post-<?php the_ID(); ?>" class="quadro-mod type-blog clear blog-style-<?php echo $blog_layout; ?> masonry-margins-<?php echo $blog_margins; ?> <?php quadro_mod_parallax($mod_id); ?>">

    <?php // Apply function for inline styles
    quadro_mod_styles( $mod_id ); ?>

    <div class="inner-mod">

        <?php quadro_mod_title( $mod_id ); ?>
        <?php quadro_module_content(); ?>

        <?php if( $wp_query->have_posts() ) : ?>

            <div class="blog-wrapper">

                <div id="grid" class="<?php echo $anim; ?> anim-<?php echo $blog_anim; ?> blog-container blog-content blog-<?php echo $blog_layout; ?> blog-columns-<?php echo $blog_columns; ?>">

                    <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>

                        <?php // Define template part to be called for posts content
                        if ( $blog_layout != 'masonry' ) {
                            get_template_part( 'content', $blog_layout );
                        }
                        else {
                            // We call the template part with include to facilitate the use of data.
                            include( locate_template('content.php') );
                        } ?>

                    <?php endwhile; ?>

                </div>

                <?php if ( $show_nav == 'show' ) quadro_paging_nav( '<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>' ); ?>

            </div>

        <?php else : ?>

                <?php get_template_part( 'no-results', 'index' ); ?>

        <?php endif; // ends 'posts' loop ?>

        <?php wp_reset_postdata(); ?>

    </div>

</section>

Polylang for Formidable Pro

When activating the addon for Formidable Pro and going to the "translate form" overview, I'm getting these errors:

[13-May-2016 13:14:29 UTC] PHP Warning: Illegal string offset 'slug' in ...\wp-includes\functions.php on line 3463

[13-May-2016 13:14:29 UTC] PHP Warning: Illegal string offset 'name' in ...\wp-includes\functions.php on line 3463

From the string translations view, the overview looks fine.

Switching the admin language filter can override the static front page settings

Steps to reproduce:

  1. Set up a page in german (home de), meant to be frontpage
  2. Set up a page in english (home en), meant to be frontpage as well, connected to the german page
  3. Publish german front page - not publishing english front page (there are no other published english pages yet)
  4. Go to settings -> reading ("All languages" are selected), define "home de" as static front page

=> everything good so far, front page works as expected

  1. On settings -> reading switch from "All languages" to "english"

=> front page settings are overwritten immediately without asking or saving, no page is selectable (since there is no published english page)

  1. On settings -> reading switch from "english" to "All languages" (or "german") - my previously defined home de is no longer the front page (this step is not necessary, but it shows that the saved value for front page is overwritten by switching to a language which has no published pages so far).

Compatibility with siteorigin page builder

Hi! Thank you for really awesome work on this plugin.

After last update of pagebuilder by siteorigin there is some conflict when using custom posts. I have registered custom post galleries and all works well before last pagebuilder update. Now all custom post singles returns 404 error. Disabling polylang or reverting changes in pagebuilder to previous version and saving permalinks structure resolves problem. I'm using following permalinks structure: /%category%/%post_name%/

Here is respective issue on pagebuilder github:
siteorigin/siteorigin-panels#258

Polylang does not work with Jetpack CPT

Hi,
I'm building a site with three languages and using Jetpack's portfolio feature. It seems that Polylang doesn't work with Jetpack custom post types (portfolio). It seems strange since it's such a widely used plugin. I'm not sure if this is an issue or regular support. Jetpack's team seems to think it is an issue with Polylang.

Language switcher - home page link instead of post type archive link

On archive pages, when there are no posts in the given language, then the language switcher returns the links to the home page instead of post type archive links.

Example:

  • There's a product post type
  • There are 2 languages defined: EN and ES
  • There are some posts of a product type in the EN language but no posts in the ES language
  • We are on the /en/product/ page
  • For the EN language the language switcher shows the correct url (/en/product/)
  • For the ES language the language switcher shows the ES home page URL

IMO it's a bug. Even when there's no post in a given language then the language switcher should still return a link to the post type archive (or it should be configurable in the plugin's options).

So in the given example the language switcher should show the /es/product/ URL instead of the home url.

get_home_url returns default domain regardless of language

Issue for #55

We have defined different subdomains per language.

get_home_url() always returns the URL of the default site.

This affects get_rest_url() in WP core and The_Neverending_Home_Page::ajax_url() from jetpack.

As I was looking at the source code of the page I saw that the <link rel="next" href="http://magazine.example.ch/page/2/" /> is linking to the default language URL.

I think we should change the URL at the source instead of having to change the URL for every plugin.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.