field, array(
'disabled' => true,
'enabled_title' => esc_html__( 'Enabled', 'sakurairo_csf' ),
'disabled_title' => esc_html__( 'Disabled', 'sakurairo_csf' ),
) );
echo $this->field_before();
$this->value = ( ! empty( $this->value ) ) ? $this->value : $this->field['default'];
$enabled_options = ( ! empty( $this->value['enabled'] ) ) ? $this->value['enabled'] : array();
$disabled_options = ( ! empty( $this->value['disabled'] ) ) ? $this->value['disabled'] : array();
echo '
';
echo ( $args['disabled'] ) ? '' : '';
echo ( ! empty( $args['enabled_title'] ) ) ? '
'. esc_attr( $args['enabled_title'] ) .'
' : '';
echo '
';
if ( ! empty( $enabled_options ) ) {
foreach ( $enabled_options as $key => $value ) {
echo '';
}
}
echo '
';
// Check for hide/show disabled section
if ( $args['disabled'] ) {
echo '
';
echo '';
echo ( ! empty( $args['disabled_title'] ) ) ? '
'. esc_attr( $args['disabled_title'] ) .'
' : '';
echo '
';
if ( ! empty( $disabled_options ) ) {
foreach ( $disabled_options as $key => $value ) {
echo '';
}
}
echo '
';
echo '
';
}
echo $this->field_after();
}
public function enqueue() {
if ( ! wp_script_is( 'jquery-ui-sortable' ) ) {
wp_enqueue_script( 'jquery-ui-sortable' );
}
}
}
}