Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterGreat link! Thanks for letting me know. I will check that.
Anh Tran
KeymasterHi Dave,
I've just tried the Admin Columns free version and it finds registered fields. What field types are you using? Because of different ways of storing data in the post meta, I think this plugin works only with the basic field types (such as text, wysiwyg, select, radio, etc.).
Anh Tran
KeymasterLooks like a compatibility with PHP 5.2. I've updated the extension, please try again.
Anh Tran
KeymasterA simple solution is creating 2 meta boxes: 1 for your
testtypewhere you use$content, 1 for the other post type.Anh Tran
KeymasterI've seen Jetpack plugin do that. Not sure if there's any solution in general for that.
Anh Tran
KeymasterI couldn't replicate the issue. Here is my screencast:
Anh Tran
KeymasterJust looked at the issue and found that WordPress doesn't validate the user edit form. So the
requiredattribute doesn't work.You need to use Validation rules, like this:
'validation' => array( 'rules' => array( $prefix . 'structure_name' => array( 'required' => true, ), ), )However, this requires the latest development version on Github. I've just added support for user edit form and term edit form in the core.
Anh Tran
KeymasterHi, I couldn't replicate the bug. Can you post your code to register meta boxes?
Anh Tran
KeymasterThe WordPress core doesn't support that. We need to create a custom code for that. I will update the plugin to support that soon.
Anh Tran
KeymasterHi,
A. Is my basic view of what Metabox can do right?
The plugin only does the job of creating meta boxes and custom fields in the admin area. It doesn't handle the automatic showing the custom fields values in the frontend (because it depends on where you want to show them or how you want to use them).
I think it's half of what you want.
B. How do I get the customer fields visible in the frontend?
Please follow this documentation: https://metabox.io/docs/get-meta-value/
This was the text of the notice with the fatal error:
Can you give me more details on the error?
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. -
AuthorPosts