Unread files

    • Claudio
      Participant
      # 2 years, 10 months ago

      Hi,

      is it possible in the recent files dashboard to display only files not yet open?

    • Thomas
      Keymaster
      # 2 years, 10 months ago

      Hi,

      You could use the Unread Documents add-on for that. This add-on actually adds an “unread” label on unread posts and an “updated” label on modified posts.

      This is done by adding a post_meta named cuar_ud_post_readers containing an array of users ID that have already seen the post.

      It means that you could use this code snippet to change the queries for the dashboard blocks.

      function cuar_show_unread_files_on_dashboard_only( $args ) {
          $new_args = $args;
      
          $new_args['meta_query'][] =
              array(
                  'key' => 'cuar_ud_post_readers',
                  'value' => get_current_user_id(),
                  'compare' => 'NOT LIKE'
              );
      
          return $new_args;
      }
      add_filter( 'cuar/core/dashboard/block-query-args?slug=customer-private-files', 'cuar_show_unread_files_on_dashboard_only');

      Don’t forget to check our code snippets documentation.

      Regards.

      Want to help WP Customer Area? It only takes few seconds!
      Rate & review the plugin on WordPress.org 🙂

Viewing 1 reply thread

The topic ‘Unread files’ is closed to new replies.