: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/* global redux_change, redux, ajaxurl, jQuery */
redux.field_objects = redux.field_objects || {};
redux.field_objects.select = redux.field_objects.select || {};
redux.field_objects.select.init = function( selector ) {
selector = $.redux.getSelector( selector, 'select' );
if ( ! el.hasClass( 'redux-field-container' ) ) {
parent = el.parents( '.redux-field-container:first' );
if ( parent.is( ':hidden' ) ) {
if ( parent.hasClass( 'redux-field-init' ) ) {
parent.removeClass( 'redux-field-init' );
el.find( 'select.redux-select-item' ).each(
if ( $( this ).hasClass( 'font-icons' ) ) {
default_params = $.extend(
templateResult: redux.field_objects.select.addIcon,
templateSelection: redux.field_objects.select.addIcon,
escapeMarkup: function( m ) {
if ( $( this ).data( 'ajax' ) ) {
action = $( this ).data( 'action' );
nonce = $( this ).data( 'nonce' );
wpdata = $( this ).data( 'wp-data' );
min = $( this ).data( 'min-input-length' );
if ( $( this ).data( 'args' ) ) {
data_args = JSON.stringify( $( this ).data( 'args' ) );
data: function( params ) {
processResults: function( data, params ) {
params.page = params.page || 1;
if ( true === data.success ) {
// We'll revisit this later.
// more: ( params.page * 20 ) < data.data.length
} else if ( false === data.success ) {
$( this ).select2( default_params );
el.find( '.select2-search__field' ).width( 'auto' );
if ( $( this ).hasClass( 'select2-sortable' ) ) {
default_params.bindOrder = 'sortableStop';
default_params.sortableOptions = { axis: 'x', placeholder: false };
$( this ).select2Sortable( default_params );
redux_change( $( $( this ) ) );
$( this ).select2SortableOrder();
redux.field_objects.select.addIcon = function( icon ) {
if ( icon.hasOwnProperty( 'id' ) ) {
return '<span class="elusive"><i class="' + icon.id + '"></i> ' + icon.text + '</span>';