Home>Support>Register new admin scripts

Register new admin scripts

Hi! I am try to add some js and css scripts to a custom field, but I am lost, any idea?
Regars!

function initialize() {
add_action( 'siteorigin_widgets_before_widget_select-news', array( $this->id_base, 'enqueue_widget_scripts' ),10,2 );}

function enqueue_widget_scripts($instance, $widget){
    wp_enqueue_style('select2', '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css', [], null);
    wp_enqueue_script('select21', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js', [], null, true);}

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

  1. 6 years, 2 months ago Alex S
    Hi, I Work Here

    Hi Bianqui,

    I’d like to help you with this issue, but unfortunately, this is beyond the scope of the support we’re able to offer on our free forums. There is a fair amount of custom work involved. You could hire a developer to implement this for you.

    We recommend using Codeable. You’ll be able to hire someone at an hourly rate to do this work for you.

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