'adv-user-crud',
'user_id' => $user_object->ID,
),
admin_url( 'options-general.php' )
)
);
$actions['view_author_posts'] = '' . esc_html__( 'View Author Posts', 'advance-user-post-crud' ) . '';
return $actions;
}
/**
* Add a link in the delete user interface.
*
* @param WP_User $current_user Current user object.
* @param array $userids Array of user IDs being deleted.
*/
public function adv_add_link_delete_user_interface( $current_user, $userids ) {
if ( empty( $userids ) || ! is_array( $userids ) ) {
return;
}
$user_id = (int) reset( $userids );
$url = add_query_arg(
array(
'page' => 'adv-user-crud',
'user_id' => $user_id,
),
admin_url( 'options-general.php' )
);
?>
__( 'Posts per page', 'advance-user-post-crud' ),
'default' => get_option( 'posts_per_page' ),
'option' => 'advance_user_posts_per_page',
)
);
}
/**
* Render the main post count table page.
*/
public function adv_menu_page() {
?>
true,
);
$post_types = get_post_types( $args );
?>
array( 'ID', 'display_name' ),
'number' => $this->max_user,
)
);
foreach ( $users->get_results() as $data => $user ) {
$users_id = $user->ID;
$users_name = $user->display_name;
?>
|
'adv-user-crud',
'user_id' => $users_id,
),
admin_url( 'options-general.php' )
);
?>
|
'attachment',
'post_status' => 'inherit',
'author' => $users_id,
'posts_per_page' => -1,
'fields' => 'ids',
'no_found_rows' => true,
)
);
$attachment_count = (int) $atta_query->post_count;
} else {
$attachment_count = 0;
}
?>
|
$pt_name ) {
$post_count = 0;
if ( 'attachment' !== $pt_name ) {
$post_count = (int) count_user_posts( $users_id, $pt_name );
?>
|
|
%s %s',
esc_html__( 'List of posts, pages and media published by', 'advance-user-post-crud' ),
esc_html( $user_info->user_login )
);
require_once __DIR__ . '/class-list-table.php';
$args = array(
'public' => true,
);
$post_types = get_post_types( $args );
$table_list = new Advance_User_Post_Table_List();
$selected_pt = isset( $_GET['post_type'] ) ? sanitize_text_field( wp_unslash( $_GET['post_type'] ) ) : 'post'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
if ( ! in_array( $selected_pt, $post_types, true ) ) {
$selected_pt = 'post';
}
?>
labels->singular_name ) ) ? $pt_obj->labels->singular_name : $pt_name;
?>