/home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Education/ActiveLayer
Edit: /home/techb158/public_html/wp-content/plugins/wpforms-lite/src/Education/ActiveLayer/Helper.php (5892B)
}
*/
public static function get_modal_data(): array {
// Installed AND active → plain dashboard link, no modal.
if ( self::is_activated() ) {
return [
'link' => self::get_dashboard_url(),
'link_text' => __( 'Dashboard', 'wpforms-lite' ),
'class' => '',
'attrs' => [],
];
}
$nonce = wp_create_nonce( 'wpforms-admin' );
// Installed but inactive → activate modal.
// JS reads $button.data('path') → attribute MUST be `data-path`.
// Verified against `activateAddon()` in
// `assets/js/admin/education/core.js` — reads $button.data('path').
if ( self::is_installed() ) {
return [
'link' => '#',
'link_text' => __( 'Get Started →', 'wpforms-lite' ),
'class' => 'education-modal',
'attrs' => [
'data-action' => 'activate',
'data-name' => 'ActiveLayer plugin',
'data-path' => self::get_basename(),
'data-type' => 'plugin',
'data-nonce' => $nonce,
],
];
}
// Not installed → install modal pointing at the WP.org zip.
// JS reads $button.data('url') → attribute MUST be `data-url`.
return [
'link' => '#',
'link_text' => __( 'Get Started →', 'wpforms-lite' ),
'class' => 'education-modal',
'attrs' => [
'data-action' => 'install',
'data-name' => 'ActiveLayer plugin',
'data-url' => self::get_install_zip_url(),
'data-type' => 'plugin',
'data-nonce' => $nonce,
],
];
}
}