Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apex_micro_site
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Ali Arshad
apex_micro_site
Commits
259dd1f5
Commit
259dd1f5
authored
Jan 19, 2018
by
Muhammad Usman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
navigation and short shortbanner shortcode
parent
fc82e69b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
functions.php
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
+43
-0
No files found.
WWW_DATA/wp-content/plugins/apex_global_lms/functions.php
View file @
259dd1f5
...
...
@@ -5,6 +5,12 @@ add_action('init', 'vq_apex_custom_posts');
add_action
(
'init'
,
'vq_apex_custom_taxonomies'
);
add_shortcode
(
'vq_short_banner'
,
'vq_render_short_banner'
);
add_action
(
'add_meta_boxes'
,
'vq_add_custom_meta_boxes'
,
10
,
2
);
add_filter
(
'wp_nav_menu_items'
,
'vq_add_lms_navigation'
,
10
,
2
);
function
vq_apex_custom_posts
()
{
$labels
=
array
(
...
...
@@ -61,3 +67,39 @@ function vq_apex_custom_taxonomies() {
)
);
}
function
vq_render_short_banner
(
$attr
)
{
$bgColor
=
isset
(
$attr
[
'bgClr'
])
?
attr
[
'bgClr'
]
:
"#000"
;
$btnBg
=
isset
(
$attr
[
'btnBg'
])
?
attr
[
'btnBg'
]
:
"#00f"
;
$txt
=
isset
(
$attr
[
'txt'
])
?
attr
[
'txt'
]
:
"Heading"
;
$txtClr
=
isset
(
$attr
[
'txtClr'
])
?
attr
[
'txtClr'
]
:
"#fff"
;
$btnClr
=
isset
(
$attr
[
'btnClr'
])
?
attr
[
'btnClr'
]
:
"#fff"
;
$btnLink
=
isset
(
$attr
[
'btnLink'
])
?
$attr
[
'btnLink'
]
:
'https://google.com'
;
$btnTxt
=
isset
(
$attr
[
'btnTxt'
])
?
$attr
[
'btnTxt'
]
:
'Click Here'
;
$a
=
shortcode_atts
(
array
(
'foo'
=>
'something'
,
'bar'
=>
'something else'
,
),
$attr
);
}
function
vq_add_custom_meta_boxes
()
{
add_meta_box
(
'vq_short_banner_shortcode_metabox'
,
'Short Banner Shortcode'
,
'vq_render_short_banner_shortcode_metabox'
,
'vq_course'
,
'side'
,
'high'
);
}
function
vq_render_short_banner_shortcode_metabox
()
{
echo
'[vq_short_banner bgClr="" btnBg="" txt="" txtClr="" btnClr="" btnLink="" btnTxt=""]'
;
}
function
vq_add_lms_navigation
(
$items
,
$args
)
{
$items
.=
'<li id="menu-item-786" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-786"><a href="">E-Learning</a></li>'
;
return
$items
;
}
\ No newline at end of file
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