make bookmark widget use blog url on home page
This commit is contained in:
parent
2b9ae901d4
commit
4896100fbe
|
@ -154,6 +154,8 @@ class BookmarkWidget extends WP_Widget {
|
||||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
||||||
if (!empty($title)) { echo $before_title . $title . $after_title; };
|
if (!empty($title)) { echo $before_title . $title . $after_title; };
|
||||||
|
|
||||||
|
$link = is_home() ? get_bloginfo('url') : get_permalink($post);
|
||||||
|
|
||||||
$id = 'comic-bookmark-' . md5(rand());
|
$id = 'comic-bookmark-' . md5(rand());
|
||||||
switch ($instance['mode']) {
|
switch ($instance['mode']) {
|
||||||
case 'three-button': ?>
|
case 'three-button': ?>
|
||||||
|
@ -171,7 +173,7 @@ class BookmarkWidget extends WP_Widget {
|
||||||
} ?>
|
} ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function() {
|
(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
|
<?php
|
||||||
$elements = array();
|
$elements = array();
|
||||||
foreach (array_keys($this->text_fields[$instance['mode']]) as $field) {
|
foreach (array_keys($this->text_fields[$instance['mode']]) as $field) {
|
||||||
|
|
Loading…
Reference in New Issue