make bookmark widget use blog url on home page

This commit is contained in:
John Bintz 2009-12-20 23:10:04 -05:00
parent 2b9ae901d4
commit 4896100fbe
1 changed files with 3 additions and 1 deletions

View File

@ -154,6 +154,8 @@ class BookmarkWidget extends WP_Widget {
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if (!empty($title)) { echo $before_title . $title . $after_title; };
$link = is_home() ? get_bloginfo('url') : get_permalink($post);
$id = 'comic-bookmark-' . md5(rand());
switch ($instance['mode']) {
case 'three-button': ?>
@ -171,7 +173,7 @@ class BookmarkWidget extends WP_Widget {
} ?>
<script type="text/javascript">
(function() {
ComicBookmark.setup('<?php echo $id ?>', '<?php echo $instance['mode'] ?>', '<?php echo get_permalink($post) ?>', {
ComicBookmark.setup('<?php echo $id ?>', '<?php echo $instance['mode'] ?>', '<?php echo $link ?>', {
<?php
$elements = array();
foreach (array_keys($this->text_fields[$instance['mode']]) as $field) {