• the plugin wont work with WPML for non english pages.

    you can fix it by changing the file
    pages-children.php line 454 to 463 method PagesChildren::page_row_actions_filter

    if ($this->check_page())
    				{
                        $lang = isset($_GET['lang']) ? '&lang=' . $_GET['lang'] : '';
    				    if ( version_compare( $wp_version, '2.9.999', '>' ) )
    						$actions['pages-children'] = '<a class="pages-children" href="edit.php?post_type='. $_GET['post_type'] .'&post_parent='.
    							$post->ID . $lang .'">'. __('View Sub-'. $this->object_post_taxonomy->labels->name, PAGES_CHILDREN_I18N_DOMAIN). '</a>';
    					else
    						$actions['pages-children'] = '<a class="pages-children" href="edit-pages.php?post_type='.$_GET['post_type'].'&post_parent='.
    							$post->ID . $lang .'">'. __('View Sub-'. $this->object_post_taxonomy->labels->name, PAGES_CHILDREN_I18N_DOMAIN) .'</a>';
    				}

    https://www.ads-software.com/plugins/pages-children/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter museless

    (@museless)

    ps, you will probably want to include other parameters, this is a harcoded way to add the lang parameter, other plugins may use other get variables you should take care of that in a better way.

    Thread Starter museless

    (@museless)

    also this on line 284 method get_post_parent_query_string
    It will allow you to swich the language while a filter is applied, and still show the child posts of the translated post filter.

    if (isset($_GET['post_parent']))
    				$retv = intval($_GET['post_parent']);
    			else if (isset($_COOKIE['pages-children-'. $_GET['post_type'] .'-parent-id']))
    				$retv = intval($_COOKIE['pages-children-'. $_GET['post_type'] .'-parent-id']);
    			else
    				$retv = 0;
    
                if (function_exists('icl_object_id')) {
                    $xlat = icl_object_id($retv, $_GET['post_type'], isset($_GET['lang']) ? $_GET['lang'] : null);
                }
                return $xlat;
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WPML fix’ is closed to new replies.