-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshortcodes.php
83 lines (61 loc) · 1.77 KB
/
shortcodes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* Registers UniPress API shortcodes
*
* @package UniPress API
* @since 1.0.0
*/
if ( !function_exists( 'do_unipress_show_content' ) ) {
/**
* Shortcode for UniPress to hide content that you don't want to show on the app
*
* @since 1.0.0
*/
function unipress_show_content( $atts, $content=null ) {
if ( !empty( $_GET['unipress-api'] ) ) {
return do_shortcode( $content );
}
return '';
}
add_shortcode( 'unipress_show_content', 'unipress_show_content' );
add_shortcode( 'unipress-show-content', 'unipress_show_content' );
}
if ( !function_exists( 'do_unipress_hide_content' ) ) {
/**
* Shortcode for UniPress to hide content that you don't want to show on the app
*
* @since 1.0.0
*/
function do_unipress_hide_content( $atts, $content=null ) {
if ( !empty( $_GET['unipress-api'] ) ) {
return '';
}
return do_shortcode( $content );
}
add_shortcode( 'unipress_hide_content', 'do_unipress_hide_content' );
add_shortcode( 'unipress-hide-content', 'do_unipress_hide_content' );
}
if ( !function_exists( 'do_unipress_image' ) ) {
/**
* Shortcode for UniPress to help the mobile app in determining the header image
*
* @since 1.0.0
*/
function do_unipress_image( $atts ) {
return '<div id="unipress-image"></div>';
}
add_shortcode( 'unipress_image', 'do_unipress_image' );
add_shortcode( 'unipress-image', 'do_unipress_image' );
}
if ( !function_exists( 'do_unipress_video' ) ) {
/**
* Shortcode for UniPress to help the mobile app in determining the header video
*
* @since 1.0.0
*/
function do_unipress_video( $atts ) {
return '<div id="unipress-video"></div>';
}
add_shortcode( 'unipress_video', 'do_unipress_video' );
add_shortcode( 'unipress-video', 'do_unipress_video' );
}