options = get_option( 'mjato' );
?>
prefix, // section ID
'', // title (if needed)
'', // callback function (if needed)
"{$this->prefix}slug" // page slug
);
register_setting(
$this->prefix,
"{$this->prefix}default_status",
array( $this, 'default_status_sanitize' )
);
add_settings_field(
"{$this->prefix}default_status",
__( "Default status", 'mjato' ),
array( $this, 'default_status' ), // function which prints the field
"{$this->prefix}slug", // page slug
$this->prefix, // section ID
array(
'label_for' => "{$this->prefix}default_status",
'class' => "{$this->prefix}row", // for element
)
);
}
public function default_status() {
$statuses = wc_get_order_statuses();
$selected_status = get_option( 'mjato_default_status', 'pending' );
?>