PHP Class Twitter\WordPress\Admin\Settings\Cards\SiteAttribution

Since: 1.0.0
Inheritance: implements Twitter\WordPress\Admin\Settings\SettingsSection
Show file Open project: twitter/wordpress

Protected Properties

Property Type Description
$hook_suffix The hook suffix of the parent settings page

Public Methods

Method Description
addHelpTab ( WP_Screen $screen ) : void Display inline help content
addToSettingsPage ( string $hook_suffix ) : boolean Add site attribution option and settings section to an existing settings page
defineSection ( ) : void Define site attribution section and the fields within
displaySiteAttributionUsername ( ) : void Input a Twitter screen_name to attribute to site content
featureName ( ) : string Reference the feature by name
onload ( ) : void Set up settings section
sanitize ( string $screen_name ) : string Clean up user inputted Twitter username value before saving the option
sectionHeader ( ) : void Introduce the settings section

Method Details

addHelpTab() public static method

Display inline help content
Since: 1.0.0
public static addHelpTab ( WP_Screen $screen ) : void
$screen WP_Screen current screen
return void

addToSettingsPage() public static method

Add site attribution option and settings section to an existing settings page
Since: 1.0.0
public static addToSettingsPage ( string $hook_suffix ) : boolean
$hook_suffix string hook suffix of an existing settings page
return boolean site attribution settings loaded

defineSection() public method

Define site attribution section and the fields within
Since: 1.0.0
public defineSection ( ) : void
return void

displaySiteAttributionUsername() public method

Input a Twitter screen_name to attribute to site content
Since: 1.0.0

featureName() public static method

Reference the feature by name
Since: 1.0.0
public static featureName ( ) : string
return string translated feature name

onload() public method

Set up settings section
Since: 1.0.0
public onload ( ) : void
return void

sanitize() public static method

Clean up user inputted Twitter username value before saving the option
Since: 1.0.0
public static sanitize ( string $screen_name ) : string
$screen_name string inputted Twitter username value
return string sanitized Twitter username value

sectionHeader() public static method

Introduce the settings section
Since: 1.0.0
public static sectionHeader ( ) : void
return void

Property Details

$hook_suffix protected property

The hook suffix of the parent settings page
Since: 1.0.0
protected $hook_suffix