Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Shortcode */
- function shortcode($args, $instance) {
- $hits = get_option("wphc_data");
- $style = get_option("wphc_style");
- $align = get_option("wphc_align");
- if ($align) {
- $alignment_options = "align='".$align."'";
- }
- echo "<div class='wordpress-hit-counter'".$alignment_options.">";
- if (get_option("wphc_pad_zeros") && strlen($hits) < 7) {
- for ($i = 0; $i < (7 - strlen($hits)); $i++) {
- echo "<img src='".WP_PLUGIN_URL."/wordpress-hit-counter/styles/$style/0.gif'>";
- }
- }
- echo preg_replace("/(\d)/", "<img src='".WP_PLUGIN_URL."/wordpress-hit-counter/styles/$style/$1.gif'>", $hits);
- echo "</div>";
- }
- add_shortcode("wHitCounter", "shortcode");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement