e PDF educational popup. * * @since 1.9.7.3 * * @param string $slug The slug for the PDF educational popup. */ $slug = apply_filters( 'wpforms_admin_education_builder_pdf_get_addon_data_slug', $this->slug ); $addons = Helpers::get_edu_addons(); return $addons[ $slug ] ?? []; } /** * Get button data. * * @since 1.9.7.3 * * @param string $action Action type (switch, upgrade, etc.). * @param array $addon Addon data. * * @return array */ protected function get_button_data( string $action, array $addon ): array { $button_label = $action === 'upgrade' ? esc_html__( 'Upgrade to Pro', 'wpforms-lite' ) : esc_html__( 'Try it Out', 'wpforms-lite' ); $button_utm = 'PDF Addon Pop-up'; $button_class = 'education-action-button'; $button_attr = ''; if ( $action === 'switch' ) { $button_class = 'education-modal education-switch-button'; $button_attr = 'data-target="wpforms-pdf"'; } elseif ( $action !== 'upgrade' ) { $button_class = 'education-modal'; $button_attr = sprintf( 'data-nonce="%1$s" data-path="%2$s" data-url="%3$s" data-message="" data-name="%4$s"', esc_attr( wp_create_nonce( 'wpforms-admin' ) ), $addon['path'] ?? '', $addon['url'] ?? '', esc_html__( 'WPForms PDF Addon', 'wpforms-lite' ) ); } return [ $button_label, $button_utm, $button_class, $button_attr ]; } }