josephC-5
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 |
---|---|---|---|---|---|
The edit icons are not appearing in the layout editor
Started by: josephC-5 in: Toolset Professional Support |
2 | 7 | 4 years, 7 months ago | ||
Question about retrieving metadata about a featured image
Started by: josephC-5
in: Toolset Professional Support
Problem: I would like to write a conditional that tests whether or not a post's featured image has a caption assigned in the Media Library. Can I use the wpv-post-featured-image shortcode in a conditional? Solution: [wpv-conditional if="( '[wpv-post-featured-image output="caption"]' ne '' )"] This featured image has a caption. [/wpv-conditional] Relevant Documentation: |
2 | 3 | 5 years ago | ||
Filter option values with commas
Started by: josephC-5
in: Toolset Professional Support
Problem: I am providing custom display_values in a search View filter shortcode. I would like to use commas in one of these values, but the system interprets the comma as another option for the filter. How can I use a comma in the option text? Solution: Use the HTML entity for comma: [wpv-control-postmeta field="wpcf-price-range" type="select" source="custom" url_param="wpv-wpcf-price-range" values="3,2,1" display_values="5,000,400,300" default_label="All"] Relevant Documentation: |
2 | 3 | 5 years, 1 month ago | ||
Question about custom search / filter code
Started by: josephC-5 in: Toolset Professional Support |
2 | 14 | 5 years, 1 month ago | ||
Automatically registering functions inside conditionals
Started by: josephC-5
in: Toolset Professional Support
Problem: I would like to automatically register functions for use inside conditionals, by adding those functions with code. Solution: It turns out there is an undocumented filter wpv_filter_wpv_custom_conditional_functions that you can use to add your own custom functions to the allowed function name array. That part works pretty well right now, you can register your own functions and use them as needed in conditionals. There are a couple of minor issues: Those minor issues aside, it works! Example 1. Register function function custom_function($type, $object) { $return = 0; return $return; } 2. Add Conditional Support for function: add_filter( 'wpv_filter_wpv_custom_conditional_functions', 'ts_custom_stuff', 10, 1 ); function ts_custom_stuff( $allowed_functions ) { if ( ! in_array( 'custom_function', $allowed_functions ) ) { $allowed_functions[] = 'custom_function'; } return $allowed_functions; } 3. Insert function in HTML condition. The syntax is tricky, so pay close attention to the quotes and parentheses as shown in the documentation link below. [wpv-conditional if="( 'custom_function()' eq 0 )"] Custom function equals zero! [/wpv-conditional] Relevant Documentation: |
2 | 4 | 5 years, 2 months ago | ||
Question about supplying filter attribute values via a shortcode
Started by: josephC-5
in: Toolset Professional Support
Problem: I would like to know if it is possible to set the options in a custom search filter using a custom shortcode. Solution: It's possible, but you must register the shortcode in Toolset > Settings > Frontend Content > Third party shortcodes. |
2 | 3 | 5 years, 2 months ago | ||
Question about creating a custom search / filter
Started by: josephC-5
in: Toolset Professional Support
Problem: Is there a way to set the default value in the select menu to "All" and have that be an option in the select menu? Solution: Edit your view, in section "Search and Pagination", find the shortcode of [wpv-control-postmeta ...] for field "Price Range", add an attribute default_label="All" in it, for example: [wpv-control-postmeta ... default_label="All"] Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-control-postmeta |
2 | 4 | 5 years, 2 months ago | ||
Conditional issue with multiline custom field
Started by: josephC-5
in: Toolset Professional Support
Problem: I have a custom field named "Artwork Dimensions" that is a multiline input field. In the Content Template that belongs to the View where the Artwork Dimensions field is displayed, I'm using a conditional to test whether it's empty, and if it isn't empty, to display the field: Solution: I suggest you try to modify those codes as below: https://toolset.com/forums/topic/conditional-issue-with-multiline-custom-field/#post-1365213 Relevant Documentation: https://toolset.com/documentation/customizing-sites-using-php/functions/#textarea |
2 | 7 | 5 years, 2 months ago | ||
Creating my own custom field types
Started by: josephC-5
in: Toolset Professional Support
Problem: I want to do is create a field that displays a select / pull-down menu of custom post types and allows a user to choose one. Solution: You can try the custom post reference field Relevant Documentation: |
2 | 3 | 5 years, 2 months ago | ||
Mysterious error importing content through a third-party plugin
1
2
Started by: josephC-5 in: Toolset Professional Support |
3 | 23 | 5 years, 2 months ago | ||
Displaying a custom field group for a specific page
Started by: josephC-5 in: Toolset Professional Support |
2 | 3 | 5 years, 2 months ago | ||
Obtaining the post edit link for a content template
Started by: josephC-5
in: Toolset Professional Support
Problem: On the front-end of my site, I would like to be able to display a link to edit a Content Template in wp-admin. I would like to be able to use this solution across multiple sites, so it should be dynamic. Since I need to know the template ID to create the wp-admin link, I need a way to get the template ID given the template slug. Solution: It will require a custom shortcode. That shortcode should accept the slug of the Content Template you want to edit, and should return a numeric Content Template ID if it exists, or return null if no matching template is found. Use that shortcode to construct a link to the editor in wp-admin. Shortcode: // get a content template id, given the content template slug function tssupp_get_ct_id($atts, $content='') { $atts = shortcode_atts( array( 'slug' => '' ), $atts ); $args = array( 'post_type' => 'view-template', 'post_status' => 'publish', 'name' => $atts['slug'] ); $cts = new WP_Query( $args ); $id = isset($cts->posts[0]->ID) ? $cts->posts[0]->ID : null; return $id; } add_shortcode( 'tssupp-get-ct-id', 'tssupp_get_ct_id'); In the site contents: <a href="/wp-admin/admin.php?page=ct-editor&ct_id=[tssupp-get-ct-id slug='books'][/tssupp-get-ct-id]&action=edit">Edit the Books Content Template</a> Change the slug books to match the slug of the desired Content Template. Change Edit the Books Content Template to display the desired link text. Relevant Documentation: |
2 | 5 | 5 years, 2 months ago | ||
Sorting custom posts based on the names of another custom post.
Started by: josephC-5 in: Toolset Professional Support |
2 | 3 | 5 years, 2 months ago | ||
Setting a default time in a Date field
Started by: josephC-5 in: Toolset Professional Support |
2 | 3 | 5 years, 2 months ago | ||
Sorting posts based on content in a repeatable field group
Started by: josephC-5 in: Toolset Professional Support |
2 | 5 | 5 years, 3 months ago |