actions.php ➔ s214_settings_demo_thanks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 2
rs 9.4285
1
<?php
2
/**
3
 * Handle actions
4
 *
5
 * @package     S214_Settings_Demo\Actions
6
 * @since       1.0.0
7
 */
8
9
// Exit if accessed directly
10
if( ! defined( 'ABSPATH' ) ) {
11
	exit;
12
}
13
14
15
/**
16
 * Hooked function for the 'hook' field type demo
17
 *
18
 * @since       1.0.0
19
 * @return      void
20
 */
21
function s214_settings_demo_thanks() {
22
	$html  = '<p>' . sprintf( __( 'The S214 Settings library is significantly inspired by and based on the awesome word done by %s and the team from %s, so we owe them a <strong>huge</strong> thank you!', 's214-settings-demo' ), '<a href="http://pippinsplugins.com" target="_blank">Pippin Williamson</a>', '<a href="https://easydigitaldownloads.com">Easy Digital Downloads</a>' ) . '</p>';
23
	$html .= '<hr />';
24
	$html .= '<p>' . sprintf( __( 'By the way, even though this <em>looks</em> like a %s field, it\'s actually an example of a \'hook\' field. It is created by attaching an action to the hook %s (in our case, %s).', 's214-settings-demo' ), '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#descriptive_text-implements-a-descriptive-text-field" target="_blank"><code>descriptive_text</code></a>', '<a href="https://github.com/Section214/S214-Settings/wiki/Settings-Reference#hook-implements-a-custom-field-through-a-wordpress-action" target="_blank">hook</a>', '<code>{your_plugin}_{field_id}</code>', '<code>s214_settings_demo_thanks</code>' ) . '</p>';
25
	$html .= '<p>' . sprintf( __( 'You\'ll also note that this tab doesn\'t have a save button. This is achieved by filtering %s, and adding the slug of the tab to the returned array.', 's214-settings-demo' ), '<code>{your_plugin}_unsavable_tabs</code>' ) . '</p>';
26
27
	echo $html;
28
}
29
add_action( 's214_settings_demo_thanks', 's214_settings_demo_thanks' );
30