Forum Replies Created
-
AuthorPosts
-
August 29, 2020 at 12:32 PM in reply to: ✅How do display CPT with selected taxonomy anywhere on the site? #21520
Long Nguyen
ModeratorHi,
To get posts by custom taxonomy, please use the argument
tax_query. Here is the sample code:{% set args = { post_type: 'testimonials', posts_per_page: 20, tax_query: [ { taxonomy: 'testimonial_category', field: 'slug', terms: 'planning' } ] } %}For more information about arguments, please follow this documentation https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters.
August 29, 2020 at 10:53 AM in reply to: ✅Duplicate confirmation message when you have multiple mb_user_profile_info on on #21519Long Nguyen
ModeratorHi,
If you have several meta boxes and display on one user profile page, please use the attribute
idwith meta box ids and commas instead of using more shortcodes on one page.Current case:
[mb_user_profile_info id="meta-box-id1" submit_button="Submit" confirmation="Your information has been successfully submitted. Thank you."] [mb_user_profile_info id="meta-box-id2" submit_button="Submit" confirmation="Your information has been successfully submitted. Thank you."]Recommend:
[mb_user_profile_info id="meta-box-id1, meta-box-id2" submit_button="Submit" confirmation="Your information has been successfully submitted. Thank you."]For more information, please follow this documentation https://docs.metabox.io/extensions/mb-user-profile/#edit-profile-form.
Long Nguyen
ModeratorHi Toni,
Yes, we can call a PHP function via the proxy
mbin the view. Use this code to show values that are stored in the custom table.{{mb.rwmb_meta( $field_id, {'storage_type': 'custom_table', 'table': $table_name} )}}For more information, please follow this documentation https://docs.metabox.io/extensions/mb-views/#running-php-functions.
Long Nguyen
ModeratorHi Eddy,
If you want to apply a view for all term archives of a taxonomy, please set the location Taxonomy Archive - All. See my screenshot https://share.getcloudapp.com/Kour1pv8.
Then you can edit the term to get the link of the archive page https://share.getcloudapp.com/qGuNxQAP.
August 28, 2020 at 12:30 PM in reply to: ✅How do display CPT with selected taxonomy anywhere on the site? #21507Long Nguyen
ModeratorHi Adam,
To apply the view for a specific term archive, please use the Location > Select Taxonomy Archive > Select a term. See my screenshot https://share.getcloudapp.com/Z4ukDPrD.
Long Nguyen
ModeratorHi Rubber,
To get the element URL of the array which is returned by the helper function, please use it inside the single quote
$image['url'].Please check the documentation https://docs.metabox.io/fields/single-image/#template-usage.
Long Nguyen
ModeratorHi,
The problem is the shortcode was wrapped in the
<pre> <code>tag so it just shows the text https://share.getcloudapp.com/jkuZXXdR. In the Block Editor, please use the blockshortcodeto add the frontend shortcode. In the Classic Editor, please switch to the tab Text to add the shortcode. See my screenshots:
https://share.getcloudapp.com/9ZuXom6z
https://share.getcloudapp.com/L1uJXRm4Let me know how it goes.
Long Nguyen
ModeratorHi,
This Javascript code will do the trick.
jQuery(document).ready(function($) { $.each($('.rwmb-row .rwmb-column'), function(index, el) { var _this = $(this); if( _this.hasClass('custom-css') ) { var customClass = $(this).attr('class').split(' ').pop(); _this.parent('.rwmb-row').addClass(customClass); } }); });You need to add the custom CSS for the column like the documentation with the format
custom-css your-css-class'columns' => array( 'column-1' => 4, // Simply define the size of the column (from 1 to 12) 'column-2' => array( // More advanced syntax 'size' => 8, // Column size (1-12) 'class' => 'custom-css custom-column-2', // Custom CSS class for the column ), ),The JavaScript code will check if the column has class
custom-cssand copyyour-css-classto the row. See my screenshot https://share.getcloudapp.com/RBuOm0OD.Then you can style the row with the selector
.rwmb-row.your-css-class.Long Nguyen
ModeratorHi,
The class
rwmb-rowis generated by the extension MB Columns. Currently, the extension only supports to add the custom class to each column to apply the style for the column.For more information, please follow this documentation https://docs.metabox.io/extensions/meta-box-columns/#advanced-syntax.
Long Nguyen
ModeratorHi,
Some media fields like
image_advanced,single_image,file_advanced... use an input type hidden to store the media information and field settings. It does not like other visual fields such astextortextareawhere the input is visible and scrolls down when the validation fires.I'm going to create a feature request for the developer team to improve the user experience in this case. Thank you.
Long Nguyen
ModeratorHi Will,
The helper function can get the field's value in the admin area that is stored in the custom table. But you need hooking to
initwith the higher priority such as 99 or a hook fires afterinitto make sure the table and meta boxes are registered. Here is the sample code:add_action( 'init', function() { $field = rwmb_meta( $field_id, ['storage_type' => 'custom_table', 'table' => $table], $post_id ); echo "<pre>"; print_r($field); echo "</pre>"; }, 99 );For more WordPress Hooks Firing Sequence information, please follow this article http://rachievee.com/the-wordpress-hooks-firing-sequence/.
August 26, 2020 at 9:32 AM in reply to: ✅Heads up on COLOR PICKER/ALPHA CHANNEL javascript error (Due to WP 5.5) #21469Long Nguyen
ModeratorHi,
Meta Box uses WP Color Picker Alpha as a library as many themes/plugins. This issue has been noticed and the developer has created a pull request to fix it https://github.com/kallookoo/wp-color-picker-alpha/pull/38. We are waiting for this PR will be merged and update the new version of Meta Box.
Thanks for your code, it will help other users for temporary fixing.
Long Nguyen
ModeratorHi,
Thank you for your report.
The plugin name is "Meta Box", there is a space between "Meta" and "Box", the slug of this plugin on WordPress.org storage has a hyphen https://wordpress.org/plugins/meta-box. It also is the official name in WordPress developer documentation https://developer.wordpress.org/plugins/metadata/custom-meta-boxes/#what-is-a-meta-box.
Long Nguyen
ModeratorHi,
Yes, it is a simple way to show the field's value. If it is empty, show the field setting
stdor anything you want, if not, show the field value.Long Nguyen
ModeratorHi,
This article might help you to restrict Media Library access to the user's own uploads https://www.wpbeginner.com/plugins/how-to-restrict-media-library-access-to-users-own-uploads-in-wordpress/.
-
AuthorPosts