-
Notifications
You must be signed in to change notification settings - Fork 0
/
trestle-default-settings.php
58 lines (52 loc) · 1.35 KB
/
trestle-default-settings.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
<?php
/*
Plugin Name: Trestle Default Settings
Description: Alters WordPress settings and defines custom functions. For use with <a href="https://github.com/jspellman814/trestle-theme-wp">trestle-theme-wp</a>.
Version: 1.0
Author: TrestleMedia
Author URI: https://trestlemedia.com
*/
if (!defined('ABSPATH')) {
exit;
} // Exit if accessed directly
/**
* Disable theme file editor
*/
if (!defined('DISALLOW_FILE_EDIT')) {
define('DISALLOW_FILE_EDIT', true);
}
/**
* Registers an editor stylesheet for the theme.
*/
add_action('admin_init', 'custom_add_editor_styles');
function custom_add_editor_styles()
{
add_editor_style('editor-style.css');
}
/**
* Set Yoast meta box priority as low, after custom fields
**/
add_filter('wpseo_metabox_prio', 'yoasttobottom');
function yoasttobottom()
{
return 'low';
}
/**
* Check if post content is empty
* http://blog.room34.com/archives/5360
*/
function empty_content($str)
{
return trim(str_replace(' ', '', strip_tags($str))) == '';
}
/**
* Filter the "read more" excerpt string link to the post.
*
* @param string $more "Read more" excerpt string.
* @return string (Maybe) modified "read more" excerpt string.
*/
add_filter('excerpt_more', 'tm_excerpt_more');
function tm_excerpt_more($more)
{
return ' <a class="more-link" href="' . get_the_permalink() . '" rel="nofollow">MORE</a>';
}