Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Mark, you can add params to the
query_argsto specify the order like'orderby' => 'post_title'.Anh Tran
KeymasterI'm not sure I get what you want! I think using WPML for translation always put something in the DB.
Maybe you should localize your theme/plugin using .po file. Then use poEdit to make translation. That way there's nothing stored in the DB (and you also don't use WPML).
Anh Tran
KeymasterFrom the error above, I guess the problem isn't the code. Probably one of the selected term was deleted or not available. That's why it returns an
WP_Errorobject. Please check that.Anh Tran
KeymasterDid you try this docs? https://wpml.org/documentation/getting-started-guide/string-translation/
Anh Tran
KeymasterSorry, I was thinking this issue is on Github and track there. Please post the code you use to register meta boxes.
Anh Tran
KeymasterI see!
Does your code above work? Because if you set your custom column sortable that way, WordPress simply sets
orderby=navnand you have to hook topre_get_poststo filter by that.By the way, to add sortable columns, you don't need to add a new filter to the extension. WordPress has that filter already (that the extension uses). You can refer to this article for more info:
https://code.tutsplus.com/articles/quick-tip-make-your-custom-column-sortable--wp-25095
Anh Tran
KeymasterHi Dave,
Both plugins work well together without doing anything. Just remember to setup the field ID in MB User Meta match the meta field in Gravity Forms.
Anh Tran
KeymasterI answered Dave via email. If anyone is interested in this, the answer is yes. Please just purchase the Developer Bundle and I will refund the part for Core Bundle.
November 12, 2016 at 9:52 AM in reply to: The WYSIWYG has white color in the content and missing the toolbar when repeating #4476Anh Tran
KeymasterHi, can you please post the code you're using to register meta box? The old problem was resolved and I test with the original code in this thread again and it works.
Anh Tran
KeymasterYou can use this code:
$groups = rwmb_meta( 'group_id' ); $first_group = !empty( $groups ) && is_array( $groups ) ? reset( $groups ) : array(); $images = !empty( $first_group['album_images'] ) && is_array( $first_group['album_images'] ) ? $first_group['album_images'] : array(); $first_image = !empty( $images ) && is_array( images ) ? reset( $images ) : 0; echo wp_get_attachment_image( $first_image, 'thumbnail' );PS: Are you using the Group extension? I see you didn't purchase it.
Anh Tran
KeymasterI think the filter should be:
$query->set( 'orderby', 'meta_value' ); $query->set( 'meta_key', 'mm_fornavn' ); $query->set( 'order', 'ASC' );For more info about the params, please read the Codex about WP_Query class.
Anh Tran
KeymasterUnfortunately, we have only the online version of the documentation. We regularly update the documentation (with new parameters/tutorials) and the online documentation helps us to provide the content to users better.
Anh Tran
KeymasterHi,
For custom column that you created, you must specify the way to query the data to sort them. You might want to add a hook to
pre_get_postsin the class constructor and then filter the query, like this:class Prefix_Custom_Admin_Columns extends MB_Admin_Columns_Post { function __construct() { parent::__construct(); add_action( 'pre_get_posts', array( $this, 'filter' ) ); } // Other methods function filter( $query ) { // Sample code to sort the data $query->set( 'orderby', 'post_date' ); $query->set( 'order', 'ASC' ); } }Anh Tran
KeymasterThere's no direct way to query post by sub-fields of a group. Because the data is stored as a serialized array in the post meta. You might want to refer to some techniques to solve this:
https://support.metabox.io/topic/reverse-query-on-clonable-post-metabox/
https://support.metabox.io/topic/new-field-class-hooking-to-rwmb_after_save_post/
https://support.metabox.io/topic/use-repeatable-meta-box-field-for-query-orderby/Anh Tran
KeymasterOk, no problem. It's done.
-
AuthorPosts