本文整理汇总了PHP中bbp_topic_permalink函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_topic_permalink函数的具体用法?PHP bbp_topic_permalink怎么用?PHP bbp_topic_permalink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_topic_permalink函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_bbp_get_topic_permalink
/**
* @covers ::bbp_topic_permalink
* @covers ::bbp_get_topic_permalink
*/
public function test_bbp_get_topic_permalink()
{
if (is_multisite()) {
$this->markTestSkipped('Skipping URL tests in multiste for now.');
}
$f = $this->factory->forum->create();
$t = $this->factory->topic->create(array('post_title' => 'Topic 1', 'post_parent' => $f, 'topic_meta' => array('forum_id' => $f)));
$topic_permalink = bbp_get_topic_permalink($t);
$this->expectOutputString($topic_permalink);
bbp_topic_permalink($t);
$this->assertSame('http://' . WP_TESTS_DOMAIN . '/?topic=topic-1', $topic_permalink);
}
示例2: do_action
</span>
<?php
}
?>
<?php
}
?>
<?php
do_action('bbp_theme_before_topic_title');
?>
<a class="bbp-topic-permalink" href="<?php
bbp_topic_permalink();
?>
"><?php
bbp_topic_title();
?>
</a>
<?php
do_action('bbp_theme_after_topic_title');
?>
<?php
bbp_topic_pagination();
?>
<?php
示例3: bbp_reply_url
<div class="bbp-reply-content">
<div class="bbp-reply-header">
<div class="bbp-meta">
<a href="<?php
bbp_reply_url();
?>
" class="bbp-reply-permalink">#<?php
bbp_reply_id();
?>
</a>
<span class="bbp-reply-to"><?php
_e('In reply to: ', 'bbpress');
?>
<a class="bbp-topic-permalink" href="<?php
bbp_topic_permalink(bbp_get_reply_topic_id());
?>
"><?php
bbp_topic_title(bbp_get_reply_topic_id());
?>
</a> | </span>
</div>
</div>
<div class="bbp-reply-entry">
<?php
do_action('bbp_theme_before_reply_content');
?>
<?php
示例4: bbp_display_topics_feed_rss2
//.........这里部分代码省略.........
</link>
<description><?php
//
?>
</description>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
?>
</pubDate>
<generator>http://bbpress.org/?v=<?php
bbp_version();
?>
</generator>
<language><?php
bloginfo_rss('language');
?>
</language>
<?php
do_action('bbp_feed_head');
?>
<?php
if (bbp_has_topics($topics_query)) {
?>
<?php
while (bbp_topics()) {
bbp_the_topic();
?>
<item>
<guid><?php
bbp_topic_permalink();
?>
</guid>
<title><![CDATA[<?php
bbp_topic_title();
?>
]]></title>
<link><?php
bbp_topic_permalink();
?>
</link>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s +0000', get_post_meta(bbp_get_topic_id(), '_bbp_last_active_time', true));
?>
</pubDate>
<dc:creator><?php
the_author();
?>
</dc:creator>
<?php
if (!post_password_required()) {
?>
<description>
<![CDATA[
<p><?php
printf(esc_html__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
?>
</p>
<?php
bbp_topic_content();
?>
示例5: bbp_display_replies_feed_rss2
//.........这里部分代码省略.........
<description><?php
//
?>
</description>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
?>
</pubDate>
<generator>http://bbpress.org/?v=<?php
bbp_version();
?>
</generator>
<language><?php
bloginfo_rss('language');
?>
</language>
<?php
do_action('bbp_feed_head');
?>
<?php
if (bbp_is_single_topic()) {
?>
<?php
if (bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
?>
<?php
if (bbp_show_lead_topic()) {
?>
<item>
<guid><?php
bbp_topic_permalink();
?>
</guid>
<title><![CDATA[<?php
bbp_topic_title();
?>
]]></title>
<link><?php
bbp_topic_permalink();
?>
</link>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
?>
</pubDate>
<dc:creator><?php
the_author();
?>
</dc:creator>
<description>
<![CDATA[
<p><?php
printf(__('Replies: %s', 'bbpress'), bbp_get_topic_reply_count());
?>
</p>
<?php
bbp_topic_content();
?>
]]>
</description>
<?php
示例6: bbp_topic_permalink
<li class="bboss_search_item bboss_search_item_topic">
<div class="item">
<div class="item-title"><a href="<?php
bbp_topic_permalink(get_the_ID());
?>
"><?php
bbp_topic_title(get_the_ID());
?>
</a></div>
<div class="item-desc"><?php
echo buddyboss_global_search_reply_intro(100);
?>
</a>
</div>
</li>
示例7: widget
/**
* Displays the output, the topic list
*
* @since bbPress (r2653)
*
* @param mixed $args
* @param array $instance
* @uses apply_filters() Calls 'bbp_topic_widget_title' with the title
* @uses bbp_topic_permalink() To display the topic permalink
* @uses bbp_topic_title() To display the topic title
* @uses bbp_get_topic_last_active_time() To get the topic last active
* time
* @uses bbp_get_topic_id() To get the topic id
* @uses bbp_get_topic_reply_count() To get the topic reply count
*/
public function widget($args, $instance)
{
extract($args);
$title = apply_filters('bbp_topic_widget_title', $instance['title']);
$max_shown = !empty($instance['max_shown']) ? (int) $instance['max_shown'] : 5;
$show_date = !empty($instance['show_date']) ? 'on' : false;
$show_user = !empty($instance['show_user']) ? 'on' : false;
$parent_forum = !empty($instance['parent_forum']) ? $instance['parent_forum'] : 'any';
$order_by = !empty($instance['order_by']) ? $instance['order_by'] : false;
// How do we want to order our results?
switch ($order_by) {
// Order by most recent replies
case 'freshness':
$topics_query = array('author' => 0, 'post_type' => bbp_get_topic_post_type(), 'post_parent' => $parent_forum, 'posts_per_page' => $max_shown, 'post_status' => join(',', array(bbp_get_public_status_id(), bbp_get_closed_status_id())), 'show_stickes' => false, 'meta_key' => '_bbp_last_active_time', 'orderby' => 'meta_value', 'order' => 'DESC', 'meta_query' => array(bbp_exclude_forum_ids('meta_query')));
break;
// Order by total number of replies
// Order by total number of replies
case 'popular':
$topics_query = array('author' => 0, 'post_type' => bbp_get_topic_post_type(), 'post_parent' => $parent_forum, 'posts_per_page' => $max_shown, 'post_status' => join(',', array(bbp_get_public_status_id(), bbp_get_closed_status_id())), 'show_stickes' => false, 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value', 'order' => 'DESC', 'meta_query' => array(bbp_exclude_forum_ids('meta_query')));
break;
// Order by which topic was created most recently
// Order by which topic was created most recently
case 'newness':
default:
$topics_query = array('author' => 0, 'post_type' => bbp_get_topic_post_type(), 'post_parent' => $parent_forum, 'posts_per_page' => $max_shown, 'post_status' => join(',', array(bbp_get_public_status_id(), bbp_get_closed_status_id())), 'show_stickes' => false, 'order' => 'DESC', 'meta_query' => array(bbp_exclude_forum_ids('meta_query')));
break;
}
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_exclude_forums filter and function.
$widget_query = new WP_Query($topics_query);
// Topics exist
if ($widget_query->have_posts()) {
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<ul>
<?php
while ($widget_query->have_posts()) {
$widget_query->the_post();
$topic_id = bbp_get_topic_id($widget_query->post->ID);
$author_link = bbp_get_topic_author_link(array('post_id' => $topic_id, 'type' => 'both', 'size' => 14));
?>
<li>
<a class="bbp-forum-title" href="<?php
bbp_topic_permalink($topic_id);
?>
" title="<?php
bbp_topic_title($topic_id);
?>
"><?php
bbp_topic_title($topic_id);
?>
</a>
<?php
if ('on' == $show_user) {
?>
<?php
printf(_x('by %1$s', 'widgets', 'bbpress'), '<span class="topic-author">' . $author_link . '</span>');
?>
<?php
}
?>
<?php
if ('on' == $show_date) {
?>
<div><?php
bbp_topic_last_active_time($topic_id);
?>
</div>
<?php
}
?>
</li>
<?php
//.........这里部分代码省略.........
示例8: widget
/**
* Displays the output, the topic list
*
* @since bbPress (r2653)
*
* @param mixed $args
* @param array $instance
* @uses apply_filters() Calls 'bbp_topic_widget_title' with the title
* @uses bbp_topic_permalink() To display the topic permalink
* @uses bbp_topic_title() To display the topic title
* @uses bbp_get_topic_last_active_time() To get the topic last active
* time
* @uses bbp_get_topic_id() To get the topic id
*/
public function widget($args = array(), $instance = array())
{
// Get widget settings
$settings = $this->parse_settings($instance);
// Typical WordPress filter
$settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
// bbPress filter
$settings['title'] = apply_filters('bbp_topic_widget_title', $settings['title'], $instance, $this->id_base);
// How do we want to order our results?
switch ($settings['order_by']) {
// Order by most recent replies
case 'freshness':
$topics_query = array('post_type' => bbp_get_topic_post_type(), 'post_parent' => $settings['parent_forum'], 'posts_per_page' => (int) $settings['max_shown'], 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'meta_key' => '_bbp_last_active_time', 'orderby' => 'meta_value', 'order' => 'DESC');
break;
// Order by total number of replies
// Order by total number of replies
case 'popular':
$topics_query = array('post_type' => bbp_get_topic_post_type(), 'post_parent' => $settings['parent_forum'], 'posts_per_page' => (int) $settings['max_shown'], 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value', 'order' => 'DESC');
break;
// Order by which topic was created most recently
// Order by which topic was created most recently
case 'newness':
default:
$topics_query = array('post_type' => bbp_get_topic_post_type(), 'post_parent' => $settings['parent_forum'], 'posts_per_page' => (int) $settings['max_shown'], 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'ignore_sticky_posts' => true, 'no_found_rows' => true, 'order' => 'DESC');
break;
}
// Note: private and hidden forums will be excluded via the
// bbp_pre_get_posts_normalize_forum_visibility action and function.
$widget_query = new WP_Query($topics_query);
// Bail if no topics are found
if (!$widget_query->have_posts()) {
return;
}
echo $args['before_widget'];
if (!empty($settings['title'])) {
echo $args['before_title'] . $settings['title'] . $args['after_title'];
}
?>
<ul>
<?php
while ($widget_query->have_posts()) {
$widget_query->the_post();
$topic_id = bbp_get_topic_id($widget_query->post->ID);
$author_link = '';
// Maybe get the topic author
if (!empty($settings['show_user'])) {
$author_link = bbp_get_topic_author_link(array('post_id' => $topic_id, 'type' => 'both', 'size' => 14));
}
?>
<li>
<a class="bbp-forum-title" href="<?php
bbp_topic_permalink($topic_id);
?>
"><?php
bbp_topic_title($topic_id);
?>
</a>
<?php
if (!empty($author_link)) {
?>
<?php
printf(_x('by %1$s', 'widgets', 'bbpress'), '<span class="topic-author">' . $author_link . '</span>');
?>
<?php
}
?>
<?php
if (!empty($settings['show_date'])) {
?>
<div><?php
bbp_topic_last_active_time($topic_id);
?>
</div>
<?php
}
?>
//.........这里部分代码省略.........
示例9: wi_bbp_support_tickets
/**
* Show Support Tickets
*
* @param $atts
* @param null $content
*/
function wi_bbp_support_tickets($atts, $content = null)
{
$tickets = get_posts(array('post_type' => 'topic', 'author' => get_current_user_id(), 'nopaging' => true));
if ($tickets) {
?>
<ul id="give-support-tickets" class="list-group">
<?php
foreach ($tickets as $ticket) {
?>
<?php
$status = get_post_meta($ticket->ID, '_bbps_topic_status', true);
$status = 1 == $status ? 'Not Resolved' : 'Resolved';
?>
<li class="list-group-item">
<span class="status <?php
echo sanitize_key($status);
?>
"><?php
echo $status;
?>
</span>
<a href="<?php
bbp_topic_permalink($ticket->ID);
?>
"><?php
bbp_topic_title($ticket->ID);
?>
</a>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<p class="give-support-no-tickets"><?php
_e('You have not opened any support tickets. Need help?', 'bbpress_support');
?>
<a href="<?php
echo home_url('/support');
?>
">Open a ticket in the forums.</a></p>
<?php
}
}
示例10: bbp_topic_permalink
<?php
/**
* The template for displaying a link to a comment topic when the user has selected one.
*
*/
?>
<div id="comments" class="comment-respond">
<a name="respond"></a>
<div class="entry-content">
<?php
global $post, $bbp_post_topics;
$settings = $bbp_post_topics->get_topic_options_for_post($post->ID);
?>
<a href="<?php
bbp_topic_permalink($bbp_post_topics->topic_ID);
?>
"><?php
printf($settings['text']['link-text'], $post->post_title);
?>
</a>
</div><!-- .entry-content -->
</div><!-- #comments -->
示例11: printf
?>
<div class="discuss-topic">
<?php
if (!empty($author_link)) {
?>
<div class="topic-avatar">
<?php
printf(_x('%1$s', 'widgets', 'bbpress'), '<div class="topic-author">' . $author_link . '</div>');
?>
</div>
<?php
}
?>
<div class="topic-content">
<h4><a class="bbp-forum-title" href="<?php
bbp_topic_permalink($topic_id);
?>
"><?php
bbp_topic_title($topic_id);
?>
</a></h4>
<?php
bbp_topic_last_active_time($topic_id);
?>
</div>
</div>
<?php
}
?>