Title: VForce Extensions
Author: Virtual
Published: <strong>2020 年 3 月 3 日</strong>
Last modified: 2020 年 3 月 25 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/vforce-extensions.svg)

# VForce Extensions

 作者：[Virtual](https://profiles.wordpress.org/virtualinc/)

[下载](https://downloads.wordpress.org/plugin/vforce-extensions.1.0.3.zip)

 * [详情](https://cn.wordpress.org/plugins/vforce-extensions/#description)
 * [评价](https://cn.wordpress.org/plugins/vforce-extensions/#reviews)
 * [开发进展](https://cn.wordpress.org/plugins/vforce-extensions/#developers)

 [支持](https://wordpress.org/support/plugin/vforce-extensions/)

## 描述

Easily manage Vforce integrations through WordPress. Currently supports voting forms
and web to case forms through Form Assembly. As well as adding products to a cart
through Formidable.

### Included Functions

### js/init-global.js

This file doesn’t actually do anything. It only exists to be passed into the
 `php
wp_localize_script() function along with an array of variables that we would like
to be available to every page.

### js/formidable/add-to-cart.js

This script allows you to create a formidable form with woocommerce products in 
a dropdown or radio buttons. Once the user chooses a product and clicks next on 
the form, the product id is saved in their browser. When they complete the form,
an Ajax request is made to add the time to their cart.

### js/form-assembly/hide-ballot.js

This script will show/hide a form based on the value of an input with title of Ballot
Cast. If that input is found on the page and its value is equal to Cast or cast,
then the user will see a custom message instead of the voting form. The message 
can be customized by going to the plugin settings (Vforce Extensions) and changing
the Form Assembly Ballot Message textarea. A default message is included.

In order for this to work properly, please make sure to wrap the form in a div with
the class of ballot-container.

E.g.

    ```
    `html
    ```

[formassembly formid=50 server=https://virtual.tfaforms.net]

    ```
    `
    ```

This way the form will be hidden by default and will either appear or show the message
when page loads.

### js/form-assembly/web-to-case.js

Automatically adds the association id to a Form Assembly contact form embedded on
any page. The association id can be set in the plugin settings.

### Global Variables

Every page should have access to an object called vforce_helper. This object contains
all custom variables from the settings pane.

e.g.

    ```
    `javascript
    ```

vforce_helper
 {assocId: “”, faProductSelector: “item_meta[6]”, ballotCastMessage:“”}`

This is accomplished by passing key/value pairs to the following function in the
plugins functions.php file

    ```
    `php
    ```

wp_localize_script( ‘init-global’, ‘vforce_helper’, array(
 ‘assocId’ => get_option(‘
association_id’), ‘faProductSelector’ => get_option(‘form_assembly_product_selector’),‘
ballotCastMessage’ => get_option(‘form_assembly_ballot_message’) ) `

## 评价

此插件暂无评价。

## 贡献者及开发者

「VForce Extensions」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Virtual ](https://profiles.wordpress.org/virtualinc/)

[帮助将「VForce Extensions」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/vforce-extensions)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/vforce-extensions/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/vforce-extensions/)，或通过[RSS](https://plugins.trac.wordpress.org/log/vforce-extensions/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/vforce-extensions/)。

## 更新日志

### 1.0.3

 * Cleaned up some styling. Removed debug statements.
 * Fixed issue with WPEngine quick links in admin bar not showing up.
 * Added VForce Settings quick link to admin bar.
 * Added Association ID to VForce settings quick links.

### 1.0.2

 * Updated Formassembly integration. Added the ability to customize the message 
   show at the top of the page when a user is reviewing their form submission. This
   can currently be accessed by checking the “Show Formassembly Settings” checkbox
   in the right sidebar while editing a post or page. Note* currently you will need
   to reload the page to see the new Formassembly Form Settings section. It will
   appear below your page/post.
 * Fixed bug with Formidable forms not submitting.

### 1.0.1

 * Added Formassembly integration. Now you can simply insert the `[vforce_form formid
   ='id']` shortcode into a page or post. If you have issues with the form displaying,
   make sure that the id is in single qoutes. The server url defaults to https://
   virtual.tfaforms.net. You can change this under VForce Settings->Formassembly
   Settings. This plugin will not override or interfere with the official Formassembly
   plugin.

### 1.0

 * Removed Plugin update checker
 * Submitted to WordPress Plugins Repo
 * Added ACF dependency to allow for adding an Association ID override metabox to
   all pages/posts.
 * All pages/posts now have an Association ID override box. By default this box 
   is empty. There is a hook that runs just before each page is loaded. This function
   is in the main plugin file. It checks to see if a value has been set in the override
   box. If so, it will use the value in the override meta box as the global association
   id, if not it will use the default site wide Association ID/

// This function runs just before the requested page is loaded
 add_action(‘template_redirect’,‘
vforce_hook_before_page_load’); function vforce_hook_before_page_load(){ $vforce_helper
= get_option(‘vforce_helper’);

    ```
    wp_enqueue_script( 'init-global', plugin_dir_url( __FILE__ ) . 'inc/js/init-global.js', array('jquery'), '1.0', true );
    /* 
     Setting the association ID variable
     Check to see if a value has been entered into the Association Id override metabox of the page.
     If so, inject that into our init-global.js as the associationId variable.  If it has not been set,
     we then use the value entered into the plugin settings.
     The code for the metabox is in functions.php
    */
     wp_localize_script( 'init-global', 'associationId', (get_post_meta( get_the_ID(), 'vforce-metabox-settings-association_id', true) != "") ? get_post_meta( get_the_ID(), 'vforce-metabox-settings-association_id', true) : $vforce_helper['variable']['association-id']); 
    ```

}

 * vforce_helper is now a multidimensional array.

vforce_helper.variable
 {association-id: “a00f400000VQ8E6AAL”} vforce_helper.script{
formidable_add-to-cart: “true”, fa_web-to-case: “true”}

#### 0.6

*Added ability to update from Github releases

#### 0.5

 * Initial Release
 * Includes basic functionality for web to case, handling voting ballots and adding
   items to cart through formidable.
 * Basic readme included.

## 额外信息

 *  版本 **1.0.3**
 *  最后更新：**6 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 3.0.1 或更高版本 **
 *  已测试的最高版本为 **5.3.21**
 *  语言
 * [English (US)](https://wordpress.org/plugins/vforce-extensions/)
 * 标签
 * [formassembly](https://cn.wordpress.org/plugins/tags/formassembly/)[salesforce](https://cn.wordpress.org/plugins/tags/salesforce/)
   [virtual](https://cn.wordpress.org/plugins/tags/virtual/)
 *  [高级视图](https://cn.wordpress.org/plugins/vforce-extensions/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/vforce-extensions/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/vforce-extensions/reviews/)

## 贡献者

 *   [ Virtual ](https://profiles.wordpress.org/virtualinc/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/vforce-extensions/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://virtualinc.com)