Home>Support>How to override existing field?

How to override existing field?

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

First, many many thanks for developing the plugin.

I want to make a custom field for the existing field type “color”, the default from Siteorigin widget bundle. Basically, what I need to create my own UI and backend logic for the color field type. As this field is used in many places, if I could override the field type directly, will automatically work in every place.

Can you please point some actions or filters so that, I can de-register and re-register with the same type “color”? Or if any other workaround. Please help!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 1 month ago Sukanta Paul

    Hello, please anybody here to help?

  2. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Sukanta,

    According to the development team, this is theoretically possible but it may not be very reliable as this functionality was never specifically designed for. As such, I would recommend creating a new form field and overriding the widgets where needed – this isn’t really ideal and for that, I’m sorry.

    Regardless, to do this you’ll need to define your form field in both the siteorigin_widgets_field_class_prefixes filter and siteorigin_widgets_field_class_paths.

  3. 7 years, 1 month ago Sukanta Paul

    Thank you for replying. I know what you mean, I’ve already looked into the source code and did some research. Already tried to do that. But you know what:

    $form_options = apply_filters( 'siteorigin_widgets_form_options', $form_options, $this );
    $form_options = apply_filters( 'siteorigin_widgets_form_options_' . $this->id_base, $form_options, $this );

    These filters don’t work as expected. Check out my question at StackOverflow. For now, I believe the accepted answer there is the only workaround to achieve this. I’ve also explained why someone needs to override field type (I needed too for my own application).

    I believe this is a serious bug in your application. Please try to fix it on your next release maybe.

  4. 7 years, 1 month ago Alex S
    Hi, I Work Here

    Hi Sukanta,

    I’ve logged this here: https://github.com/siteorigin/so-widgets-bundle/issues/711

    If you’re up for it, consider submitting a Pull Request with the desired fix/changes.

    We can’t provide any sort of ETA on when this will be fixed but I can state it’s unlikely to be in the next update due to the release window we currently have in mind and this issue doesn’t affect the average user – sorry mate.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More