-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinfo-page.php
56 lines (50 loc) · 1.6 KB
/
info-page.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
<?php
/**
* The informational page for this plugin.
*
* This is available to everyone who can edit posts, because they'll need this info if they're creating new child pages for embed using the shortcode or plugin.
*
* @package pym-embeds
*/
namespace INN\PymEmbeds\Info;
/**
* Create the option page
*
* @since 1.3.2.1
*/
function register_options_page() {
add_submenu_page(
'tools.php',
__( 'Pym.js Embeds Plugin Information', 'pym-embeds' ), // title of page
__( 'Pym.js Embeds Info', 'pym-embeds' ), // menu text
'edit_posts', // capability required
'pym-embeds-info', // menu slug
__NAMESPACE__ . '\options_page_callback' // callback for options page display
);
}
add_action( 'admin_menu', __NAMESPACE__ . '\register_options_page' );
/**
* Options page display callback
*
* @since 1.3.2.1
* @link https://developer.wordpress.org/plugins/settings/custom-settings-page/
*/
function options_page_callback() {
printf(
'<h1>%1$s</h1>',
esc_html( get_admin_page_title() )
);
printf(
'<p>%1$s</p>',
wp_kses_post( __( 'For information on how to use the block and shortcode provided by the Pym.js Embeds plugin, read the plugin\'s documentation <a href="https://github.com/INN/pym-shortcode/tree/master/docs">on GitHub</a>.', 'pym-embeds' ) )
);
printf(
'<label for="local_url">%1$s</label>',
esc_html__( 'The URL for the copy of Pym.js hosted on this site is:', 'pym-embeds' )
);
// copying how qz.com does their share links
printf(
'<input id="local_url" type="text" readonly value="%1$s" style="clear:both; width: 100%%; display: block;"/>',
esc_attr( pym_pymsrc_local_url() )
);
}