';
echo '
';
echo '';
echo wp_kses( self::heading_svg(), self::heading_svg_allowed_html() );
echo '';
echo '';
echo esc_html__( '4WP FAQ', '4wp-faq' );
echo '';
echo '
';
echo '';
echo '';
}
/**
* @param string $hook_suffix Current admin page.
*/
public static function enqueue_admin_assets( $hook_suffix ) {
if ( ! self::is_settings_screen( $hook_suffix ) ) {
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
$asset_file = FORWP_FAQ_PLUGIN_DIR . 'build/admin/index.asset.php';
if ( ! is_readable( $asset_file ) ) {
return;
}
$asset = include $asset_file;
wp_enqueue_style( 'wp-components' );
$style_path = FORWP_FAQ_PLUGIN_DIR . 'build/admin/style-index.css';
if ( is_readable( $style_path ) ) {
wp_enqueue_style(
'forwp-faq-admin',
FORWP_FAQ_PLUGIN_URL . 'build/admin/style-index.css',
[ 'wp-components' ],
$asset['version']
);
}
wp_enqueue_script(
'forwp-faq-admin',
FORWP_FAQ_PLUGIN_URL . 'build/admin/index.js',
$asset['dependencies'],
$asset['version'],
true
);
wp_set_script_translations( 'forwp-faq-admin', '4wp-faq' );
wp_localize_script(
'forwp-faq-admin',
'forwpFaqAdmin',
[
'restRoot' => esc_url_raw( rest_url() ),
'nonce' => wp_create_nonce( 'wp_rest' ),
]
);
}
/**
* Allowed tags for the static admin heading icon SVG.
*
* @return array>
*/
private static function heading_svg_allowed_html() {
return [
'svg' => [
'xmlns' => true,
'viewbox' => true,
'width' => true,
'height' => true,
'fill' => true,
'aria-hidden' => true,
],
'path' => [
'd' => true,
'fill' => true,
],
];
}
/**
* @return string
*/
private static function heading_svg() {
return '';
}
}