shawnW-3
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Using OR instead of AND for Taxonomy Conditional on Custom Field Group…
Started by: shawnW-3 in: Toolset Professional Support |
1 | 2 | 4 years, 5 months ago | ||
Alt Text Output for Images from Custom Field…
Started by: shawnW-3
in: Toolset Professional Support
Problem: Solution: function media_info_func( $atts ) { // Attributes $atts = shortcode_atts( array( 'field' => '', 'info' => '', ), $atts ); global $post, $wpdb; $field = $atts['field']; $info = $atts['info']; $image_url = get_post_meta( $post->ID, $field ); $attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url )); $attachment_id = $attachment[0]; if ( $field && $info ) { switch($info) { case 'id': return $attachment_id; break; case 'title': // return return ("[wpv-post-title item='$attachment_id']"); return wpv_do_shortcode("[wpv-post-title item='$attachment_id']"); break; case 'alt': // return ("[wpv-post-field name='_wp_attachment_image_alt' item='$attachment_id']"); return do_shortcode("[wpv-post-field name='_wp_attachment_image_alt' item='$attachment_id']"); break; case 'caption': // return ("[wpv-post-excerpt output='raw' item='$attachment_id']"); return do_shortcode("[wpv-post-excerpt output='raw' item='$attachment_id']"); break; case 'description': // return ("[wpv-post-body view_template='None' item='$attachment_id']"); return do_shortcode("[wpv-post-body view_template='None' item='$attachment_id' output='raw']"); break; } } } add_shortcode( 'media-info', 'media_info_func' ); The shortcode can be used as follow: Image ID: [media-info field='wpcf-single-image' info='id'] Title: [media-info field='wpcf-single-image' info='title'] Alt text: [media-info field='wpcf-single-image' info='alt'] Caption: [media-info field='wpcf-single-image' info='caption'] Description: [media-info field='wpcf-single-image' info='description'] |
|
2 | 5 | 4 years, 6 months ago | |
Re-Order Checkbox Field and Use it for Conditionals
Started by: shawnW-3 in: Toolset Professional Support |
|
2 | 4 | 4 years, 6 months ago | |
Locations missing from map search – google map bug…
Started by: shawnW-3 in: Toolset Professional Support |
|
2 | 2 | 4 years, 8 months ago | |
Crashed Website, Only Error Shows Toolset Maps…
Started by: shawnW-3 in: Toolset Professional Support |
|
3 | 6 | 4 years, 8 months ago | |
Parent Post form Field
Started by: shawnW-3 in: Toolset Professional Support |
|
2 | 9 | 4 years, 10 months ago | |
Need help understanding wpv-gelocation – Is ajax an option?
Started by: shawnW-3 in: Toolset Professional Support |
|
2 | 4 | 4 years, 12 months ago |