Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -176,6 +176,7 @@ class WP_List_Table {
|
||||
* Makes private properties readable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Getting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to get.
|
||||
* @return mixed Property.
|
||||
@@ -184,27 +185,44 @@ class WP_List_Table {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Getting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes private properties settable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Setting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to check if set.
|
||||
* @param mixed $value Property value.
|
||||
* @return mixed Newly-set property.
|
||||
*/
|
||||
public function __set( $name, $value ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name = $value;
|
||||
$this->$name = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Setting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes private properties checkable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Checking a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to check if set.
|
||||
* @return bool Whether the property is a back-compat property and it is set.
|
||||
@@ -214,6 +232,12 @@ class WP_List_Table {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
|
||||
'is deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -221,13 +245,22 @@ class WP_List_Table {
|
||||
* Makes private properties un-settable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Unsetting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to unset.
|
||||
*/
|
||||
public function __unset( $name ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
unset( $this->$name );
|
||||
return;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"A property `{$name}` is not declared. Unsetting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -818,6 +851,20 @@ class WP_List_Table {
|
||||
$pending_comments_number
|
||||
);
|
||||
|
||||
$post_object = get_post( $post_id );
|
||||
$edit_post_cap = $post_object ? 'edit_post' : 'edit_posts';
|
||||
if (
|
||||
current_user_can( $edit_post_cap, $post_id ) ||
|
||||
(
|
||||
empty( $post_object->post_password ) &&
|
||||
current_user_can( 'read_post', $post_id )
|
||||
)
|
||||
) {
|
||||
// The user has access to the post and thus can see comments
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $approved_comments && ! $pending_comments ) {
|
||||
// No comments at all.
|
||||
printf(
|
||||
@@ -1370,14 +1417,14 @@ class WP_List_Table {
|
||||
|
||||
if ( ! empty( $columns['cb'] ) ) {
|
||||
static $cb_counter = 1;
|
||||
$columns['cb'] = '<label class="label-covers-full-cell" for="cb-select-all-' . $cb_counter . '">' .
|
||||
$columns['cb'] = '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />
|
||||
<label for="cb-select-all-' . $cb_counter . '">' .
|
||||
'<span class="screen-reader-text">' .
|
||||
/* translators: Hidden accessibility text. */
|
||||
__( 'Select All' ) .
|
||||
'</span>' .
|
||||
'</label>' .
|
||||
'<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
|
||||
$cb_counter++;
|
||||
'</label>';
|
||||
++$cb_counter;
|
||||
}
|
||||
|
||||
foreach ( $columns as $column_key => $column_display_name ) {
|
||||
|
||||
Reference in New Issue
Block a user