Use PHP 7.4 featers and PHP 8 polyfills
This commit is contained in:
@ -25,7 +25,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
* @since 2.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $query_class = '\\WP_Ultimo\\Database\\Checkout_Forms\\Checkout_Form_Query';
|
||||
protected $query_class = \WP_Ultimo\Database\Checkout_Forms\Checkout_Form_Query::class;
|
||||
|
||||
/**
|
||||
* Initializes the table.
|
||||
@ -35,15 +35,15 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
public function __construct() {
|
||||
|
||||
parent::__construct(
|
||||
array(
|
||||
[
|
||||
'singular' => __('Checkout Form', 'wp-ultimo'), // singular name of the listed records
|
||||
'plural' => __('Checkout Forms', 'wp-ultimo'), // plural name of the listed records
|
||||
'ajax' => true, // does this table support ajax?
|
||||
'add_new' => array(
|
||||
'add_new' => [
|
||||
'url' => wu_get_form_url('add_new_checkout_form'),
|
||||
'classes' => 'wubox',
|
||||
),
|
||||
)
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
/**
|
||||
@ -55,30 +55,30 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function column_name($item): string {
|
||||
|
||||
$url_atts = array(
|
||||
$url_atts = [
|
||||
'id' => $item->get_id(),
|
||||
'slug' => $item->get_slug(),
|
||||
'model' => 'checkout_form',
|
||||
);
|
||||
];
|
||||
|
||||
$title = sprintf('<strong><a href="%s">%s</a></strong>', wu_network_admin_url('wp-ultimo-edit-checkout-form', $url_atts), $item->get_name());
|
||||
|
||||
$actions = array(
|
||||
$actions = [
|
||||
'edit' => sprintf('<a href="%s">%s</a>', wu_network_admin_url('wp-ultimo-edit-checkout-form', $url_atts), __('Edit', 'wp-ultimo')),
|
||||
'duplicate' => sprintf(
|
||||
'<a href="%s">%s</a>',
|
||||
wu_network_admin_url(
|
||||
'wp-ultimo-checkout-forms',
|
||||
array(
|
||||
[
|
||||
'action' => 'duplicate',
|
||||
'id' => $item->get_id(),
|
||||
)
|
||||
]
|
||||
),
|
||||
__('Duplicate', 'wp-ultimo')
|
||||
),
|
||||
'get_shortcode' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Shortcode', 'wp-ultimo'), wu_get_form_url('shortcode_checkout', $url_atts), __('Shortcode', 'wp-ultimo')),
|
||||
'delete' => sprintf('<a title="%s" class="wubox" href="%s">%s</a>', __('Delete', 'wp-ultimo'), wu_get_form_url('delete_modal', $url_atts), __('Delete', 'wp-ultimo')),
|
||||
);
|
||||
];
|
||||
|
||||
return $title . $this->row_actions($actions);
|
||||
}
|
||||
@ -134,7 +134,7 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
* @since 2.0.0
|
||||
* @return void
|
||||
*/
|
||||
public function process_single_action() {
|
||||
public function process_single_action(): void {
|
||||
|
||||
$bulk_action = $this->current_action();
|
||||
|
||||
@ -169,10 +169,10 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
|
||||
$redirect_url = wu_network_admin_url(
|
||||
'wp-ultimo-edit-checkout-form',
|
||||
array(
|
||||
[
|
||||
'id' => $new_checkout_form->get_id(),
|
||||
'updated' => 1,
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
wp_redirect($redirect_url);
|
||||
@ -189,13 +189,13 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function get_columns() {
|
||||
|
||||
$columns = array(
|
||||
$columns = [
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'name' => __('Form Name', 'wp-ultimo'),
|
||||
'slug' => __('Form Slug', 'wp-ultimo'),
|
||||
'steps' => __('Steps', 'wp-ultimo'),
|
||||
'id' => __('ID', 'wp-ultimo'),
|
||||
);
|
||||
];
|
||||
|
||||
return $columns;
|
||||
}
|
||||
@ -206,9 +206,9 @@ class Checkout_Form_List_Table extends Base_List_Table {
|
||||
*/
|
||||
public function get_filters(): array {
|
||||
|
||||
return array(
|
||||
'filters' => array(),
|
||||
'date_filters' => array(),
|
||||
);
|
||||
return [
|
||||
'filters' => [],
|
||||
'date_filters' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user