Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
WordPress_SexHackMe_Plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
WordPress_SexHackMe_Plugin
Commits
295f0294
Commit
295f0294
authored
Jul 03, 2023
by
Franco (nextime) Lanza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add include page shortcode
parent
fbf70d5a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
class-shortcodes.php
includes/class-shortcodes.php
+17
-0
No files found.
includes/class-shortcodes.php
View file @
295f0294
...
...
@@ -41,6 +41,7 @@ if(!class_exists('SH_Shortcodes')) {
'sexadv'
=>
__CLASS__
.
'::adv_shortcode'
,
'sexgallery'
=>
__CLASS__
.
'::videogallery_shortcode'
,
'shvideomanager'
=>
__CLASS__
.
'::video_manager_shortcode'
,
'shincludepage'
=>
__CLASS__
.
'::include_page_shortcode'
,
);
foreach
(
$shortcodes
as
$shortcode_tag
=>
$shortcode_func
)
{
...
...
@@ -171,6 +172,22 @@ if(!class_exists('SH_Shortcodes')) {
return
;
}
public
static
function
include_page_shortcode
(
$attr
,
$cont
)
{
extract
(
shortcode_atts
(
array
(
"page"
=>
''
,
'level'
=>
'public'
,
),
$attr
));
if
((
$attr
[
'level'
]
==
'guestonly'
&&
!
is_user_logged_in
())
||
(
$attr
[
'level'
]
==
'public'
or
!
$attr
[
'level'
])
||
(
is_user_logged_in
()
&&
(
$attr
[
'level'
]
==
'members'
||
(
$attr
[
'level'
]
==
'premium'
&&
user_is_premium
()))))
{
$ipost
=
get_post
(
$attr
[
'page'
]);
if
(
$ipost
)
{
return
$ipost
->
post_content
;
}
}
return
;
}
}
}
...
...
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