Hiding the list of users on a private file

    • Adam taylor
      Participant
      # il y a 5 mois et 4 semaines

      Hi, I’m using the Additional Owner Types add-on and would like to hide the list of users and which user groups that subscribers can see under the “Assigned To” header when inside a private file.

       

       

    • Clément Nicolas
      Maître des clés
      # il y a 5 mois et 4 semaines

       

      Templates are the key to customizing the private area of the frontend. Please refer to our documentation on the template system: you’ll learn how to find the right template, copy it and modify it.

      For example, if you want to delete the “Assigned to” thumbnails, here’s what you need to do:

      – The template file (for the header of a private file) is: customer-area/src/php/core-addons/customer-private-files/templates/customer-private-files-single-post-header.template.php

      – This contains all the code used to display these statistics and information at the top of the page. You can replace it by creating the file wp-content/customer-area/templates/customer-private-files-single-post-header.template.php and replacing it with the content below.

      Please note: the path is wp-content/customer-area, not wp-content/plugins/customer-area.

      <?php
      
      /** Template version: 3.4.1
       *
       * -= 3.4.1 =-
       * - Entire customized template
       *
       */
      ?>
      
      <?php
      $pf_addon = cuar_addon('customer-private-files');
      $po_addon = cuar_addon('post-owner');
      
      $post_id = get_the_ID();
      
      $date = get_the_date();
      $date_month = get_the_date('m');
      $date_year = get_the_date('Y');
      $date_url_year = $pf_addon->get_date_archive_url($date_year);
      $date_url_month = $pf_addon->get_date_archive_url($date_year, $date_month);
      
      $categories = get_the_terms($post_id, 'cuar_private_file_category');
      if ($categories) {
          $category_url = $pf_addon->get_category_archive_url($categories[0]);
          $category_name = $categories[0]->name;
      }
      
      $author_id = get_the_author_meta('ID');
      $author_name = get_the_author_meta('display_name');
      $author_email = get_the_author_meta('user_email');
      $author_biography = get_the_author_meta('description');
      $author_website = get_the_author_meta('user_url');
      $author_avatar = get_avatar($author_email, 64);
      $author_url = $pf_addon->get_author_archive_url($author_id);
      $author_submenu_links = $po_addon->get_owner_submenu_links($author_id, 'usr');
      
      ?>
      
      <div class="cuar-single-post-header row mb-md cuar-clearfix">
          <div class="cuar-js-slick-responsive">
      
              <?php do_action('cuar/private-content/view/carousel/before-author', $post_id); ?>
      
              <div class="cuar-author cuar-js-slick-slide-item slick-slide-item">
                  <div class="panel panel-tile cuar-panel-meta-tile">
                      <div class="panel-body">
                          <i class="fa fa-id-badge icon-bg"></i>
                          <div class="cuar-meta-label">
                              <span><?php _e('Author', 'cuar'); ?></span>
                          </div>
                          <div class="cuar-meta-value">
                              <div class="cuar-panel-meta-tile-sub-head mb5">
                                  <?php if ($author_avatar) : ?>
                                      <div class="cuar-panel-meta-tile-avatar pull-left mr-xs">
                                          <?php echo $author_avatar; ?>
                                      </div>
                                  <?php endif; ?>
      
                                  <span class="cuar-meta-tile-info">
                                      <?php echo $author_name; ?>
                                  </span>
                              </div>
      
                              <div class="cuar-panel-meta-tile-links">
                                  <?php if ($author_website) : ?>
                                      <div class="cuar-author-website cuar-meta-link mr5 pull-left">
                                          <a href="<?php echo esc_url($author_website); ?>" class="btn btn-xs btn-default" target="_BLANK" title="<?php echo esc_attr(sprintf(__('Show %s\'s website', 'cuar'), $author_name)); ?>">
                                              <i class="fa fa-link pn"></i>
                                          </a>
                                      </div>
                                  <?php endif; ?>
                                  <div class="cuar-author-archives-url cuar-meta-link mr5 pull-left">
                                      <a href="<?php echo esc_url($author_url); ?>" class="btn btn-xs btn-default" title="<?php echo esc_attr(sprintf(__('Show all similar contents from %s', 'cuar'), $author_name)); ?>">
                                          <i class="fa fa-th-list pn"></i>
                                      </a>
                                  </div>
                                  <?php if ($author_submenu_links) { ?>
                                      <div class="cuar-author-more cuar-js-dropdown-in-overflow cuar-meta-link mr5 pull-left">
                                          <a href="#" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                              <i class="fa fa-ellipsis-h pn"></i> <?php _e('More', 'cuar'); ?>
                                          </a>
                                          <ul class="cuar-js-dropdown-in-overflow-menu dropdown-menu">
                                              <?php foreach ($author_submenu_links as $author_link) { ?>
                                                  <li>
                                                      <a href="<?php echo esc_url($author_link['url']); ?>" title="<?php echo esc_attr($author_link['tooltip']); ?>" class="<?php echo esc_attr($author_link['extra_class']); ?>">
                                                          <?php echo $author_link['title']; ?>
                                                      </a>
                                                  </li>
                                              <?php } ?>
                                          </ul>
                                      </div>
                                  <?php } ?>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
      
              <?php do_action('cuar/private-content/view/carousel/before-date', $post_id); ?>
      
              <div class="cuar-date cuar-js-slick-slide-item slick-slide-item">
                  <div class="panel panel-tile cuar-panel-meta-tile">
                      <div class="panel-body">
                          <i class="fa fa-calendar icon-bg"></i>
                          <div class="cuar-meta-label">
                              <span>
                                  <?php _e('Date', 'cuar'); ?>
                              </span>
                          </div>
                          <div class="cuar-meta-value">
                              <div class="cuar-panel-meta-tile-sub-head mb5">
                                  <span class="cuar-meta-tile-info">
                                      <?php echo $date; ?>
                                  </span>
                              </div>
                              <div class="cuar-panel-meta-tile-links">
                                  <div class="cuar-date-month cuar-meta-link mr5 pull-left">
                                      <a href="<?php echo esc_url($date_url_month); ?>" class="btn btn-xs btn-default" title="<?php echo esc_attr(sprintf(__('Show all similar contents published in %2$s %1$s', 'cuar'), $date_year, $date_month)); ?>">
                                          <i class="fa fa-calendar pn"></i> <?php _e('Month archives', 'cuar'); ?>
                                      </a>
                                  </div>
                                  <div class="cuar-date-year cuar-meta-link mr5 pull-left">
                                      <a href="<?php echo esc_url($date_url_year); ?>" class="btn btn-xs btn-default" title="<?php echo esc_attr(sprintf(__('Show all similar contents published in %1$s', 'cuar'), $date_year)); ?>">
                                          <i class="fa fa-calendar-o pn"></i> <?php _e('Year archives', 'cuar'); ?>
                                      </a>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
      
              <?php do_action('cuar/private-content/view/carousel/before-category', $post_id); ?>
      
              <?php if ($categories) { ?>
      
                  <div class="cuar-category cuar-js-slick-slide-item slick-slide-item">
                      <div class="panel panel-tile cuar-panel-meta-tile">
                          <div class="panel-body">
                              <i class="fa fa-tag icon-bg"></i>
                              <div class="cuar-meta-label">
                                  <span>
                                      <?php _e('Category', 'cuar'); ?>
                                  </span>
                              </div>
                              <div class="cuar-meta-value">
                                  <div class="cuar-panel-meta-tile-sub-head mb5">
                                      <span class="cuar-meta-tile-info">
                                          <?php _e('Posted in', 'cuar') ?>
                                      </span>
                                  </div>
                                  <div class="cuar-panel-meta-tile-links">
                                      <div class="cuar-category-link cuar-meta-link mr5 pull-left">
                                          <a href="<?php echo esc_url($category_url); ?>" class="btn btn-xs btn-default" title="<?php echo esc_attr(sprintf(__('Show all similar contents published in category: %1$s', 'cuar'), $category_name)); ?>">
                                              <i class="fa fa-tag pn"></i> <?php echo $category_name; ?>
                                          </a>
                                      </div>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
      
              <?php } ?>
      
              <?php do_action('cuar/private-content/view/carousel/before-owners', $post_id); ?>
      
              <?php do_action('cuar/private-content/view/carousel/after-owners', $post_id); ?>
      
          </div>
      </div>
      ?>

      It’s a good idea to keep a comment block including the version number when you edit a template, so WPCA will be notified if we update a template you’ve replaced.

       

      Regards,

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

      • Adam taylor
        Participant
        # il y a 5 mois et 3 semaines

        Thanks for this, it works perfectly.

Vous lisez 1 fil de discussion

The topic ‘Hiding the list of users on a private file’ is closed to new replies.