[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/plugins/akismet/views/ -> compatible-plugins.php (source)

   1  <?php
   2  
   3  /** @var array|WP_Error $compatible_plugins */
   4  $compatible_plugins = Akismet_Compatible_Plugins::get_installed_compatible_plugins();
   5  if ( is_array( $compatible_plugins ) ) :
   6  
   7      $compatible_plugin_count = count( $compatible_plugins );
   8      ?>
   9      <div class="akismet-card akismet-compatible-plugins">
  10          <div class="akismet-section-header">
  11              <h2 class="akismet-section-header__label  akismet-compatible-plugins__section-header-label" aria-label="<?php esc_attr_e( 'Compatible plugins (new feature)', 'akismet' ); ?>">
  12                  <span class="akismet-compatible-plugins__section-header-label-text"><?php esc_html_e( 'Compatible plugins', 'akismet' ); ?></span>
  13                  <span class="akismet-new-feature"><?php esc_html_e( 'New', 'akismet' ); ?></span>
  14              </h2>
  15          </div>
  16  
  17          <div class="akismet-compatible-plugins__content">
  18              <?php
  19  
  20              echo '<p>';
  21              echo esc_html( __( 'Akismet works with other plugins to keep spam away.', 'akismet' ) );
  22              echo '</p>';
  23  
  24              echo '<p>';
  25  
  26              if ( 0 === $compatible_plugin_count ) {
  27                  echo '<a class="akismet-settings__external-link" href="https://akismet.com/developers/plugins-and-libraries/">';
  28                  echo esc_html( __( 'See supported integrations', 'akismet' ) );
  29                  echo '</a>';
  30              } else {
  31                  echo esc_html(
  32                      _n(
  33                          "The plugin you've installed is compatible. Follow the documentation link to get started.",
  34                          "The plugins you've installed are compatible. Follow the documentation links to get started.",
  35                          $compatible_plugin_count,
  36                          'akismet'
  37                      )
  38                  );
  39              }
  40  
  41              echo '</p>';
  42  
  43              ?>
  44  
  45              <?php if ( ! empty( $compatible_plugins ) ) : ?>
  46                  <ul class="akismet-compatible-plugins__list" id="akismet-compatible-plugins__list">
  47                      <?php
  48  
  49                      foreach ( $compatible_plugins as $compatible_plugin ) :
  50                          if ( empty( $compatible_plugin['help_url'] ) ) {
  51                              continue;
  52                          }
  53  
  54                          ?>
  55                          <li class="akismet-compatible-plugins__card">
  56                              <?php if ( strlen( $compatible_plugin['logo'] ) > 0 ) : ?>
  57                                  <?php
  58  
  59                                  $logo_alt = sprintf(
  60                                      /* translators: The placeholder is the name of a plugin, like "Jetpack" . */
  61                                      __( '%s logo', 'akismet' ),
  62                                      $compatible_plugin['name']
  63                                  );
  64  
  65                                  ?>
  66                                  <img
  67                                      src="<?php echo esc_url( $compatible_plugin['logo'] ); ?>"
  68                                      alt="<?php echo esc_attr( $logo_alt ); ?>"
  69                                      class="akismet-compatible-plugins__card-logo"
  70                                      width="55"
  71                                      height="55"
  72                                  />
  73                              <?php endif ?>
  74                              <div class="akismet-compatible-plugins__card-detail">
  75                                  <h3 class="akismet-compatible-plugins__card-title"><?php echo esc_html( $compatible_plugin['name'] ); ?></h3>
  76                                  <div class="akismet-compatible-plugins__docs">
  77                                      <a
  78                                          class="akismet-settings__external-link"
  79                                          href="<?php echo esc_url( $compatible_plugin['help_url'] ); ?>"
  80                                          aria-label="
  81                                              <?php
  82  
  83                                              echo esc_attr(
  84                                                  sprintf(
  85                                                      /* translators: The placeholder is the name of a plugin, like "Jetpack" . */
  86                                                      __( 'Documentation for %s', 'akismet' ),
  87                                                      $compatible_plugin['name']
  88                                                  )
  89                                              );
  90  
  91                                              ?>
  92                                      "><?php esc_html_e( 'View documentation', 'akismet' ); ?></a>
  93                                  </div>
  94                              </div>
  95                          </li>
  96                      <?php endforeach; ?>
  97                  </ul>
  98  
  99                  <?php if ( $compatible_plugin_count > Akismet_Compatible_Plugins::DEFAULT_VISIBLE_PLUGIN_COUNT ) : ?>
 100                      <button class="akismet-compatible-plugins__show-more"
 101                          aria-expanded="false"
 102                          aria-controls="akismet-compatible-plugins__list"
 103                          data-label-closed="
 104                              <?php
 105  
 106                              /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 107                              echo esc_attr( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 108  
 109                              ?>
 110                          "
 111                          data-label-open="<?php echo esc_attr( __( 'Show less', 'akismet' ) ); ?>">
 112                          <?php
 113  
 114                          /* translators: %d: number of compatible plugins, which is guaranteed to be more than 1. */
 115                          echo esc_html( sprintf( __( 'Show all %d plugins', 'akismet' ), $compatible_plugin_count ) );
 116  
 117                          ?>
 118                      </button>
 119                  <?php endif; ?>
 120  
 121              <?php endif; ?>
 122          </div>
 123      </div>
 124      <?php
 125      endif;


Generated : Sat Jun 7 08:20:01 2025 Cross-referenced by PHPXref