wp_star_rating example

<?php                 /* translators: %s: Theme author. */
                printf( __( 'By %s' )$author );
            ?> </span> <?php if ( isset( $theme->screenshot_url ) ) : ?> <img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url . '?ver=' . $theme->version ); ?>" alt="" /> <?php endif; ?> <div class="theme-details"> <?php                 wp_star_rating(
                    array(
                        'rating' => $theme->rating,
                        'type'   => 'percent',
                        'number' => $theme->num_ratings,
                    )
                );
                ?> <div class="theme-version"> <strong><?php _e( 'Version:' ); ?> </strong> <?php echo wp_kses( $theme->version, $themes_allowedtags ); ?> </div> <div class="theme-description">

                    ?> </div> <div class="desc column-description"> <p><?php echo $description; ?></p> <p class="authors"><?php echo $author; ?></p> </div> </div> <div class="plugin-card-bottom"> <div class="vers column-rating"> <?php                     wp_star_rating(
                        array(
                            'rating' => $plugin['rating'],
                            'type'   => 'percent',
                            'number' => $plugin['num_ratings'],
                        )
                    );
                    ?> <span class="num-ratings" aria-hidden="true">(<?php echo number_format_i18n( $plugin['num_ratings'] ); ?>)</span> </div> <div class="column-updated"> <strong><?php _e( 'Last Updated:' ); ?></strong>
$theme->install_url = add_query_arg(
                    array(
                        'theme'    => $theme->slug,
                        '_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),
                    ),
                    $update_php
                );

                $theme->name        = wp_kses( $theme->name, $themes_allowedtags );
                $theme->version     = wp_kses( $theme->version, $themes_allowedtags );
                $theme->description = wp_kses( $theme->description, $themes_allowedtags );
                $theme->stars       = wp_star_rating(
                    array(
                        'rating' => $theme->rating,
                        'type'   => 'percent',
                        'number' => $theme->num_ratings,
                        'echo'   => false,
                    )
                );
                $theme->num_ratings = number_format_i18n( $theme->num_ratings );
                $theme->preview_url = set_url_scheme( $theme->preview_url );

                // Handle themes that are already installed as installed themes.
<?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?> <li><a target="_blank" href="<?php echo esc_url( __( 'https://wordpress.org/plugins/' ) . $api->slug ); ?>/"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a></li> <?php } if ( ! empty( $api->homepage ) ) { ?> <li><a target="_blank" href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage &#187;' ); ?></a></li> <?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?> <li><a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a></li> <?php } ?> </ul> <?php if ( ! empty( $api->rating ) ) { ?> <h3><?php _e( 'Average Rating' ); ?></h3> <?php             wp_star_rating(
                array(
                    'rating' => $api->rating,
                    'type'   => 'percent',
                    'number' => $api->num_ratings,
                )
            );
            ?> <p aria-hidden="true" class="fyi-description"> <?php                 printf(
                    /* translators: %s: Number of ratings. */
                    
'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
                ),
                $customize_url
            );
        }

        $theme->name        = wp_kses( $theme->name, $themes_allowedtags );
        $theme->author      = wp_kses( $theme->author['display_name']$themes_allowedtags );
        $theme->version     = wp_kses( $theme->version, $themes_allowedtags );
        $theme->description = wp_kses( $theme->description, $themes_allowedtags );

        $theme->stars = wp_star_rating(
            array(
                'rating' => $theme->rating,
                'type'   => 'percent',
                'number' => $theme->num_ratings,
                'echo'   => false,
            )
        );

        $theme->num_ratings    = number_format_i18n( $theme->num_ratings );
        $theme->preview_url    = set_url_scheme( $theme->preview_url );
        $theme->compatible_wp  = is_wp_version_compatible( $theme->requires );
        
Home | Imprint | This part of the site doesn't use cookies.