Skip to content

Commit

Permalink
= 4.2.6.4 =
Browse files Browse the repository at this point in the history
~ Deprecated method row_actions of LP_Order_Post_Type class.
  • Loading branch information
tungnxt89 committed Mar 6, 2024
1 parent 92b3223 commit 5284f0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
8 changes: 5 additions & 3 deletions inc/custom-post-types/abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,19 +654,21 @@ public function _check_post(): bool {
*
* @return bool
* @since 4.1.6.9
* @version 1.0.0
* @version 1.0.1
*/
public function check_post( int $post_id = 0 ): bool {
$can_save = true;

try {
$post = get_post( $post_id );
if ( ! $post ) {
throw new Exception( 'Post is invalid' );
//throw new Exception( 'Post is invalid' );
return false;
}

if ( $this->_post_type !== $post->post_type ) {
throw new Exception( 'Post type is invalid' );
//throw new Exception( 'Post type is invalid' );
return false;
}

if ( ! current_user_can( ADMIN_ROLE ) &&
Expand Down
22 changes: 3 additions & 19 deletions inc/custom-post-types/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,34 +369,18 @@ public function update_status() {
*
* @return mixed
* @since 2.1.7
* @deprecated 4.2.6.4
*/
public function row_actions( $actions, $post ) {
/*public function row_actions( $actions, $post ) {
if ( ! empty( $actions['inline hide-if-no-js'] ) ) {
unset( $actions['inline hide-if-no-js'] );
}
if ( ! empty( $actions['edit'] ) ) {
$actions['edit'] = preg_replace( '/>(.*?)<\/a>/', '>' . __( 'View Order', 'learnpress' ) . '</a>', $actions['edit'] );
}
$order = learn_press_get_order( $post->ID );
if ( $order->is_multi_users() ) {
$actions['child-orders'] = sprintf(
'<a href="%s">%s</a>',
esc_url_raw(
add_query_arg(
array(
'post_type' => LP_ORDER_CPT,
'parent' => $post->ID,
),
admin_url( 'edit.php' )
)
),
__( 'View child orders', 'learnpress' )
);
}

return $actions;
}
}*/

/**
* re-order the orders by newest
Expand Down

0 comments on commit 5284f0c

Please sign in to comment.