Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterThat's a good idea. The Admin Columns extension is displaying the content in the column only. It hasn't the search feature yet.
Anh Tran
KeymasterHi Lekim,
If you're not very familiar with PHP code, you can use the MB Builder to build your meta boxes. It has an intuitive interface for you to create meta boxes and custom fields.
Can you make a screenshot of the fatal error for me?
Thanks
Anh Tran
KeymasterCan you clarify the "current custom post type"? What is the "current" here?
From your code above, the variable is always set by the if-else statement, so maybe the error is for somewhere else.
If you want to run the code only in the edit screen, you can add condition for the meta boxes, like is_admin(). But in that case the
rwmb_metafunction won't work properly in the frontend. See this for more details.Anh Tran
KeymasterSorry for the late reply. I missed this topic.
I found that you're using 2 fields with the same ID
_gx_flexslider_caption(in the 1st meta box and the 2nd one). That makes Meta Box gets the wrong value for the first group, because the value is get from the 2nd one.Please change the ID of either field. Make sure all fields have unique IDs, even they're in different groups/meta boxes.
Anh Tran
KeymasterI've tested your code and it works just fine: http://prntscr.com/e6t5gi
Did you add some conditions before assigning value to
$content? The error says "Undefined variable: content", so it must be not initialized somewhere.Anh Tran
KeymasterI'm afraid not. The "Attactment Details" popup is created and triggered by JavaScript, while most of our work is PHP.
Anh Tran
KeymasterThis is the list of supported conditions for Include Exclude extension. But if you use it for user profile (with User Meta extension), then you can use only "user_role" and "user_id".
If you want to show/hide fields for a certain ID/groups, you should use the Conditional Logic extension.
See this for the difference between Include/Exclude and Conditional Logic.
Regarding the 2nd question about MB Admin Columns: currently it works only for posts, pages and custom post types.
February 10, 2017 at 10:37 AM in reply to: Page/Post Attributes List is flat and need to indent deferent levels #5035Anh Tran
KeymasterHi Tami, can you please post a screenshot for the Page/Post Attributes? I can't find it in the MB Builder extension.
Anh Tran
KeymasterYou can define the order of your meta boxes only. Doing that by organizing the PHP code.
It's impossible to change the order of other sections in the user profile page, because they's hardcoded by WordPress or other plugins.
Anh Tran
KeymasterUsing
current_user_canonly checks for the role of the current user, not the role of the being edited user. The MB Include Exclude extension can handle that.To make a field required, you can simply add
'required' => true. Docs here and here.Anh Tran
KeymasterIf you want the callback print the content, you can try output buffering, like this:
function hello() { ob_start(); echo 'Your content'; return ob_get_clean(); }This makes the logic of the plugin consistent ('std' vs 'callback').
Anh Tran
KeymasterJust go to your "My Account" page (click on your avatar) and download the "MB Include Exclude" extension.
Also, read this guide to know about automatic update.
Anh Tran
KeymasterHi, I've just updated the Include Exclude extension to support "user_role" and "user_id" rules. Please try this.
Anh Tran
KeymasterHi Dave,
I've just updated the Include Exclude extension. It works with the MB User Meta extension now.
Anh Tran
KeymasterHi, I will work on the Include Exclude extension for that. Currently, it has "user_role" rule (include/exclude meta boxes for a certain user role), but hasn't worked with MB User Meta yet.
-
AuthorPosts