-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfunctions.php
75 lines (56 loc) · 2.17 KB
/
functions.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
<?php
//remove_filter( 'the_content', 'wpautop' );
// custom admin style sheet
function my_admin_head() {
echo '<link href="'.get_stylesheet_directory_uri().'/wp-admin.css" rel="stylesheet" type="text/css">';
}
add_action('admin_head', 'my_admin_head');
// Admin always in english
add_filter('locale', 'wpse27056_setLocale');
function wpse27056_setLocale($locale) {
if ( is_admin() ) {
return 'en_US';
}
return $locale;
}
// Add Options Page
if( function_exists('acf_add_options_page') ) {
acf_add_options_page();
acf_add_options_sub_page('Video');
acf_add_options_sub_page('Text');
acf_add_options_sub_page('Downloads');
}
// Dashboard help
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'Documentation', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '<p>
<ul class="help">
<li>Original video files are available <a href="https://box.wolan.net/cc_videos">here</a>.<br>You may update the videos with any video uploaded to YouTube, but the link as to be similar in structure to this one: <a href="https://www.youtube.com/watch?v=iYbLg_KROJ0" target="_blank">https://www.youtube.com/watch?v=iYbLg_KROJ0</a>. <br>Short or custom links, and embeds are not supported.</li>
</ul>
</p>';
}
// Drag and Drog helper text
add_action('admin_footer', 'drag_help');
function drag_help()
{
$uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ;
$message = NULL;
if ($uri AND strpos($uri,'edit.php'))
{
$message = "To reorder item's positions you can drag and drop between them.";
}
if ($message)
{
?><script>
jQuery(function($)
{
$('<div style="margin-bottom:15px; color:#999;"></div>').text('<?php echo $message; ?>').insertAfter('#wpbody-content .wrap h2:eq(0)');
});
</script><?php
}
}
?>