Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed reference errors for PHP7.1 in frontend #581

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,5 @@ tx
#Convenience
*.min-orig.js
admin/js/obsolete/*

/vendor/
18 changes: 18 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "appristas/qtranslate-x",
"version": "3.4.8",
"description": "Dynamic multilingual plugin for Wordpress",
"type": "wordpress-plugin",
"license": "GPL-3.0-or-later",
"homepage": "https://wordpress.org/plugins/qtranslate-x/",
"authors": [
{
"name": "Gasim Gasimzada",
"email": "[email protected]"
},
{
"name": "johnclause"
}
],
"require": {}
}
16 changes: 8 additions & 8 deletions qtranslate_frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function qtranxf_wp_get_nav_menu_items( $items, $menu, $args ){
}
add_filter( 'wp_get_nav_menu_items', 'qtranxf_wp_get_nav_menu_items', 20, 3 );

function qtranxf_add_language_menu_item(&$items, &$menu_order, &$itemid, $key, $language ) {
function qtranxf_add_language_menu_item($items, $menu_order, $itemid, $key, $language ) {
global $q_config;
//qtranxf_dbg_log('qtranxf_add_language_menu_item: $key: ',$key);
$item = $items[$key];
Expand Down Expand Up @@ -333,7 +333,7 @@ function qtranxf_add_language_menu_item(&$items, &$menu_order, &$itemid, $key, $
}
}

function qtranxf_remove_detached_children(&$items,&$itemsremoved)
function qtranxf_remove_detached_children($items,$itemsremoved)
{
do{
$more=false;
Expand Down Expand Up @@ -519,7 +519,7 @@ function qtranxf_translate_post($post,$lang) {
}
}

function qtranxf_postsFilter($posts,&$query) {//WP_Query
function qtranxf_postsFilter($posts,$query) {//WP_Query
global $q_config;
//qtranxf_dbg_log('qtranxf_postsFilter: $posts: ',$posts);
//$post->post_content = qtranxf_useCurrentLanguageIfNotFoundShowAvailable($post->post_content);
Expand All @@ -542,7 +542,7 @@ function qtranxf_postsFilter($posts,&$query) {//WP_Query
add_filter('the_posts', 'qtranxf_postsFilter', 5, 2);

/** allow all filters within WP_Query - many other add_filters may not be needed now? */
function qtranxf_pre_get_posts( &$query ) {//WP_Query
function qtranxf_pre_get_posts( $query ) {//WP_Query
//qtranxf_dbg_log('qtranxf_pre_get_posts: $query: ',$query);
//'post_type'
if(isset($query->query_vars['post_type'])){
Expand Down Expand Up @@ -593,7 +593,7 @@ function qtranxf_excludeUntranslatedAdjacentPosts($where) {
return $where;
}

function qtranxf_excludeUntranslatedPosts($where,&$query) {//WP_Query
function qtranxf_excludeUntranslatedPosts($where,$query) {//WP_Query
//qtranxf_dbg_log('qtranxf_excludeUntranslatedPosts: post_type: ',$query->query_vars['post_type']);
switch($query->query_vars['post_type']){
//known not to filter
Expand Down Expand Up @@ -625,7 +625,7 @@ function qtranxf_excludeUntranslatedPosts($where,&$query) {//WP_Query
return $where;
}

function qtranxf_excludeUntranslatedPostComments($clauses, &$q/*WP_Comment_Query*/) {
function qtranxf_excludeUntranslatedPostComments($clauses, $q/*WP_Comment_Query*/) {
global $wpdb;

//qtranxf_dbg_log('qtranxf_excludeUntranslatedPostComments: $clauses: ',$clauses);
Expand Down Expand Up @@ -773,7 +773,7 @@ function qtranxf_translate_metadata($meta_type, $original_value, $object_id, $me

if(!isset($meta_cache_unserialized[$meta_type])) $meta_cache_unserialized[$meta_type] = array();
if(!isset($meta_cache_unserialized[$meta_type][$object_id])) $meta_cache_unserialized[$meta_type][$object_id] = array();
$meta_unserialized = &$meta_cache_unserialized[$meta_type][$object_id];
$meta_unserialized = $meta_cache_unserialized[$meta_type][$object_id];

if( !$meta_cache ){
if ( $meta_cache_wp ) {
Expand Down Expand Up @@ -846,7 +846,7 @@ function qtranxf_translate_metadata($meta_type, $original_value, $object_id, $me

if(isset($meta_cache[$meta_key])){
//cache unserialized values, just for the sake of performance.
$meta_key_unserialized = &$meta_unserialized[$meta_key];
$meta_key_unserialized = (isset($meta_unserialized[$meta_key])) ? $meta_unserialized[$meta_key] : array();
if($single){
if(!isset($meta_key_unserialized[0])) $meta_key_unserialized[0] = maybe_unserialize($meta_cache[$meta_key][0]);
}else{
Expand Down