BSF_License_Manager::render_popup_form_markup()
Render the markup for popup form.
Description
Source
File: admin/bsf-core/class-bsf-license-manager.php
public function render_popup_form_markup() {
$current_screen = get_current_screen();
// Bail if not on plugins.php screen.
if ( ! is_object( $current_screen ) && null === $current_screen ) {
return;
}
if ( 'plugins' !== $current_screen->id && 'plugins-network' !== $current_screen->id ) {
return;
}
foreach ( self::$inline_form_products as $product_id => $product ) {
?>
<div plugin-slug="<?php echo esc_attr( $product_id ); ?>" class="bsf-core-license-form" style="display: none;">
<div class="bsf-core-license-form-overlay"></div>
<div class="bsf-core-license-form-inner">
<button type="button" class="bsf-core-license-form-close-btn">
<span class="screen-reader-text"><?php esc_html_e( 'Close', 'bsf-core' ); ?></span>
<span class="dashicons dashicons-no-alt"></span>
</button>
<?php
$licence_form_method = isset( $_GET['license-form-method'] ) ? sanitize_text_field( $_GET['license-form-method'] ) : ''; // phpcs:ignore:WordPress.Security.NonceVerification.Recommended
$allowed_html = array(
'a' => array(
'href' => array(),
'title' => array(),
'target' => array(),
),
'br' => array(),
'em' => array(),
'strong' => array(),
'div' => array(
'class' => array(),
'id' => array(),
),
'span' => array(
'class' => array(),
'id' => array(),
),
'input' => array(
'class' => array(),
'id' => array(),
'type' => array(),
'name' => array(),
'value' => array(),
'autocomplete' => array(),
),
'p' => array(
'class' => array(),
),
'h1' => array(),
'h2' => array(),
'h3' => array(),
'h4' => array(),
'h5' => array(),
'h6' => array(),
'i' => array(),
'form' => array(
'method' => array(),
'action' => array(),
'class' => array(),
'id' => array(),
),
);
if ( 'edd' === $product['license_from_type'] || 'license-key' === $licence_form_method ) {
echo wp_kses( bsf_license_activation_form( $product ), $allowed_html );
} elseif ( 'envato' === $product['license_from_type'] || 'oauth' === $licence_form_method ) {
echo wp_kses( bsf_envato_register( $product ), $allowed_html );
}
do_action( "bsf_inlne_license_form_footer_{$product[ 'license_from_type' ]}", $product_id );
do_action( 'bsf_inlne_license_form_footer', $product_id );
// Avoid rendering the markup twice as admin_footer can be called multiple times.
unset( self::$inline_form_products[ $product_id ] );
?>
</div>
</div>
<?php
}
}
Expand full source code Collapse full source code View on Trac