Pat
Admite hilos creados en los últimos 30 días: 0
Debates favoritos del foro
Este usuario no tiene debates favoritos.
Temas del foro creados
Status | Debate | Supporter | Voces | Mensajes | Caducidad |
---|---|---|---|---|---|
How to use Toolset taxonomy as filter in admin
Iniciado por: Pat
en: Toolset Professional Support
Problem: I would like to filter the list of Products by a custom taxonomy in wp-admin. Solution: Add the following custom code to functions.php: function filter_admin_lists_by_taxonomies( $post_type, $which ) { // Array of post type slugs where these filters should appear $filter_types = ['product']; // Array of taxonomy slugs to filter by $taxonomies = ['your-taxonomy-slug']; if ( !in_array( $post_type, $filter_types ) ) return; foreach ( $taxonomies as $taxonomy_slug ) { // Retrieve taxonomy data $taxonomy_obj = get_taxonomy( $taxonomy_slug ); $taxonomy_name = $taxonomy_obj->labels->name; // Retrieve taxonomy terms $terms = get_terms( $taxonomy_slug ); // Display filter HTML echo "<select name='{$taxonomy_slug}' id='{$taxonomy_slug}' class='postform'>"; echo '<option value="">' . sprintf( esc_html__( 'Show All %s', 'text_domain' ), $taxonomy_name ) . '</option>'; foreach ( $terms as $term ) { printf( '<option value="%1$s" %2$s>%3$s (%4$s)</option>', $term->slug, ( ( isset( $_GET[$taxonomy_slug] ) && ( $_GET[$taxonomy_slug] == $term->slug ) ) ? ' selected="selected"' : '' ), $term->name, $term->count ); } echo '</select>'; } } add_action( 'restrict_manage_posts', 'filter_admin_lists_by_taxonomies' , 10, 2); Modify the $filter_types and $taxonomies arrays as needed. Relevant Documentation: |
2 | 3 | hace 6 años, 9 meses | ||
How to display the product cat name
Iniciado por: Pat
en: Toolset Professional Support
Problem: Solution: Relevant Documentation: |
2 | 5 | hace 6 años, 10 meses | ||
Conditional to determine current User’s horoscope sign
1
2
Iniciado por: Pat
en: Toolset Professional Support
Problem: I would like to use a conditional to display different content based on the current User's horoscope sign, based on a User birthdate custom field. Solution: <wpv-loop> [wpv-view name="nested-view-slug" users="[wpv-current-user info='id']"] </wpv-loop> Add the following custom shortcode: add_shortcode( 'is_month_day_between', 'is_month_day_between_func'); function is_month_day_between_func($atts) { // shortcode attributes for timestamps start time, end time, and test time $start = $atts['start']; $end = $atts['end']; $test = $atts['test']; $result = 0; // make new timestamps using the current Year so we can compare $modStart = strtotime(date('d F, ', $start) . date('Y')); $modEnd = strtotime(date('d F, ', $end) . date('Y')); $modTest = strtotime(date('d F, ', $test) . date('Y')); // compare and return 0 or 1 if test is between start and end if(($modStart <= $modTest) && ($modTest <= $modEnd)){ $result = 1; } return $result; } Register 'is_month_day_between' in Toolset > Settings > 3rd party Shortcode Arguments, then you can use it in a conditional that tests the User's birthday against a known range of dates. [wpv-conditional if="([is_month_day_between start='1498247543' end='1440359543' test='[wpv-post-field name='wpcf-date-de-naissance']'] eq '1')"] This month and day is between start and end [/wpv-conditional] [wpv-conditional if="([is_month_day_between start='1498247543' end='1440359543' test='[wpv-post-field name='wpcf-yourdatefieldslug']'] eq '1')" evaluate="false"] This month and day is not between start and end [/wpv-conditional] To account for the first sign, which spans two years, you must use two conditionals that test if the date is between Dec 21 and Dec 31, or if the date is between Jan 1 and Jan 21. |
3 | 20 | hace 6 años, 10 meses | ||
Cred commerce with price calculated
Iniciado por: Pat en: Toolset Professional Support |
2 | 3 | hace 6 años, 10 meses | ||
CRed user form notification sent after a period of time
Iniciado por: Pat en: Toolset Professional Support |
2 | 3 | hace 6 años, 11 meses | ||
Bypass the WordPress image uploader
Iniciado por: Pat
en: Toolset Professional Support
Problem: I would like to add a plugin that rotates images uploaded using CRED. Solution: This type of extension to Toolset is not supported here in the forums, so we have submitted a feature request which will improve CRED to include more robust uploading features. |
2 | 13 | hace 6 años, 11 meses | ||
Cred user notification on user meta does not work
Iniciado por: Pat
en: Toolset Professional Support
Problem: Solution: You can find proposed solution with the following reply: Relevant Documentation: |
2 | 3 | hace 6 años, 11 meses | ||
Impossible to register a site with Toolset
Iniciado por: Pat en: Toolset Professional Support |
2 | 3 | hace 6 años, 11 meses | ||
Custom code to limit parent post selector is not compatible with Select2
Iniciado por: Pat en: Toolset Professional Support |
2 | 6 | hace 6 años, 11 meses | ||
WP_Error::getId() with Types + Cred updates
1
2
Iniciado por: Pat en: Toolset Professional Support |
2 | 20 | hace 6 años, 11 meses | ||
Search on term field
Iniciado por: Pat
en: Toolset Professional Support
Problem: I have a text search form on my View, and I would like to display a message in the results area until the User submits a search term. If no results are found after searching, I would like to display a different message. If results are found, I would like to display the results. Solution: Use the wpv_filter_query_post_process filter to suppress results until the wpv_post_search parameter is supplied. add_filter( 'wpv_filter_query_post_process', 'drop_empty_textsearch_query', 10, 3 ); function drop_empty_textsearch_query( $query, $view_settings, $view_id ) { $ids = array(1, 2, 3, 4); if (in_array($view_id, $ids)){ if ( !isset($_GET['wpv_post_search']) ) { $query->posts = array(); $query->found_posts = 0; $query->post_count = 0; } } return $query; } Add the wpv_post_param shortcode to your theme's functions.php file to access URL parameters: add_shortcode( 'wpv-post-param', 'wpv_post_param_shortcode' ); function wpv_post_param_shortcode( $atts ) { if ( !empty( $atts['var'] ) ) { $var = (array)$_GET[$atts['var']]; return esc_html( implode( ', ', $var ) ); } } In your View's Loop Output editor, create your results design inside the wpv-loop tags. In the "no results found" area, use conditional HTML and your new wpv-post-param shortcode to determine if the wpv_post_search parameter exists, and display different messages. Relevant Documentation: |
2 | 9 | hace 7 años | ||
Robot cleanup notification arrive 4 times !!!
Iniciado por: Pat en: Toolset Professional Support |
2 | 3 | hace 7 años | ||
Adding product categories to menu automatically
Iniciado por: Pat en: Toolset Professional Support |
2 | 4 | hace 7 años | ||
Dcces in product category does not display correct number of pages in pagination
Iniciado por: Pat en: Toolset Professional Support |
2 | 4 | hace 7 años, 1 mes | ||
Embedded video from Dailymotion does not display
Iniciado por: Pat
en: Toolset Professional Support
Problem: Solution: Relevant Documentation: |
2 | 16 | hace 7 años, 1 mes |