How to turn off WPUF Custom Fields Meta box on the Backend only

This topic contains 2 reply and 2 voices, and was last updated by ruskie 10 years, 8 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
August 10, 2013 at 11:32 pm 6843
ruskie Hi there, I have created my own backend post form meta boxes, and currently using WPUF custom fields for the Front end forms. This works beautifully, except, that I now have duplicate custom meta boxes in the backend. (1) the first set those being created by myself, and (2) the boxes inserted by WPUF. This is creating a problem when creating/editing the posts in the backend because both sets of the same keys are being evaluated on save post leading to php errors and never ending donut circles on update or save. Again, I only need the ability to turn off the WPUF Custom Fields Box in the backend. There seem to be several things happening: (1) the WPUF Form Select appears on all post types automatically. This adds clutter to the the backend post areas, and using settings to hide them is not really the best solution. Question: Is there a way I can restrict the Post Types this appears on?(action or filter?) Suggestions: Perhaps make the selection of Which Post Types this appears on an option in General Settings. (2) the WPUF Custom Fields Form appears on every post type that supports "custom fields" (both built in as well as custom registered). This creates conflict and errors when there is already a custom meta box on the backend to handle those custom fields. Again hiding their display using the settings on the post type editors is not sufficient. Additionally I can see this getting very messy as when I create meta boxes outside WPUF for the backend I restrict which post types they belong to. It appears that WPUF Custom Fields does not make this distinction (as I assume that they appear for any post type which has "custom fields" enabled on register post type). And while I understand that for those folks who do not create their own metaboxes (backend outside of WPUF) may benefit from this functionality, I really would like a way to turn off WPUF Custom Fields in the Backend. Question: Is there a filter or action that I can use to manage these restrictions etc? Suggestion: Add a Checkbox to each of the Custom Field Fields in the Form builder that enable or disable the creation of that field in the Backend Post Form. I am hoping you can provide some guidance as I really would like to avoid hacking the plugin directly. If there is something obvious that I missed I apologize in advance, but any guidance as to how I can manage especially point 2 would be greatly appreciated.
August 12, 2013 at 4:17 am 6863
Tareq Hasan Tareq Hasan

So you want to turn off the meta boxes, but there isn’t any actions or filters for this. You can remove by deleting or commenting the line 14 in /class/admin-posting.php, which reads following:
[php]add_action( ‘add_meta_boxes’, array($this, ‘add_meta_boxes’) );[/php]

This should solve the problems.

August 16, 2013 at 2:59 am 7001
ruskie ruskie

thanks for your response! I figured that editing the core plugin files would do what i need them to do, unfortunately i was trying to avoid that.

basically it would be nice to have the option to turn on/off the wpuf_custom_fields meta box from post types.. (not the form drop down as this is of course useful). Just a thought, have found a way around it for now.

again, many thanks for your help and fabulous plugin.

Viewing 2 Posts - 1 through 2 (of 2 total)