Changeset 1811440
- Timestamp:
- 01/29/2018 08:28:20 PM (8 years ago)
- Location:
- acf-bootstrap-button/trunk
- Files:
-
- 3 edited
-
acf-bbutton.php (modified) (7 diffs)
-
fields/acf-bbutton-v4.php (modified) (2 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
acf-bootstrap-button/trunk/acf-bbutton.php
r1801006 r1811440 5 5 * Plugin URI: https://wordpress.org/plugins/acf-bootstrap-button/ 6 6 * Description: Add a field to create a Bootstrap Button for the popular Advanced Custom Fields plugin, with internal or external link. 7 * Version: 1.0. 37 * Version: 1.0.4 8 8 * Author: teakor 9 9 * Author URI: … … 33 33 * @type function 34 34 * @date 17/02/2016 35 * @since 1.0. 335 * @since 1.0.4 36 36 * 37 37 * @param n/a … … 43 43 // vars 44 44 $this->settings = array( 45 'version' => '1.0. 3',45 'version' => '1.0.4', 46 46 'url' => plugin_dir_url( __FILE__ ), 47 47 'path' => plugin_dir_path( __FILE__ ) … … 68 68 * @type function 69 69 * @date 17/02/2016 70 * @since 1.0. 370 * @since 1.0.4 71 71 * 72 72 * @param $version (int) major ACF version. Defaults to false … … 96 96 97 97 $active = ( $field['active_state'] ) ? " active" : ""; 98 $class = trim($field['style'] . ' ' . $field['size'] . ' ' .$active . ' ' . $field['css_class']);98 $class = trim($field['style'] . ' ' . $field['size'] . $active . ' ' . $field['css_class']); 99 99 100 100 switch ($field['tag']){ … … 108 108 109 109 case "button": 110 $disabled = ( $field['disabled_state'] ) ? 'disabled ="disabled"' : "";110 $disabled = ( $field['disabled_state'] ) ? 'disabled' : ""; 111 111 $text = ( $field['text'] == "") ? $field['title'] : $field['text']; 112 112 $bbutton = sprintf('<button class="btn %s" %s type="button">%s</button>', $class, $disabled, $text); … … 114 114 115 115 case "input": 116 $disabled = ( $field['disabled_state'] ) ? 'disabled="disabled"' : ""; 116 case "submit": 117 case "reset": 118 $disabled = ( $field['disabled_state'] ) ? 'disabled' : ""; 117 119 $text = ( $field['text'] == "") ? $field['title'] : $field['text']; 118 $bbutton = sprintf('<input class="btn %s" %s type="button" value="%s">', $class, $disabled, $text); 119 break; 120 121 case "submit": 122 $disabled = ( $field['disabled_state'] ) ? 'disabled="disabled"' : ""; 123 $text = ( $field['text'] == "") ? $field['title'] : $field['text']; 124 $bbutton = sprintf('<input class="btn %s" %s type="submit" value="%s">', $class, $disabled, $text); 120 $bbutton = sprintf('<input class="btn %s" %s type="%s" value="%s">', $class, $disabled, $field['tag'],$text); 125 121 break; 126 122 } -
acf-bootstrap-button/trunk/fields/acf-bbutton-v4.php
r1801006 r1811440 144 144 'input' => __("Input",'acf-bootstrap-button'), 145 145 'submit' => __("Submit",'acf-bootstrap-button'), 146 'reset' => __("Reset",'acf-bootstrap-button'), 146 147 ) 147 148 )); … … 340 341 <option value="input" <?php if ( $field['value']['tag'] == 'input' ) echo 'selected'; ?>><?php _e("Input",'acf-bootstrap-button'); ?></option> 341 342 <option value="submit" <?php if ( $field['value']['tag'] == 'submit' ) echo 'selected'; ?>><?php _e("Submit",'acf-bootstrap-button'); ?></option> 343 <option value="reset" <?php if ( $field['value']['tag'] == 'reset' ) echo 'selected'; ?>><?php _e("Reset",'acf-bootstrap-button'); ?></option> 342 344 </select> 343 345 </div> -
acf-bootstrap-button/trunk/readme.txt
r1801006 r1811440 3 3 Tags: acf, advanced, custom, field, fields, form, repeater, content, button, bootstrap 4 4 Requires at least: 4.5.0 5 Tested up to: 4.9. 16 Stable tag: 1.0. 35 Tested up to: 4.9.2 6 Stable tag: 1.0.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 9 10 Add a field to create a Bootstrap Button for the popular Advanced Custom Fields plugin, with internal or external link.10 This plugin adds a field for creating e a Bootstrap button for the popular plugin Advanced Custom Fields. In addition to supporting all Bootstrap options, you can insert an internal or external link with the link picker. 11 11 12 12 == Description == 13 13 14 Add a field to create a Bootstrap Button for the popular Advanced Custom Fields plugin, with internal or external link. 15 14 This plugin adds a field for creating e a Bootstrap button for the popular plugin Advanced Custom Fields. In addition to supporting all Bootstrap options, you can insert an internal or external link with the link picker. 16 15 17 16 = Configuration Options: = 18 17 1. Button text. 19 2. Tag HTML (a, button, input, submit ).18 2. Tag HTML (a, button, input, submit, reset). 20 19 3. Button Style (Default, Primary, Success, Information, Warning, Danger, Link). 21 20 4. Button Size (Default, Large, Small, Extra Small). … … 24 23 7. Internal or external link. 25 24 26 The points between 1 and 6 can be configured with default values and set so that they are not visible on the page or in the post where this custom field is added. 27 For more information on points between 2 and 5, please refer to the [Bootstrap documentation](https://getbootstrap.com/docs/3.3/css/#buttons). 25 Points from 1 to 7 can be configured with default values and you can choose whether or not to display these options on the page or post, where this custom field was added. 28 26 29 = Use = 30 To display the button in the Front End, put the following code in your theme. 27 For more information on points from 2 to 5 refer to the [Bootstrap documentation 3.3.7](https://getbootstrap.com/docs/3.3/css/#buttons). 28 29 = How to use it = 30 The plugin does not include the Bootstrap css in the theme in order to be able to display it correctly, it is necessary to insert the Bootstrap css in the theme, following the guidelines of Wordpress: Including CSS & JavaScript. 31 32 To view the button in the front end, a function has been implemented, which will facilitate the operation. This function will only read the values of the button and return the correct HTML. 31 33 32 34 `echo acf_bbutton_render(get_field('my-bbutton'));` 33 34 = Note =35 It is recommended to let this plugin enqueue the latest version stable of [Bootstraap 3.3](https://getbootstrap.com/docs/3.3/).36 35 37 36 = Compatibility = … … 40 39 * ACF 4 41 40 42 = Features Next Release =43 * Add ACF 5 compatibility44 45 41 == Installation == 46 42 … … 48 44 2. Activate the Advanced Custom Fields: Bootstrap Button plugin via the plugins admin page 49 45 3. Create a new field via ACF and select the Button type 50 4. Please refer to the description for more info regarding the field type settings46 4. Please refer to the plugin description for more info regarding the field type settings 51 47 52 48 == Screenshots == … … 57 53 58 54 == Changelog == 55 = 1.0.4 = 56 * Add Tag reset 57 59 58 = 1.0.3 = 60 59 * Fix bug language
Note: See TracChangeset
for help on using the changeset viewer.