Changeset 2489776
- Timestamp:
- 03/08/2021 05:21:01 PM (4 years ago)
- Location:
- buddyforms-hook-fields
- Files:
-
- 57 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
buddyforms-hook-fields/trunk/buddyforms-hook-fields.php
r2411886 r2489776 8 8 * Plugin URI: https://themekraft.com/products/buddyforms-hook-fields/ 9 9 * Description: BuddyForms Hook Fields 10 * Version: 1.3. 210 * Version: 1.3.3 11 11 * Author: ThemeKraft 12 12 * Author URI: https://themekraft.com/buddyforms/ -
buddyforms-hook-fields/trunk/composer.json
r2411886 r2489776 21 21 "consolidation/robo": "^1.0.0", 22 22 "bamarni/composer-bin-plugin": "dev-master" 23 },24 "require-dev": {25 "phpunit/phpunit": "^6.1",26 "php-coveralls/php-coveralls": "^2.0@dev",27 "squizlabs/php_codesniffer": "3.*",28 "friendsofphp/php-cs-fixer": "^2.9",29 "jakub-onderka/php-parallel-lint": "dev-master",30 "jakub-onderka/php-console-highlighter": "dev-master",31 "wp-coding-standards/wpcs": "dev-master",32 "symplify/easy-coding-standard": "^5.2@dev",33 "brainmaestro/composer-git-hooks": "dev-master"34 },35 "scripts": {36 "package": "sh .tk/package.sh buddyforms-hook-fields",37 "wp-release": "sh .tk/wp_release.sh",38 "beta-release": "sh .tk/full-deploy.sh buddyforms-hook-fields 412 false beta",39 "full-release": "sh .tk/full-deploy.sh buddyforms-hook-fields 412 false released",40 "update-freemius": "sh .tk/update-freemius.sh ../wordpress-sdk includes/resources/freemius"41 23 } 42 24 } -
buddyforms-hook-fields/trunk/includes/form-options.php
r2411886 r2489776 115 115 ) ); 116 116 117 if ( $field_type === 'upload' || $field_type === 'file' ) { 118 119 $sizes = wp_get_registered_image_subsizes(); 120 $sizes = array_keys( $sizes ); 121 122 $selected_size = false; 123 if ( isset( $buddyform['form_fields'][$field_id]['thumbnail_size'] ) ) { 124 $selected_size = $buddyform['form_fields'][$field_id]['thumbnail_size']; 125 } 126 127 $form_fields['hooks']['thumbnail_size'] = new Element_Select( "Thumbnail size", "buddyforms_options[form_fields][" . $field_id . "][thumbnail_size]", $sizes, array( 128 'value' => $selected_size, 129 'shortDesc' => __( 'This option give the ability to control the size for uploaded images, Eg: thumbnail, medium, large.', 'buddyforms' ), 130 ) ); 131 132 } 133 117 134 $form_fields['hooks']['html_display_end'] = new Element_HTML( '</div>' ); 118 135 -
buddyforms-hook-fields/trunk/includes/list-all-post-fields.php
r2411886 r2489776 33 33 34 34 $add_table_content = ( ! empty( $buddyforms[ $form_slug ]['hook_fields_list_on_single'] ) ) ? $buddyforms[ $form_slug ]['hook_fields_list_on_single'] : ''; 35 $post_template_id = ( ! empty( $buddyforms[ $form_slug ]['hook_fields_template_page'] ) ) ? $buddyforms[ $form_slug ]['hook_fields_template_page'] : 'none';35 $post_template_id = ( ! empty( $buddyforms[ $form_slug ]['hook_fields_template_page'] ) ) ? (int) $buddyforms[ $form_slug ]['hook_fields_template_page'] : 'none'; 36 36 $is_post_template_enabled = ( ! empty( $post_template_id ) && $post_template_id !== 'none' ); 37 37 … … 80 80 81 81 if ( isset( $field['slug'] ) ) { 82 if ($field['type']==='upload'){83 $upload_field_val = get_post_meta( $post->ID,$field['name'],true);84 $media_items = explode( ',', $upload_field_val);82 if ( $field['type'] === 'upload' || $field['type'] === 'file' ){ 83 $upload_field_val = get_post_meta( $post->ID, $field['slug'] , true); 84 $media_items = explode( ',', $upload_field_val ); 85 85 $result = ""; 86 foreach ($media_items as $attachment_item){ 87 $attachment_full_url = wp_get_attachment_url($attachment_item); 88 $default_thumbnail = plugin_dir_url(__FILE__).'/assets/images/multimedia.png'; 89 $attachment_thumbnail_url = wp_get_attachment_thumb_url( $attachment_item) === false? $default_thumbnail : wp_get_attachment_thumb_url( $attachment_item); 90 $result .= "<a href='".$attachment_full_url."' target='_blank'> <img src='".$attachment_thumbnail_url."' /></a>" ."," ; 86 foreach ( $media_items as $attachment_item ){ 87 $attachment_full_url = wp_get_attachment_url( $attachment_item ); 88 $default_thumbnail = plugin_dir_url (__FILE__ ).'/assets/images/multimedia.png'; 89 $attachment_thumbnail_url = wp_get_attachment_thumb_url( $attachment_item ) === false ? $default_thumbnail : wp_get_attachment_thumb_url( $attachment_item ); 90 91 $result .= "<a href='".$attachment_full_url."' target='_blank'> <img src='" . $attachment_thumbnail_url . "' /></a>"; 91 92 } 92 $new_content .= "<tr " . $striped . "><td><strong>" . $field['name'] . "</strong> </td><td>" .trim( $result,','). "</td></tr>";93 $new_content .= "<tr " . $striped . "><td><strong>" . $field['name'] . "</strong> </td><td>" .trim( $result ). "</td></tr>"; 93 94 } 94 95 else{ … … 150 151 $after_the_content = false; 151 152 152 foreach ( $buddyforms[ $form_slug ]['form_fields'] as $ key=> $customfield ) {153 foreach ( $buddyforms[ $form_slug ]['form_fields'] as $field_id => $customfield ) { 153 154 154 155 if ( ! empty( $customfield['slug'] ) && ( ! empty( $customfield['hook'] ) || is_single() ) ) { … … 163 164 $post_meta_tmp .= '<label>' . $customfield['name'] . '</label>'; 164 165 } 165 /// here 166 if($field['type']==='upload'){ 167 $upload_field_val = get_post_meta($post->ID,$field['name'],true); 168 $media_items = explode(',', $upload_field_val); 169 $result = array(); 170 foreach ($media_items as $attachment_item){ 171 $attachment_full_url = wp_get_attachment_url($attachment_item); 172 $default_thumbnail = plugin_dir_url(__FILE__).'/assets/images/multimedia.png'; 173 $attachment_thumbnail_url = wp_get_attachment_thumb_url( $attachment_item) === false? $default_thumbnail : wp_get_attachment_thumb_url( $attachment_item); 174 $result[]= "<a href='".$attachment_full_url."' target='_blank'> <img src='".$attachment_thumbnail_url."' /></a>"; 166 167 if ( $field['type'] === 'upload' || $field['type'] === 'file' ){ 168 $upload_field_val = get_post_meta( $post->ID, $field['slug'], true ); 169 $media_items = explode( ',', $upload_field_val ); 170 $result = array(); 171 $thumbnail_size = 'thumbnail'; 172 173 if ( isset( $buddyforms[ $form_slug ]['form_fields'][$field_id]['thumbnail_size'] ) ) { 174 $thumbnail_size = $buddyforms[ $form_slug ]['form_fields'][$field_id]['thumbnail_size']; 175 } 176 177 foreach ( $media_items as $attachment_item ){ 178 $attachment_full_url = wp_get_attachment_url( $attachment_item ); 179 $attachment_thumbnail_url = wp_get_attachment_image_src( $attachment_item, $thumbnail_size ); 180 181 if ( ! $attachment_thumbnail_url ) { 182 $attachment_thumbnail_url = array( plugin_dir_url( __FILE__ ) . '/assets/images/multimedia.png' ); 183 } 184 185 $result[] = "<a href='".$attachment_full_url."' target='_blank'> <img src='" . $attachment_thumbnail_url[0] . "' /></a>"; 175 186 } 176 $meta_tmp = "<p>" . implode( ',', $result ) . "</p>";177 } 178 else{187 $meta_tmp = implode( '', $result ); 188 189 } else{ 179 190 if ( is_array( $customfield_value ) ) { 180 191 $meta_tmp = "<p>" . implode( ',', $customfield_value ) . "</p>"; … … 252 263 253 264 add_filter( 'the_content', function ( $content ) use ( $after_the_content ) { 254 $query = get_post( get_the_ID() ); 255 $result = $query->post_content . $after_the_content; 256 $content = str_replace( $query->post_content, $result, $content ); 257 258 return $content; 265 return $content . $after_the_content; 259 266 }, 9999 ); 260 267 } -
buddyforms-hook-fields/trunk/readme.txt
r2411886 r2489776 3 3 Tags: buddypress, user, members, profiles, custom post types, taxonomy, frontend posting, frontend editing,hook fields, custom fields, post meta 4 4 Requires at least: 3.9 5 Tested up to: 5. 5.36 Stable tag: 1.3. 25 Tested up to: 5.6.2 6 Stable tag: 1.3.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 62 62 63 63 == Changelog == 64 = 1.3.3 - 8 Mar 2021 = 65 * Fixed issue related with hooked fields on the single view list. 66 * Added improvements on the integration of Upload and File fields. 67 * Tested up 5.6.2 68 64 69 = 1.3.2 - 2 Nov 2020 = 65 70 * Fixed: Show upload field value.
Note: See TracChangeset
for help on using the changeset viewer.