Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
MSF
/
msf-climate-hub
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e545bf88
authored
2023-10-04 17:24:08 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
wpml
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
0bdbeed5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
wp-content/themes/msf-child/inc/search-extras.php
wp-content/themes/msf-child/inc/search-extras.php
View file @
e545bf8
...
...
@@ -48,13 +48,23 @@ add_action( 'init' , 'wptp_add_tags_to_attachments' );
add_action
(
'init'
,
'set_exclude_from_search'
);
function
set_exclude_from_search
()
{
if
(
$_GET
[
'var'
]
==
'set_
exclude
_from_search'
)
{
if
(
$_GET
[
'var'
]
==
'set_
wpml
_from_search'
)
{
global
$post
;
$args
=
array
(
'posts_per_page'
=>
-
1
,
'post_status'
=>
'publish'
,
'post_type'
=>
'page
'
);
$args
=
array
(
'posts_per_page'
=>
-
1
,
'post_type'
=>
'documents
'
);
$pages
=
get_posts
(
$args
);
error_log
(
print_r
(
$pages
,
true
));
foreach
(
$pages
as
$page
){
update_post_meta
(
$page
->
ID
,
'exclude_from_search'
,
0
);
error_log
(
$page
->
ID
);
update_post_meta
(
$page
->
ID
,
'wpml'
,
"EN"
);
}
$args
=
array
(
'posts_per_page'
=>
-
1
,
'post_type'
=>
'attachment'
);
$pages
=
get_posts
(
$args
);
error_log
(
print_r
(
$pages
,
true
));
foreach
(
$pages
as
$page
){
error_log
(
$page
->
ID
);
update_post_meta
(
$page
->
ID
,
'wpml'
,
"EN"
);
}
}
}
...
...
Please
register
or
sign in
to post a comment