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
8a614988
authored
2023-09-01 18:47:54 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
set_exclude_from_search
Signed-off-by: Jeff <jeff@gotenzing.com>
1 parent
fb5a1a18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
wp-content/themes/msf-child/inc/search-extras.php
wp-content/themes/msf-child/inc/search-extras.php
View file @
8a61498
...
...
@@ -42,3 +42,19 @@ function wptp_add_tags_to_attachments() {
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'
)
{
global
$post
;
$args
=
array
(
'posts_per_page'
=>
-
1
,
'post_status'
=>
'publish'
,
'post_type'
=>
'page'
);
$pages
=
get_posts
(
$args
);
foreach
(
$pages
as
$page
){
update_post_meta
(
$page
->
ID
,
'exclude_from_search'
,
0
);
}
}
}
...
...
Please
register
or
sign in
to post a comment