e-conditional-logic-with-wpforms/', '/docs/how-to-customize-the-style-of-individual-form-fields/', ], 'total' => [ '/docs/viewing-and-managing-payments/', '/docs/how-to-require-payment-total-with-a-wordpress-form/', '/docs/how-to-install-and-use-the-stripe-addon-with-wpforms/', '/docs/paypal-commerce-addon/', '/docs/install-use-paypal-addon-wpforms/', '/docs/how-to-install-and-use-the-authorize-net-addon-with-wpforms/', '/docs/how-to-create-a-donation-form-with-multiple-amounts/', '/docs/how-to-allow-users-to-choose-a-payment-method-on-your-form/', '/docs/how-to-customize-form-field-options/', '/docs/how-to-use-conditional-logic-with-wpforms/', '/docs/how-to-customize-the-style-of-individual-form-fields/', ], 'paypal checkout' => [ '/docs/paypal-commerce-addon/', '/docs/testing-payments-with-the-paypal-commerce-addon/', '/docs/how-to-customize-form-field-options/', '/docs/how-to-use-conditional-logic-with-wpforms/', '/docs/viewing-and-managing-payments/', ], 'stripe credit card' => [ '/docs/how-to-install-and-use-the-stripe-addon-with-wpforms/', '/docs/how-to-test-stripe-payments-on-your-site/', '/docs/how-to-customize-form-field-options/', '/docs/how-to-use-conditional-logic-with-wpforms/', '/docs/viewing-and-managing-payments/', ], 'authorize.net credit card' => [ '/docs/how-to-install-and-use-the-authorize-net-addon-with-wpforms/', '/docs/how-to-customize-form-field-options/', '/docs/how-to-use-conditional-logic-with-wpforms/', '/docs/viewing-and-managing-payments/', ], 'square credit card' => [ '/docs/how-to-install-and-use-the-square-addon-with-wpforms/', '/docs/how-to-test-square-payments-on-your-site/', '/docs/how-to-customize-form-field-options/', '/docs/how-to-use-conditional-logic-with-wpforms/', '/docs/viewing-and-managing-payments/', ], 'settings' => [ '/docs/creating-first-form/', '/docs/setup-form-notification-wpforms/', '/docs/setup-form-confirmation-wpforms/', ], 'submit' => [ '/docs/how-to-customize-the-submit-button/', ], 'button' => [ '/docs/how-to-customize-the-submit-button/', ], 'dynamic population' => [ '/developers/how-to-enable-dynamic-field-population/', ], 'offline' => [ '/docs/how-to-enable-ajax-form-submissions/', ], 'offline forms' => [ '/docs/how-to-enable-ajax-form-submissions/', ], 'notification' => [ '/docs/setup-form-notification-wpforms/', '/docs/customizing-form-notification-emails/', '/docs/how-to-create-conditional-form-notifications-in-wpforms/', '/docs/troubleshooting-email-notifications/', '/docs/how-to-fix-wordpress-contact-form-not-sending-email-with-smtp/', ], 'notifications' => [ '/docs/setup-form-notification-wpforms/', '/docs/customizing-form-notification-emails/', '/docs/how-to-create-conditional-form-notifications-in-wpforms/', '/docs/troubleshooting-email-notifications/', '/docs/how-to-fix-wordpress-contact-form-not-sending-email-with-smtp/', ], 'notification email' => [ '/docs/setup-form-notification-wpforms/', '/docs/customizing-form-notification-emails/', '/docs/how-to-create-conditional-form-notifications-in-wpforms/', '/docs/troubleshooting-email-notifications/', '/docs/how-to-fix-wordpress-contact-form-not-sending-email-with-smtp/', ], 'notification emails' => [ '/docs/setup-form-notification-wpforms/', '/docs/customizing-form-notification-emails/', '/docs/how-to-create-conditional-form-notifications-in-wpforms/', '/docs/troubleshooting-email-notifications/', '/docs/how-to-fix-wordpress-contact-form-not-sending-email-with-smtp/', ], 'confirmation' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'confirmation message' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'redirect' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'go to url (redirect)' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'confirmation page' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'conditional confirmation' => [ '/docs/setup-form-confirmation-wpforms/', '/docs/how-to-create-conditional-form-confirmations/', ], 'calculation' => [ '/docs/calculations-addon/', '/docs/building-formulas-with-the-calculations-addon/', '/calculations-formula-cheatsheet/', ], 'calculations' => [ '/docs/calculations-addon/', '/docs/building-formulas-with-the-calculations-addon/', '/calculations-formula-cheatsheet/', ], 'formula' => [ '/docs/calculations-addon/', '/docs/building-formulas-with-the-calculations-addon/', '/calculations-formula-cheatsheet/', ], 'conditional calculation' => [ '/docs/calculations-addon/', '/docs/building-formulas-with-the-calculations-addon/', '/calculations-formula-cheatsheet/', ], 'lead forms' => [ '/docs/lead-forms-addon/', ], 'form abandonment' => [ '/docs/how-to-install-and-use-form-abandonment-with-wpforms/', ], 'abandonment' => [ '/docs/how-to-install-and-use-form-abandonment-with-wpforms/', ], 'abandon' => [ '/docs/how-to-install-and-use-form-abandonment-with-wpforms/', ], 'lead capture' => [ '/docs/how-to-install-and-use-form-abandonment-with-wpforms/', ], 'post submissions' => [ '/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/', ], 'guest post' => [ '/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/', ], 'user submission' => [ '/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/', ], 'blog' => [ '/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/', ], 'post' => [ '/docs/how-to-install-and-use-the-post-submissions-addon-in-wpforms/', ], 'user registration' => [ '/docs/how-to-install-and-use-user-registration-addon-with-wpforms/', '/docs/how-to-set-up-custom-user-meta-fields/', ], 'register' => [ '/docs/how-to-install-and-use-user-registration-addon-with-wpforms/', '/docs/how-to-set-up-custom-user-meta-fields/', ], 'registration' => [ '/docs/how-to-install-and-use-user-registration-addon-with-wpforms/', '/docs/how-to-set-up-custom-user-meta-fields/', ], 'user meta' => [ '/docs/how-to-install-and-use-user-registration-addon-with-wpforms/', '/docs/how-to-set-up-custom-user-meta-fields/', ], 'user' => [ '/docs/how-to-install-and-use-user-registration-addon-with-wpforms/', '/docs/how-to-set-up-custom-user-meta-fields/', ], 'surveys' => [ '/docs/how-to-install-and-use-the-surveys-and-polls-addon/', ], 'polls' => [ '/docs/how-to-install-and-use-the-surveys-and-polls-addon/', ], 'surveys and polls' => [ '/docs/how-to-install-and-use-the-surveys-and-polls-addon/', ], 'conversational forms' => [ '/docs/how-to-install-and-use-the-conversational-forms-addon/', ], 'conversational' => [ '/docs/how-to-install-and-use-the-conversational-forms-addon/', ], 'form locker' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'password protection' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'entry limit' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'scheduling' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'restrict access' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'limit' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'schedule' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'restrict' => [ '/docs/how-to-install-and-use-the-form-locker-addon-in-wpforms/', '/developers/how-to-display-remaining-entry-limit-number/', ], 'form pages' => [ '/docs/how-to-install-and-use-the-form-pages-addon/', ], 'save' => [ '/docs/how-to-install-and-use-the-save-and-resume-addon-with-wpforms/', ], 'resume' => [ '/docs/how-to-install-and-use-the-save-and-resume-addon-with-wpforms/', ], 'continue' => [ '/docs/how-to-install-and-use-the-save-and-resume-addon-with-wpforms/', ], 'save and resume' => [ '/docs/how-to-install-and-use-the-save-and-resume-addon-with-wpforms/', ], 'save and continue' => [ '/docs/how-to-install-and-use-the-save-and-resume-addon-with-wpforms/', ], 'webhooks' => [ '/docs/how-to-install-and-use-the-webhooks-addon-with-wpforms/', ], 'aweber' => [ '/docs/install-use-aweber-addon-wpforms/', ], 'campaign monitor' => [ '/docs/how-to-install-and-use-campaign-monitor-addon-with-wpforms/', ], 'constant contact' => [ '/docs/how-to-connect-constant-contact-with-wpforms/', ], 'convertkit' => [ '/docs/convertkit-addon/', ], 'drip' => [ '/docs/how-to-install-and-use-the-drip-addon-in-wpforms/', ], 'getresponse' => [ '/docs/how-to-install-and-use-getresponse-addon-with-wpforms/', ], 'google sheets' => [ '/docs/google-sheets-addon/', '/docs/google-permissions/', ], 'mailchimp' => [ '/docs/install-use-mailchimp-addon-wpforms/', ], 'mailerlite' => [ '/docs/install-use-mailerlite-addon-wpforms/', ], 'zapier' => [ '/docs/how-to-install-and-use-zapier-addon-with-wpforms/', ], 'salesforce' => [ '/docs/how-to-install-and-use-the-salesforce-addon-with-wpforms/', ], 'sendinblue' => [ '/docs/how-to-install-and-use-the-sendinblue-addon-with-wpforms/', ], 'hubspot' => [ '/docs/how-to-install-and-use-the-hubspot-addon-in-wpforms/', ], 'integrate' => [ '/docs/how-to-install-and-use-zapier-addon-with-wpforms/', '/docs/how-to-install-and-use-the-webhooks-addon-with-wpforms/', '/docs/google-sheets-addon/', ], 'integration' => [ '/docs/how-to-install-and-use-zapier-addon-with-wpforms/', '/docs/how-to-install-and-use-the-webhooks-addon-with-wpforms/', '/docs/google-sheets-addon/', ], 'crm' => [ '/docs/how-to-install-and-use-zapier-addon-with-wpforms/', '/docs/how-to-install-and-use-the-webhooks-addon-with-wpforms/', ], 'api' => [ '/docs/how-to-install-and-use-zapier-addon-with-wpforms/', '/docs/how-to-install-and-use-the-webhooks-addon-with-wpforms/', '/docs/google-sheets-addon/', ], 'paypal commerce' => [ '/docs/paypal-commerce-addon/', '/docs/testing-payments-with-the-paypal-commerce-addon/', ], 'paypal standard' => [ '/docs/install-use-paypal-addon-wpforms/', '/docs/how-to-test-paypal-payments-before-accepting-real-payments/', '/docs/how-to-allow-users-to-choose-a-payment-method-on-your-form/', ], 'stripe' => [ '/docs/using-stripe-with-wpforms-lite/', '/docs/how-to-install-and-use-the-stripe-addon-with-wpforms/', '/docs/how-to-test-stripe-payments-on-your-site/', ], 'authorize' => [ '/docs/how-to-install-and-use-the-authorize-net-addon-with-wpforms/', ], 'authorize.net' => [ '/docs/how-to-install-and-use-the-authorize-net-addon-with-wpforms/', ], 'square' => [ '/docs/how-to-install-and-use-the-square-addon-with-wpforms/', '/docs/how-to-test-square-payments-on-your-site/', ], 'revisions' => [ '/docs/how-to-use-form-revisions-in-wpforms/', ], ]; } /** * Get context (recommended) docs. * * @since 1.6.3 * * @return array Docs recommended by search terms. */ public function get_context_docs() { if ( empty( $this->docs ) ) { return []; } $docs_links = $this->get_context_docs_links(); $docs = []; foreach ( $docs_links as $word => $links ) { $docs[ $word ] = $this->get_doc_ids( $links ); } return $docs; } /** * Get doc id. * * @since 1.6.3 * @deprecated 1.8.3 * * @param string $link Absolute link to the doc without the domain part. * * @return array Array with doc id as element. */ public function get_doc_id( $link ) { _deprecated_function( __METHOD__, '1.8.3 of the WPForms plugin', __CLASS__ . '::get_doc_id_int()' ); if ( empty( $this->docs ) ) { return []; } $result = array_filter( $this->docs, static function( $doc ) use ( $link ) { return ! empty( $doc['url'] ) && $doc['url'] === 'https://wpforms.com' . $link; } ); return array_keys( $result ); } /** * Get doc id. * * @since 1.8.3 * * @param string $link Absolute link to the doc without the domain part. * * @return int Doc id. */ private function get_doc_id_int( $link ) { if ( empty( $this->docs ) ) { return 0; } foreach ( $this->docs as $id => $doc ) { if ( ! empty( $doc['url'] ) && $doc['url'] === 'https://wpforms.com' . $link ) { return $id; } } return 0; } /** * Get doc ids. * * @since 1.6.3 * * @param array $links Array of the doc links. * * @return array Doc ids. */ public function get_doc_ids( $links ) { $ids = []; foreach ( $links as $link ) { $ids[] = $this->get_doc_id_int( $link ); } return $ids; } /** * Output help modal markup. * * @since 1.6.3 */ public function output() { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo wpforms_render( 'builder/help', [ 'settings' => [ 'docs_url' => 'https://wpforms.com/docs/', 'support_ticket_url' => 'https://wpforms.com/account/support/', 'upgrade_url' => 'https://wpforms.com/pricing/', ], ], true ); } }