Skip to content

Commit

Permalink
Change display for vetted plugins and themes
Browse files Browse the repository at this point in the history
  • Loading branch information
xxsimoxx committed Jul 1, 2024
1 parent 9b122bd commit 3df4184
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions classes/PluginInstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,14 +391,16 @@ public function render_menu()
foreach ( $plugins as $plugin ) {
$slug = $plugin['meta']['slug'];
$content = $plugin['content']['rendered'];
$vetted = $plugin['meta']['cpcs_status'] === 'passing' ? '<span class="dashicons dashicons-shield"></span>' : '';
$vetted_article = $plugin['meta']['cpcs_status'] === 'passing' ? ' vetted-plugin' : '';
$markdown_contents = self::get_markdown_contents( $content, '<div class="markdown-heading">', '</div>' );
foreach ( $markdown_contents as $markdown_content ) {
$content = str_replace( '<div class="markdown-heading">' . $markdown_content . '</div>', $markdown_content, $content );
}
?>
<article class="cp-plugin-card" id="cp-plugin-id-<?php echo esc_attr($slug); ?>">
<article class="cp-plugin-card<?php echo esc_attr($vetted_article); ?>" id="cp-plugin-id-<?php echo esc_attr($slug); ?>">
<header class="cp-plugin-card-header">
<h3><?php echo esc_html($plugin['title']['rendered']); ?></h3>
<h3><?php echo esc_html($plugin['title']['rendered']); echo wp_kses_post($vetted); ?></h3>

Check failure on line 403 in classes/PluginInstall.class.php

View workflow job for this annotation

GitHub Actions / CPCS

Inline PHP statement must contain a single statement; 2 found
<div class="cp-plugin-author"><?php echo wp_kses(sprintf(__('By <b>%1$s</b>.', 'classicpress-directory-integration'), $plugin['meta']['developer_name']), ['b' => []]); ?></div>
</header>
<div class="cp-plugin-card-body">
Expand Down
6 changes: 4 additions & 2 deletions classes/ThemeInstall.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,16 @@ public function render_menu()
foreach ($themes as $theme) {
$slug = $theme['meta']['slug'];
$content = $theme['content']['rendered'];
$vetted = $theme['meta']['cpcs_status'] === 'passing' ? '<span class="vetted-theme dashicons dashicons-shield"></span>' : '';
$vetted_article = $theme['meta']['cpcs_status'] === 'passing' ? ' vetted-theme' : '';
$markdown_contents = self::get_markdown_contents( $content, '<div class="markdown-heading">', '</div>' );
foreach ( $markdown_contents as $markdown_content ) {
$content = str_replace( '<div class="markdown-heading">' . $markdown_content . '</div>', $markdown_content, $content );
}
?>
<article class="cp-plugin-card" id="cp-plugin-id-<?php echo esc_attr($slug); ?>">
<article class="cp-plugin-card<?php echo esc_attr($vetted_article); ?>" id="cp-plugin-id-<?php echo esc_attr($slug); ?>">
<header class="cp-plugin-card-header">
<h3><?php echo esc_html($theme['title']['rendered']); ?></h3>
<h3><?php echo esc_html($theme['title']['rendered']); echo wp_kses_post($vetted); ?></h3>

Check failure on line 400 in classes/ThemeInstall.class.php

View workflow job for this annotation

GitHub Actions / CPCS

Inline PHP statement must contain a single statement; 2 found
<div class="cp-plugin-author"><?php echo wp_kses(sprintf(__('By <b>%1$s</b>.', 'classicpress-directory-integration'), $theme['meta']['developer_name']), ['b' => []]); ?></div>
</header>
<div class="cp-plugin-card-body">
Expand Down
11 changes: 11 additions & 0 deletions styles/directory-integration.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@
background-color: #fafafa;
}

.vetted-plugin .dashicons,
.vetted-theme .dashicons{
float: right;
color: #057f99;
}

.vetted-plugin,
.vetted-theme {
background-color: #EBF4F7;
}

#plugin-install-from-modal {
float: right;
margin-top: -2px;
Expand Down

0 comments on commit 3df4184

Please sign in to comment.