X-Git-Url: https://git.danix.xyz/?p=danixland-wporg-stats.git;a=blobdiff_plain;f=danixland-wporg-stats.php;h=f904dff18719feb37d899770b15876515c62deb6;hp=bad3d5cb099cb74ad603aaf65dd8544496fd4003;hb=9893170c7c30599fe1bb9505010c27946968e0d0;hpb=38cb3d1da942201ae9efb1318e81be77325e2037 diff --git a/danixland-wporg-stats.php b/danixland-wporg-stats.php index bad3d5c..f904dff 100644 --- a/danixland-wporg-stats.php +++ b/danixland-wporg-stats.php @@ -324,4 +324,122 @@ class dnx_WPOrg extends WP_Widget { } } +// Add Shortcode +function dnxwporg_stats_shortcode() { + + $author = sanitize_user(get_option('dnxwporg_author'), true); + $description = get_option('dnxwporg_description'); + $desc_content = get_option('dnxwporg_desc_content'); + $linkto = get_option('dnxwporg_linkto'); + $use_icons = get_option('dnxwporg_use_icons'); + + /* we recover the data from the option if it is set, otherwhise we call the retrieve function directly */ + $option_stats = get_option('dnxwporg_plugins_stats'); + $plugins = ( false === $option_stats ? dnxwporg_get_plugins_stats() : $option_stats ); + + ob_start(); ?> + +
%s plugin with %s total downloads and an average rating of ', '%s contributed %s plugins with %s total downloads and an average rating of ', $plugins['total_plugins'], 'dnxwporg' ), $author, $plugins['total_plugins'], $plugins['total_downloads'], $plugins['average_rating'] ); ?>
+ + + ++ + +
+