You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is you can not fully modify or alter extrafields when they are being added/updated.
The following hooks exist before the call to the add/update functions are created admin.extrafields.add and admin.extrafields.update
The issue is that all of the functionality of the add/update functions are not exposed.
This is the core function
In extrafields.add we have the following. Which is missing any options to set the custom type. As a work around for adding, it is possible to empty field_name and field_type to prevent adding the extrafield here and issue the function call yourself with a hook.
In extrafields.update we have the following. Again we are lacking access to all the parameters. However without causing the function to detect an error and stop it is not easy to modify this.
I think we need to either expose access to the extra options so they can be modified, Or create new hooks inside of the function calls. I think hooking inside of the functions is not needed honestly, and we could just add variable's to the functions to allow passing data.
The case example here is a plugin I am creating, which extends functionality. I want to have a extrafield labeled as file for uploading, however I want the SQL type to be TEXT because I need room for extra storage of data.
The text was updated successfully, but these errors were encountered:
An alternative would be to match and move the hook for extrafields.update outside of the IF check so it functions the same as extrafields.add Then you can override the core modifying the field.
Of course adding an override variable to prevent these operations to the IF check would probably be the easiest and best solution. Along with moving the hook.
The problem is you can not fully modify or alter extrafields when they are being added/updated.
The following hooks exist before the call to the add/update functions are created admin.extrafields.add and admin.extrafields.update
The issue is that all of the functionality of the add/update functions are not exposed.
This is the core function
In extrafields.add we have the following. Which is missing any options to set the custom type. As a work around for adding, it is possible to empty field_name and field_type to prevent adding the extrafield here and issue the function call yourself with a hook.
In extrafields.update we have the following. Again we are lacking access to all the parameters. However without causing the function to detect an error and stop it is not easy to modify this.
I think we need to either expose access to the extra options so they can be modified, Or create new hooks inside of the function calls. I think hooking inside of the functions is not needed honestly, and we could just add variable's to the functions to allow passing data.
The case example here is a plugin I am creating, which extends functionality. I want to have a extrafield labeled as file for uploading, however I want the SQL type to be TEXT because I need room for extra storage of data.
The text was updated successfully, but these errors were encountered: