/var/www/hkosl.com/aga/wp-content/plugins/wordpress-seo/inc/wpseo-non-ajax-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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
/**
 * WPSEO plugin file.
 *
 * @package WPSEO\Internals
 */

if ( ! defined'WPSEO_VERSION' ) ) {
    
header'Status: 403 Forbidden' );
    
header'HTTP/1.1 403 Forbidden' );
    exit();
}

/**
 * Initializes the admin bar.
 *
 * @return void
 */
function wpseo_initialize_admin_bar() {
    
$admin_bar_menu = new WPSEO_Admin_Bar_Menu();
    
$admin_bar_menu->register_hooks();
}
add_action'wp_loaded''wpseo_initialize_admin_bar' );

/**
 * Allows editing of the meta fields through weblog editors like Marsedit.
 *
 * @param array $required_capabilities Capabilities that must all be true to allow action.
 * @param array $capabilities          Array of capabilities to be checked, unused here.
 * @param array $args                  List of arguments for the specific capabilities to be checked.
 *
 * @return array $required_capabilities Filtered capabilities.
 */
function allow_custom_field_edits$required_capabilities$capabilities$args ) {
    if ( ! 
in_array$args[0], array( 'edit_post_meta''add_post_meta' ), true ) ) {
        return 
$required_capabilities;
    }

    
// If this is provided, it is the post ID.
    
if ( empty( $args[2] ) ) {
        return 
$required_capabilities;
    }

    
// If this is provided, it is the custom field.
    
if ( empty( $args[3] ) ) {
        return 
$required_capabilities;
    }

    
// If the meta key is part of the plugin, grant capabilities accordingly.
    
if ( strpos$args[3], WPSEO_Meta::$meta_prefix ) === && current_user_can'edit_post'$args[2] ) ) {
        
$required_capabilities$args[0] ] = true;
    }

    return 
$required_capabilities;
}

add_filter'user_has_cap''allow_custom_field_edits'0);

/* ********************* DEPRECATED FUNCTIONS ********************* */

/**
 * Adds an SEO admin bar menu to the site admin, with several options.
 *
 * If the current user is an admin they can also go straight to several settings menus from here.
 *
 * @deprecated 7.9 Use WPSEO_Admin_Bar_Menu::add_menu() instead.
 * @codeCoverageIgnore
 *
 * @return void
 */
function wpseo_admin_bar_menu() {

    
_deprecated_function__FUNCTION__'WPSEO 7.9''WPSEO_Admin_Bar_Menu::add_menu()' );

    
// Only use this admin bar menu for the site admin.
    
if ( is_admin() && ! is_blog_admin() ) {
        return;
    }

    
$options WPSEO_Options::get_options( array( 'wpseo''wpseo_ms' ) );

    if ( 
$options['enable_admin_bar_menu'] !== true ) {
        return;
    }

    global 
$wp_admin_bar;

    
$admin_bar_menu = new WPSEO_Admin_Bar_Menu();
    
$admin_bar_menu->add_menu$wp_admin_bar );
}

/**
 * Returns the SEO score element for the admin bar.
 *
 * @deprecated 7.9
 * @codeCoverageIgnore
 *
 * @return string
 */
function wpseo_adminbar_seo_score() {
    
_deprecated_function__FUNCTION__'WPSEO 7.9'null );

    
$rating WPSEO_Meta::get_value'linkdex'get_the_ID() );

    return 
wpseo_adminbar_score$rating );
}

/**
 * Returns the content score element for the adminbar.
 *
 * @deprecated 7.9
 * @codeCoverageIgnore
 *
 * @return string
 */
function wpseo_adminbar_content_score() {
    
_deprecated_function__FUNCTION__'WPSEO 7.9'null );

    
$rating WPSEO_Meta::get_value'content_score'get_the_ID() );

    return 
wpseo_adminbar_score$rating );
}

/**
 * Returns the SEO score element for the adminbar.
 *
 * @deprecated 7.9
 * @codeCoverageIgnore
 *
 * @return string
 */
function wpseo_tax_adminbar_seo_score() {
    
_deprecated_function__FUNCTION__'WPSEO 7.9'null );

    
$rating 0;

    if ( 
is_tax() || is_category() || is_tag() ) {
        
$rating WPSEO_Taxonomy_Meta::get_meta_without_term'linkdex' );
    }

    return 
wpseo_adminbar_score$rating );
}

/**
 * Returns the Content score element for the adminbar.
 *
 * @deprecated 7.9
 * @codeCoverageIgnore
 *
 * @return string
 */
function wpseo_tax_adminbar_content_score() {
    
_deprecated_function__FUNCTION__'WPSEO 7.9'null );

    
$rating 0;

    if ( 
is_tax() || is_category() || is_tag() ) {
        
$rating WPSEO_Taxonomy_Meta::get_meta_without_term'content_score' );
    }

    return 
wpseo_adminbar_score$rating );
}

/**
 * Takes The SEO score and makes the score icon for the adminbar with it.
 *
 * @deprecated 7.9
 * @codeCoverageIgnore
 *
 * @param int $score The 0-100 rating of the score. Can be either SEO score or content score.
 *
 * @return string $score_adminbar_element
 */
function wpseo_adminbar_score$score ) {
    
_deprecated_function__FUNCTION__'WPSEO 7.9'null );

    
$score WPSEO_Utils::translate_score$score );

    
$score_adminbar_element '<div class="wpseo-score-icon adminbar-seo-score ' $score '"><span class="adminbar-seo-score-text screen-reader-text"></span></div>';

    return 
$score_adminbar_element;
}

/**
 * Enqueue CSS to format the Yoast SEO adminbar item.
 *
 * @deprecated 7.9 Use WPSEO_Admin_Bar_Menu::enqueue_assets() instead.
 * @codeCoverageIgnore
 */
function wpseo_admin_bar_style() {
    
_deprecated_function__FUNCTION__'WPSEO 7.9''WPSEO_Admin_Bar_Menu::enqueue_assets()' );

    if ( ! 
is_admin_bar_showing() || WPSEO_Options::get'enable_admin_bar_menu' ) !== true ) {
        return;
    }

    if ( 
is_admin() && ! is_blog_admin() ) {
        return;
    }

    
$admin_bar_menu = new WPSEO_Admin_Bar_Menu();
    
$admin_bar_menu->enqueue_assets();
}

/**
 * Detects if the advanced settings are enabled.
 *
 * @deprecated 7.0
 * @codeCoverageIgnore
 */
function wpseo_advanced_settings_enabled() {
    
_deprecated_function__FUNCTION__'WPSEO 7.0'null );
}