Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
NAP-wordpress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marwa Sfari
NAP-wordpress
Commits
ed7ea849
Commit
ed7ea849
authored
Aug 28, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update]Show userLogin if empty name
parent
2549582a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
functions.php
wp-content/themes/nap/functions.php
+18
-14
No files found.
wp-content/themes/nap/functions.php
View file @
ed7ea849
...
...
@@ -431,7 +431,7 @@ function nap_filter_attribute($id, $args, $options, $list_attr, $search) {
if
(
(
(
$list_couleur
&&
in_array
(
$list_attr
[
'pa_couleur'
],
$list_couleur
))
||
empty
(
$list_couleur
)
)
&&
(
(
$list_format
&&
in_array
(
$list_attr
[
'pa_format'
],
$list_format
))
||
empty
(
$list_format
)
)
&&
(
(
$list_univers
&&
in_array
(
$list_attr
[
'pa_univers'
],
$list_univers
))
||
empty
(
$list_univers
)
)
&&
(
(
$list_univers
&&
in_array
(
$list_attr
[
'pa_univers'
],
$list_univers
))
||
empty
(
$list_univers
)
)
&&
(
(
$list_matiere
&&
in_array
(
$list_attr
[
'pa_matiere'
],
$list_matiere
))
||
empty
(
$list_matiere
)
)
)
{
...
...
@@ -680,7 +680,11 @@ function get_logged_user() {
if
(
is_user_logged_in
())
{
global
$current_user
;
get_currentuserinfo
();
echo
$current_user
->
user_lastname
.
' '
.
$current_user
->
user_firstname
;
if
(
$current_user
->
user_lastname
||
$current_user
->
user_firstname
){
echo
$current_user
->
user_lastname
.
' '
.
$current_user
->
user_firstname
;
}
else
{
echo
$current_user
->
user_login
;
}
echo
'<span class = "logout"><a href="'
.
wp_logout_url
(
home_url
()
)
.
'">déconnexion</a></span>'
;
}
else
{
echo
'<a class="login" href="#">accès pro</a>'
;
...
...
@@ -741,18 +745,18 @@ function nap_trash_fiche_technique($post_id) {
add_action
(
'pre_get_posts'
,
'nap_change_filter_post'
);
function
nap_change_filter_post
()
{
global
$wp_query
;
if
(
is_admin
())
{
if
(
!
empty
(
$wp_query
->
query_vars
[
'product_cat'
]))
{
setcookie
(
"product_cat"
,
$wp_query
->
query_vars
[
'product_cat'
]);
}
if
(
!
isset
(
$_GET
[
'product_cat'
])
&&
(
$_GET
[
'post_type'
]
==
'product'
))
{
$wp_query
->
query_vars
[
'product_cat'
]
=
$_COOKIE
[
'product_cat'
];
}
elseif
(
isset
(
$_GET
[
'product_cat'
])
&&
empty
(
$_GET
[
'product_cat'
]))
{
setcookie
(
"product_cat"
,
$wp_query
->
query_vars
[
'product_cat'
]);
}
}
global
$wp_query
;
if
(
is_admin
())
{
if
(
!
empty
(
$wp_query
->
query_vars
[
'product_cat'
]))
{
setcookie
(
"product_cat"
,
$wp_query
->
query_vars
[
'product_cat'
]);
}
if
(
!
isset
(
$_GET
[
'product_cat'
])
&&
(
$_GET
[
'post_type'
]
==
'product'
))
{
$wp_query
->
query_vars
[
'product_cat'
]
=
$_COOKIE
[
'product_cat'
];
}
elseif
(
isset
(
$_GET
[
'product_cat'
])
&&
empty
(
$_GET
[
'product_cat'
]))
{
setcookie
(
"product_cat"
,
$wp_query
->
query_vars
[
'product_cat'
]);
}
}
}
function
nap_show_associated_products
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment