properly fix shortcode calling issues
This commit is contained in:
parent
e33cd2d2fb
commit
dbdfcf055c
|
@ -5,7 +5,7 @@ require_once('ComicPressStoryline.inc');
|
||||||
class ComicPressRelatedPosts {
|
class ComicPressRelatedPosts {
|
||||||
var $related_categories;
|
var $related_categories;
|
||||||
|
|
||||||
function shortcode_related_comics($attrs = '') {
|
function display_related_comics($attrs = '') {
|
||||||
$rp = new ComicPressRelatedPosts();
|
$rp = new ComicPressRelatedPosts();
|
||||||
return $rp->_handle_shortcode(
|
return $rp->_handle_shortcode(
|
||||||
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
|
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
|
||||||
|
@ -13,7 +13,7 @@ class ComicPressRelatedPosts {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function shortcode_related_posts($attrs = '') {
|
function display_related_posts($attrs = '') {
|
||||||
$rp = new ComicPressRelatedPosts();
|
$rp = new ComicPressRelatedPosts();
|
||||||
return $rp->_handle_shortcode(
|
return $rp->_handle_shortcode(
|
||||||
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
|
extract(ComicPressRelatedPosts::_handle_shortcode_attrs($attrs)),
|
||||||
|
@ -121,6 +121,6 @@ class ComicPressRelatedPosts {
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
add_shortcode('related_posts', array('ComicPressRelatedPosts', 'shortcode_related_posts'));
|
add_shortcode('related_posts', array('ComicPressRelatedPosts', 'display_related_posts'));
|
||||||
add_shortcode('related_comics', array('ComicPressRelatedPosts', 'shortcode_related_comics'));
|
add_shortcode('related_comics', array('ComicPressRelatedPosts', 'display_related_comics'));
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
/**
|
/**
|
||||||
* Display post
|
* Display post
|
||||||
* Displays the post info
|
* Displays the post info
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function display_blog_post() {
|
function display_blog_post() {
|
||||||
global $post, $wp_query, $authordata, $comicpress_options; ?>
|
global $post, $wp_query, $authordata, $comicpress_options; ?>
|
||||||
<?php if (is_single()) { ?>
|
<?php if (is_single()) { ?>
|
||||||
<div class="blognav">
|
<div class="blognav">
|
||||||
|
@ -59,19 +59,19 @@ function display_blog_post() {
|
||||||
<?php the_tags(__('└ Tags: ','comicpress'), ', ', '<br />'); ?>
|
<?php the_tags(__('└ Tags: ','comicpress'), ', ', '<br />'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php
|
<?php
|
||||||
if ('open' == $post->comment_status) {
|
if ('open' == $post->comment_status) {
|
||||||
if (comicpress_check_child_file('partials/commentlink') == false && !(is_single())) { ?>
|
if (comicpress_check_child_file('partials/commentlink') == false && !(is_single())) { ?>
|
||||||
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
|
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<?php if ($comicpress_options['enable_related_posts']) echo related_posts_shortcode(); ?>
|
<?php if ($comicpress_options['enable_related_posts']) echo ComicPressRelatedPosts::display_related_posts(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-foot"></div>
|
<div class="post-foot"></div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
/**
|
/**
|
||||||
* Display comic post
|
* Display comic post
|
||||||
* Displays the post info for the comic
|
* Displays the post info for the comic
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function display_comic_post() {
|
function display_comic_post() {
|
||||||
global $post, $wp_query, $authordata, $comicpress_options;
|
global $post, $wp_query, $authordata, $comicpress_options;
|
||||||
$first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink();
|
$first_comic = get_first_comic_permalink(); $last_comic = get_last_comic_permalink();
|
||||||
if (!$comicpress_options['disable_default_comic_nav']) { ?>
|
if (!$comicpress_options['disable_default_comic_nav']) { ?>
|
||||||
|
@ -24,7 +24,7 @@ function display_comic_post() {
|
||||||
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_post_thumbnail('full'); ?></a>
|
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_post_thumbnail('full'); ?></a>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php }
|
||||||
} ?>
|
} ?>
|
||||||
<div class="post-comic-head"></div>
|
<div class="post-comic-head"></div>
|
||||||
<div class="post-comic" id="post-comic-<?php the_ID() ?>">
|
<div class="post-comic" id="post-comic-<?php the_ID() ?>">
|
||||||
<div class="post-comic-info">
|
<div class="post-comic-info">
|
||||||
|
@ -62,19 +62,19 @@ function display_comic_post() {
|
||||||
<?php the_tags(__('└ Tags: ','comicpress'), ', ', '<br />'); ?>
|
<?php the_tags(__('└ Tags: ','comicpress'), ', ', '<br />'); ?>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php
|
<?php
|
||||||
if ('open' == $post->comment_status && !$comicpress_options['static_blog'] && !(is_single())) {
|
if ('open' == $post->comment_status && !$comicpress_options['static_blog'] && !(is_single())) {
|
||||||
if (comicpress_check_child_file('partials/commentlink') == false) { ?>
|
if (comicpress_check_child_file('partials/commentlink') == false) { ?>
|
||||||
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
|
<div class="comment-link"><?php comments_popup_link('<span class="comment-balloon comment-balloon-empty"> </span> '.__('Comments ','comicpress'), '<span class="comment-balloon">1</span> '.__('Comment ','comicpress'), '<span class="comment-balloon">%</span> '.__('Comments ','comicpress')); ?></div>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<?php if ($comicpress_options['enable_related_comics']) echo related_comics_shortcode(); ?>
|
<?php if ($comicpress_options['enable_related_comics']) echo ComicPressRelatedPosts::display_related_comics(); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-comic-foot"></div>
|
<div class="post-comic-foot"></div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* Usage: [related_comics]
|
* Usage: [related_comics]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
function related_comics_shortcode( $atts = '' ) {
|
function related_comics_shortcode( $atts = '' ) {
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
'limit' => '5',
|
'limit' => '5',
|
||||||
|
@ -70,3 +70,4 @@ function related_comics_shortcode( $atts = '' ) {
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
* Usage: [related_posts]
|
* Usage: [related_posts]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
function related_posts_shortcode( $atts = '' ) {
|
function related_posts_shortcode( $atts = '' ) {
|
||||||
extract(shortcode_atts(array(
|
extract(shortcode_atts(array(
|
||||||
'limit' => '5',
|
'limit' => '5',
|
||||||
), $atts));
|
), $atts));
|
||||||
|
|
||||||
global $wpdb, $post, $table_prefix, $category_tree;
|
global $wpdb, $post, $table_prefix, $category_tree;
|
||||||
|
|
||||||
if ($post->ID) {
|
if ($post->ID) {
|
||||||
// Get tags
|
// Get tags
|
||||||
$tags = wp_get_post_tags($post->ID);
|
$tags = wp_get_post_tags($post->ID);
|
||||||
|
@ -32,9 +32,9 @@ function related_posts_shortcode( $atts = '' ) {
|
||||||
GROUP BY tr.object_id
|
GROUP BY tr.object_id
|
||||||
ORDER BY count DESC, p.post_date_gmt DESC
|
ORDER BY count DESC, p.post_date_gmt DESC
|
||||||
LIMIT $limit;";
|
LIMIT $limit;";
|
||||||
|
|
||||||
$related = $wpdb->get_results($q);
|
$related = $wpdb->get_results($q);
|
||||||
|
|
||||||
if ( $related ) {
|
if ( $related ) {
|
||||||
$retval = '
|
$retval = '
|
||||||
<div class="related_posts">
|
<div class="related_posts">
|
||||||
|
@ -71,4 +71,4 @@ function related_posts_shortcode( $atts = '' ) {
|
||||||
|
|
||||||
// add_shortcode('related_posts', 'related_posts_shortcode');
|
// add_shortcode('related_posts', 'related_posts_shortcode');
|
||||||
|
|
||||||
?>
|
?>*/
|
||||||
|
|
Loading…
Reference in New Issue