PHP Class WPSEO_Admin, wordpress-seo

Show file Open project: yoast/wordpress-seo

Protected Properties

Property Type Description
$admin_features array Array of classes that add admin functionality

Public Methods

Method Description
__construct ( ) Class constructor
add_action_link ( array $links, string $file ) : array Add a link to the settings page to the plugins list
blog_public_warning ( ) Display an error message when the blog is set to private.
bulk_edit_options ( ) Adds the ability to choose how many posts are displayed per page on the bulk edit pages.
clear_cache ( ) Clears the cache
clear_rewrites ( ) Clear rewrites
config_page_scripts ( ) Enqueues the (tiny) global JS needed for the plugin.
enqueue_assets ( ) Register assets needed on admin pages
enqueue_global_style ( ) Enqueues the (tiny) global stylesheet needed for the plugin.
filter_settings_pages ( array $pages ) : array Filters all advanced settings pages from the given pages.
filter_stopwords_from_slug ( string $slug, string $post_title ) : string Filter the stopwords from the slug
get_admin_features ( ) : array Returns all the classes for the admin features
grant_access ( ) : boolean Check whether the current user is allowed to access the configuration.
import_plugin_hooks ( ) Setting the hooks for importing data from other plugins
load_page ( ) Load the form for a WPSEO admin page
maybe_upgrade ( ) Check whether the current user is allowed to access the configuration.
meta_description_warning ( ) Display an error message when the theme contains a meta description tag.
network_config_page ( ) Loads the form for the network configuration page.
options_init ( ) Register all the options needed for the configuration pages.
register_network_settings_page ( ) Register the settings page for the Network settings.
register_settings_page ( ) Register the menu item and its sub menu's.
remove_stopwords_from_slug ( string $slug ) : string Cleans stopwords out of the slug, if the slug hasn't been set yet.
save_bulk_edit_options ( integer $status, string $option, integer $value ) : integer Saves the posts per page limit for bulk edit pages.
schedule_rewrite_flush ( ) Schedules a rewrite flush to happen at shutdown
stopwords ( ) : array Returns the stopwords for the current language
stopwords_check ( string $haystack, boolean $checkingUrl = false ) : boolean | mixed Check whether the stopword appears in the string
switch_theme ( ) Log the updated timestamp for user profiles when theme is changed
title_metas_help_tab ( ) Adds contextual help to the titles & metas page.
update_contactmethods ( array $contactmethods ) : array Filter the $contactmethods array and add Facebook, Google+ and Twitter.

Protected Methods

Method Description
set_upsell_notice ( ) Sets the upsell notice.

Private Methods

Method Description
get_dismiss_url ( string $dismiss_param ) : string Extending the current page URL with two params to be able to ignore the notice.
get_manage_options_cap ( ) : mixed | void Returns the manage_options cap
get_premium_indicator ( ) : string
localize_admin_global_script ( ) : array Localization for the dismiss urls.

Method Details

__construct() public method

Class constructor
public __construct ( )

blog_public_warning() public method

Display an error message when the blog is set to private.
Deprecation: 3.3
public blog_public_warning ( )

bulk_edit_options() public method

Adds the ability to choose how many posts are displayed per page on the bulk edit pages.
public bulk_edit_options ( )

clear_cache() public method

Clears the cache
See also: WPSEO_Utils::clear_cache()
Deprecation: 1.5.0
Deprecation: use WPSEO_Utils::clear_cache()
public clear_cache ( )

clear_rewrites() public method

Clear rewrites
See also: WPSEO_Utils::clear_rewrites()
Deprecation: 1.5.0
Deprecation: use WPSEO_Utils::clear_rewrites()
public clear_rewrites ( )

config_page_scripts() public method

Enqueues the (tiny) global JS needed for the plugin.
public config_page_scripts ( )

enqueue_assets() public method

Register assets needed on admin pages
public enqueue_assets ( )

enqueue_global_style() public method

Enqueues the (tiny) global stylesheet needed for the plugin.

filter_settings_pages() public method

Filters all advanced settings pages from the given pages.
public filter_settings_pages ( array $pages ) : array
$pages array The pages to filter.
return array

filter_stopwords_from_slug() public method

Filter the stopwords from the slug
public filter_stopwords_from_slug ( string $slug, string $post_title ) : string
$slug string The current slug, if not empty there will be done nothing.
$post_title string The title which will be used in case of an empty slug.
return string

get_admin_features() public method

Returns all the classes for the admin features
public get_admin_features ( ) : array
return array

grant_access() public method

Check whether the current user is allowed to access the configuration.
See also: WPSEO_Utils::grant_access()
Deprecation: 1.5.0
Deprecation: use WPSEO_Utils::grant_access()
public grant_access ( ) : boolean
return boolean

import_plugin_hooks() public method

Setting the hooks for importing data from other plugins
public import_plugin_hooks ( )

load_page() public method

Load the form for a WPSEO admin page
public load_page ( )

maybe_upgrade() public method

Check whether the current user is allowed to access the configuration.
See also: WPSEO_Upgrade
Deprecation: 1.5.0
Deprecation: use wpseo_do_upgrade()
public maybe_upgrade ( )

meta_description_warning() public method

Display an error message when the theme contains a meta description tag.
Deprecation: 3.3
Since: 1.4.14

network_config_page() public method

Loads the form for the network configuration page.
public network_config_page ( )

options_init() public method

Register all the options needed for the configuration pages.
See also: WPSEO_Option::register_setting()
Deprecation: 1.5.0
Deprecation: use WPSEO_Option::register_setting() on each individual option
public options_init ( )

register_network_settings_page() public method

Register the settings page for the Network settings.

register_settings_page() public method

Register the menu item and its sub menu's.

remove_stopwords_from_slug() public method

Cleans stopwords out of the slug, if the slug hasn't been set yet.
Since: 1.1.7
public remove_stopwords_from_slug ( string $slug ) : string
$slug string if this isn't empty, the function will return an unaltered slug.
return string $clean_slug cleaned slug

save_bulk_edit_options() public method

Saves the posts per page limit for bulk edit pages.
public save_bulk_edit_options ( integer $status, string $option, integer $value ) : integer
$status integer Status value to pass through.
$option string Option name.
$value integer Count value to check.
return integer

schedule_rewrite_flush() public method

Schedules a rewrite flush to happen at shutdown

set_upsell_notice() protected method

Sets the upsell notice.
protected set_upsell_notice ( )

stopwords() public method

Returns the stopwords for the current language
Deprecation: 3.1 Use WPSEO_Admin_Stop_Words::list_stop_words() instead.
Since: 1.1.7
public stopwords ( ) : array
return array $stopwords array of stop words to check and / or remove from slug

stopwords_check() public method

Check whether the stopword appears in the string
Deprecation: 3.1
public stopwords_check ( string $haystack, boolean $checkingUrl = false ) : boolean | mixed
$haystack string The string to be checked for the stopword.
$checkingUrl boolean Whether or not we're checking a URL.
return boolean | mixed

switch_theme() public method

Log the updated timestamp for user profiles when theme is changed
public switch_theme ( )

title_metas_help_tab() public method

Adds contextual help to the titles & metas page.

update_contactmethods() public method

These are used with the Facebook author, rel="author" and Twitter cards implementation.
public update_contactmethods ( array $contactmethods ) : array
$contactmethods array currently set contactmethods.
return array $contactmethods with added contactmethods.

Property Details

$admin_features protected property

Array of classes that add admin functionality
protected array $admin_features
return array