public/wordpress/wp-content/plugins/wp-courseware/includes/controllers/units.php
/**
	 * Post Type Permission Filter Count.
	 *
	 * @since 4.4.0
	 *
	 * @param \WP_Screen $current_screen The current screen
	 */
Post Type Permission Filter Count.


Post Type Permission Filter Count .
public function post_type_permission_filter_count( $current_screen ) {
		if ( $current_screen->id != 'edit-' . $this->post_type_slug ) {
			return $current_screen;
		}
		$current_user = wp_get_current_user();
		 permission
		if ( ! user_can( $current_user->ID, 'manage_wpcw_settings' ) ) {
			add_filter( "views_{$current_screen->id}", array( $this, 'post_type_permission_filter_change_count' ) );
		}
	}
public function post_type_permission_filter_count ( $ current_screen ) { if ( $ current_screen -> id != 'edit-' . $ this -> post_type_slug ) { return $ current_screen ; } $ current_user = wp_get_current_user ( ) ; if ( ! user_can ( $ current_user -> ID , 'manage_wpcw_settings' ) ) { add_filter ( " views_ { $ current_screen -> id } " , array ( $ this , 'post_type_permission_filter_change_count' ) ) ; } }
Post Type Permission Filter Count.
Post Type Permission Filter Count .
// Check // Get Current user // Check permission