本文整理汇总了PHP中bbp_get_reply_post_type函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_get_reply_post_type函数的具体用法?PHP bbp_get_reply_post_type怎么用?PHP bbp_get_reply_post_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_get_reply_post_type函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mycred_exclude_post_type_bbPress
function mycred_exclude_post_type_bbPress($excludes)
{
$excludes[] = bbp_get_forum_post_type();
$excludes[] = bbp_get_topic_post_type();
$excludes[] = bbp_get_reply_post_type();
return $excludes;
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:7,代码来源:mycred-hook-bbPress.php
示例2: bbp_admin_menu_order
/**
* Move our custom separator above our custom post types
*
* @since bbPress (r2957)
*
* @param array $menu_order Menu Order
* @uses bbp_get_forum_post_type() To get the forum post type
* @return array Modified menu order
*/
function bbp_admin_menu_order($menu_order)
{
// Bail if user cannot see any top level bbPress menus
if (empty($menu_order) || false === bbpress()->admin->show_separator) {
return $menu_order;
}
// Initialize our custom order array
$bbp_menu_order = array();
// Menu values
$second_sep = 'separator2';
$custom_menus = array('separator-bbpress', 'edit.php?post_type=' . bbp_get_forum_post_type(), 'edit.php?post_type=' . bbp_get_topic_post_type(), 'edit.php?post_type=' . bbp_get_reply_post_type());
// Loop through menu order and do some rearranging
foreach ($menu_order as $item) {
// Position bbPress menus above appearance
if ($second_sep == $item) {
// Add our custom menus
foreach ($custom_menus as $custom_menu) {
if (array_search($custom_menu, $menu_order)) {
$bbp_menu_order[] = $custom_menu;
}
}
// Add the appearance separator
$bbp_menu_order[] = $second_sep;
// Skip our menu items
} elseif (!in_array($item, $custom_menus)) {
$bbp_menu_order[] = $item;
}
}
// Return our custom order
return $bbp_menu_order;
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:40,代码来源:functions.php
示例3: hybrid_meta_box_post_remove_seo
/**
* Remove the meta box from some post types.
*
* @since 1.3.0
* @param string $post_type The post type of the current post being edited.
* @param object $post The current post being edited.
* @return void
*/
function hybrid_meta_box_post_remove_seo($post_type, $post)
{
/* Removes post stylesheets support of the bbPress 'topic' post type. */
if (function_exists('bbp_get_topic_post_type') && bbp_get_topic_post_type() == $post_type) {
remove_meta_box('hybrid-core-post-seo', bbp_get_topic_post_type(), 'normal');
} elseif (function_exists('bbp_get_reply_post_type') && bbp_get_reply_post_type() == $post_type) {
remove_meta_box('hybrid-core-post-seo', bbp_get_reply_post_type(), 'normal');
}
}
开发者ID:panser,项目名称:wandromaha,代码行数:17,代码来源:meta-box-post-seo.php
示例4: hybrid_meta_box_post_remove_template
/**
* Remove the meta box from some post types.
*
* @since 1.3.0
* @access public
* @param string $post_type The post type of the current post being edited.
* @param object $post The current post being edited.
* @return void
*/
function hybrid_meta_box_post_remove_template($post_type, $post)
{
/* Removes meta box from pages since this is a built-in WordPress feature. */
if ('page' == $post_type) {
remove_meta_box('hybrid-core-post-template', 'page', 'side');
} elseif (function_exists('bbp_get_topic_post_type') && bbp_get_topic_post_type() == $post_type) {
remove_meta_box('hybrid-core-post-template', bbp_get_topic_post_type(), 'side');
} elseif (function_exists('bbp_get_reply_post_type') && bbp_get_reply_post_type() == $post_type) {
remove_meta_box('hybrid-core-post-template', bbp_get_reply_post_type(), 'side');
}
}
开发者ID:LSYanJun,项目名称:wordpress,代码行数:20,代码来源:meta-box-post-template.php
示例5: register_bb_custom_sidebar_mb
function register_bb_custom_sidebar_mb()
{
if (!function_exists('bbp_get_topic_post_type') || !function_exists('bbp_get_forum_post_type') || !function_exists('bbp_get_reply_post_type')) {
return;
}
$options = array('id' => 'circleflip-custom-sidebar-page', 'title' => 'Custom Sidebar', 'callback' => 'render_page_custom_sidebar_mb', 'context' => 'normal', 'priority' => 'high', 'callback_args' => NULL);
extract($options);
add_meta_box($id, $title, $callback, bbp_get_topic_post_type(), $context, $priority, $callback_args);
add_meta_box($id, $title, $callback, bbp_get_forum_post_type(), $context, $priority, $callback_args);
add_meta_box($id, $title, $callback, bbp_get_reply_post_type(), $context, $priority, $callback_args);
}
开发者ID:purgesoftwares,项目名称:purges,代码行数:11,代码来源:sidebars.php
示例6: bbpvotes_buddypress_voted_activity
function bbpvotes_buddypress_voted_activity($post_id, $user_id, $vote)
{
//check vote value
if (is_bool($vote) === false) {
return new WP_Error('vote_is_not_bool', __('Vote is not a boolean', 'bbpvotes'));
}
$voteplus = $vote === true;
$voteminus = $vote === false;
$post = get_post($post_id);
$user_link = bbp_get_user_profile_link($user_id);
//build item link
if ($post->post_type == bbp_get_topic_post_type()) {
$topic_id = $post->ID;
$post_permalink = get_permalink($post->ID);
} elseif ($post->post_type == bbp_get_reply_post_type()) {
$topic_id = bbp_get_reply_topic_id($post->ID);
$post_permalink = bbp_get_reply_url($post->ID);
}
//topic infos
$topic = get_post($topic_id);
$topic_author_link = bbp_get_user_profile_link($topic->post_author);
$topic_title = $topic->post_title;
$post_link = '<a href="' . $post_permalink . '">' . $topic_title . '</a>';
if ($voteplus) {
$type = 'bbpvotes_voted_up';
if ($post->post_type == bbp_get_topic_post_type()) {
$action = sprintf(esc_html__('%1$s voted up to the topic %2$s by %3$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
} elseif ($post->post_type == bbp_get_reply_post_type()) {
$action = sprintf(esc_html__('%1$s voted up to a reply by %3$s in the topic %2$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
}
} else {
$type = 'bbpvotes_voted_down';
if ($post->post_type == bbp_get_topic_post_type()) {
$action = sprintf(esc_html__('%1$s voted down to the topic %2$s by %3$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
} elseif ($post->post_type == bbp_get_reply_post_type()) {
$action = sprintf(esc_html__('%1$s voted down to a reply by %3$s in the topic %2$s', 'bbpress'), $user_link, $post_link, $topic_author_link);
}
}
$args = array('action' => $action, 'component' => 'bbpress', 'type' => $type, 'item_id' => $topic->ID);
if ($post->post_type == bbp_get_reply_post_type()) {
$args['secondary_item_id'] = $post->ID;
}
/*
if ($is_update){
$previous_activity_id =
$args['id'] = $previous_activity_id;
}
*/
bp_activity_add($args);
}
开发者ID:ptrck-r,项目名称:bbpress-votes,代码行数:50,代码来源:bbpvotes-buddypress.php
示例7: test_bbp_reply_post_type
/**
* @covers ::bbp_reply_post_type
* @covers ::bbp_get_reply_post_type
*/
public function test_bbp_reply_post_type()
{
$t = $this->factory->topic->create();
$r = $this->factory->reply->create(array('post_parent' => $t, 'reply_meta' => array('topic_id' => $t)));
$robj = get_post_type_object('reply');
$this->assertInstanceOf('stdClass', $robj);
$this->assertEquals('reply', $robj->name);
// Test some defaults
$this->assertFalse(is_post_type_hierarchical('topic'));
$reply_type = bbp_reply_post_type($r);
$this->expectOutputString('reply', $reply_type);
$reply_type = bbp_get_reply_post_type($r);
$this->assertSame('reply', $reply_type);
}
开发者ID:joeyblake,项目名称:bbpress,代码行数:18,代码来源:post_type.php
示例8: bbPressPostTypes
/**
* bbPress post types.
*
* @since 150821 Improving bbPress support.
*
* @return array All bbPress post types.
*/
public function bbPressPostTypes()
{
if (!$this->isBbPressActive()) {
return [];
}
if (!is_null($types =& $this->cacheKey('bbPressPostTypes'))) {
return $types;
// Already did this.
}
$types = [];
// Initialize.
$types[] = bbp_get_forum_post_type();
$types[] = bbp_get_topic_post_type();
$types[] = bbp_get_reply_post_type();
return $types;
}
开发者ID:arobbins,项目名称:sblog,代码行数:23,代码来源:BbPressUtils.php
示例9: test_bbp_reply_post_type
/**
* @covers ::bbp_reply_post_type
* @covers ::bbp_get_reply_post_type
*/
public function test_bbp_reply_post_type()
{
$t = $this->factory->topic->create();
$r = $this->factory->reply->create(array('post_parent' => $t, 'reply_meta' => array('topic_id' => $t)));
$robj = get_post_type_object('reply');
// WordPress 4.6 introduced `WP_Post_Type` class
if (bbp_get_major_wp_version() < 4.6) {
$this->assertInstanceOf('stdClass', $robj);
} else {
$this->assertInstanceOf('WP_Post_Type', $robj);
}
$this->assertEquals('reply', $robj->name);
// Test some defaults
$this->assertFalse(is_post_type_hierarchical('topic'));
$reply_type = bbp_reply_post_type($r);
$this->expectOutputString('reply', $reply_type);
$reply_type = bbp_get_reply_post_type($r);
$this->assertSame('reply', $reply_type);
}
开发者ID:CompositeUK,项目名称:clone.bbPress,代码行数:23,代码来源:post_type.php
示例10: widget
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
$title = !empty($instance['title']) ? $instance['title'] : __('Recent Comments');
$title = apply_filters('widget_title', $title, $instance, $this->id_base);
$number = !empty($instance['number']) ? absint($instance['number']) : 5;
if (!$number) {
$number = 5;
}
$cb_qry = new WP_Query(array('post_type' => bbp_get_reply_post_type(), 'post_status' => array(bbp_get_public_status_id(), bbp_get_closed_status_id()), 'posts_per_page' => $number, 'ignore_sticky_posts' => true, 'no_found_rows' => true));
echo $before_widget;
echo $before_title . $title . $after_title;
?>
<ul class="cb-bbp-recent-replies">
<?php
while ($cb_qry->have_posts()) {
$cb_qry->the_post();
?>
<li>
<?php
$cb_reply_id = bbp_get_reply_id($cb_qry->post->ID);
$cb_reply_url = '<a class="bbp-reply-topic-title" href="' . esc_url(bbp_get_reply_url($cb_reply_id)) . '" title="' . esc_attr(bbp_get_reply_excerpt($cb_reply_id, 50)) . '">' . bbp_get_reply_topic_title($cb_reply_id) . '</a>';
$cb_author_avatar = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'avatar', 'size' => 60));
$cb_author_name = bbp_get_reply_author_link(array('post_id' => $cb_reply_id, 'type' => 'name'));
echo $cb_author_avatar . '<div class="cb-bbp-meta">' . $cb_author_name . ' <i class="icon-long-arrow-right"></i> ' . $cb_reply_url . '<div class="cb-bbp-recent-replies-time">' . bbp_get_time_since(get_the_time('U')) . '</div></div>';
?>
</li>
<?php
}
?>
</ul>
<?php
echo $after_widget;
// Reset the $post global
wp_reset_postdata();
}
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:43,代码来源:cb-bbp-recent-replies.php
示例11: check_private_groups_reply_ids
function check_private_groups_reply_ids($post_ids)
{
//Init the Array which will hold our list of allowed posts
$allowed_posts = array();
//Loop through all the posts
foreach ($post_ids as $post_id) {
//Get the Forum ID based on Post Type Topic
$reply = bbp_get_reply_post_type();
$forum_id = private_groups_get_forum_id_from_post_id($post_id, $reply);
//Check if User has permissions to view this Post ID
//by calling the function that checks if the user can view this forum, and hence this post
if (private_groups_can_user_view_post_id($forum_id)) {
//User can view this post - add it to the allowed array
array_push($allowed_posts, $post_id);
}
}
//Return the list
return $allowed_posts;
}
开发者ID:USSLomaPrieta,项目名称:usslomaprieta.org,代码行数:19,代码来源:replies.php
示例12: tehnik_bpp_get_forum_id_from_post_id
function tehnik_bpp_get_forum_id_from_post_id($post_id, $post_type)
{
$forum_id = 0;
// Check post type
switch ($post_type) {
// Forum
case bbp_get_forum_post_type():
$forum_id = bbp_get_forum_id($post_id);
break;
// Topic
// Topic
case bbp_get_topic_post_type():
$forum_id = bbp_get_topic_forum_id($post_id);
break;
// Reply
// Reply
case bbp_get_reply_post_type():
$forum_id = bbp_get_reply_forum_id($post_id);
break;
}
return $forum_id;
}
开发者ID:dnaleor,项目名称:Tehnik-bbPress-Permissions,代码行数:22,代码来源:tehnik_bpp_core.php
示例13: bbpress_replieslist_settings_field
function bbpress_replieslist_settings_field($settings, $value)
{
$dependency = vc_generate_dependencies_attributes($settings);
$param_name = isset($settings['param_name']) ? $settings['param_name'] : '';
$type = isset($settings['type']) ? $settings['type'] : '';
$args = array('post_type' => bbp_get_reply_post_type(), 'orderby' => 'title', 'order' => 'ASC');
$forums = new WP_Query($args);
$output = '';
$output .= '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . '">';
while ($forums->have_posts()) {
$forums->the_post();
if ($value != '' && get_the_ID() == $value) {
$selected = ' selected="selected"';
} else {
$selected = "";
}
$output .= '<option class="' . get_the_ID() . '" data-id="' . get_the_ID() . '" data-value="' . get_the_title() . '" value="' . get_the_ID() . '"' . $selected . '>' . get_the_title() . '</option>';
}
wp_reset_query();
$output .= '</select>';
return $output;
}
开发者ID:baochung26,项目名称:happy-c,代码行数:22,代码来源:ts_vcsc_parameter_woocommerce.php
示例14: bbp_current_user_can_see
/**
* Can the current user see a specific UI element?
*
* Used when registering post-types and taxonomies to decide if 'show_ui' should
* be set to true or false. Also used for fine-grained control over which admin
* sections are visible under what conditions.
*
* This function is in bbp-core-caps.php rather than in /bbp-admin so that it
* can be used during the bbp_register_post_types action.
*
* @since bbPress (r3944)
*
* @uses current_user_can() To check the 'moderate' capability
* @uses bbp_get_forum_post_type()
* @uses bbp_get_topic_post_type()
* @uses bbp_get_reply_post_type()
* @uses bbp_get_topic_tag_tax_id()
* @uses is_plugin_active()
* @uses is_super_admin()
* @return bool Results of current_user_can( 'moderate' ) check.
*/
function bbp_current_user_can_see($component = '')
{
// Define local variable
$retval = false;
// Which component are we checking UI visibility for?
switch ($component) {
/** Everywhere ********************************************************/
case bbp_get_forum_post_type():
// Forums
// Forums
case bbp_get_topic_post_type():
// Topics
// Topics
case bbp_get_reply_post_type():
// Replies
// Replies
case bbp_get_topic_tag_tax_id():
// Topic-Tags
$retval = current_user_can('moderate');
break;
/** Admin Exclusive ***************************************************/
/** Admin Exclusive ***************************************************/
case 'bbp_settings_buddypress':
// BuddyPress Extension
$retval = is_plugin_active('buddypress/bp-loader.php') && defined('BP_VERSION') && is_super_admin();
break;
case 'bbp_settings_akismet':
// Akismet Extension
$retval = is_plugin_active('akismet/akismet.php') && defined('AKISMET_VERSION') && is_super_admin();
break;
case 'bbp_tools_page':
// Tools Page
// Tools Page
case 'bbp_tools_repair_page':
// Tools - Repair Page
// Tools - Repair Page
case 'bbp_tools_import_page':
// Tools - Import Page
// Tools - Import Page
case 'bbp_tools_reset_page':
// Tools - Reset Page
// Tools - Reset Page
case 'bbp_settings?page':
// Settings Page
// Settings Page
case 'bbp_settings_main':
// Settings - General
// Settings - General
case 'bbp_settings_theme_compat':
// Settings - Theme compat
// Settings - Theme compat
case 'bbp_settings_root_slugs':
// Settings - Root slugs
// Settings - Root slugs
case 'bbp_settings_single_slugs':
// Settings - Single slugs
// Settings - Single slugs
case 'bbp_settings_per_page':
// Settings - Single slugs
// Settings - Single slugs
case 'bbp_settings_per_page_rss':
// Settings - Single slugs
// Settings - Single slugs
default:
// Anything else
$retval = current_user_can(bbpress()->admin->minimum_capability);
break;
}
return (bool) apply_filters('bbp_current_user_can_see', (bool) $retval, $component);
}
开发者ID:hscale,项目名称:webento,代码行数:91,代码来源:bbp-core-caps.php
示例15: bbp_forum_enforce_private
/**
* Check if it's a private forum or a topic or reply of a private forum and if
* the user can't view it, then sets a 404
*
* @since bbPress (r2996)
*
* @uses current_user_can() To check if the current user can read private forums
* @uses is_singular() To check if it's a singular page
* @uses bbp_is_user_keymaster() To check if user is a keymaster
* @uses bbp_get_forum_post_type() To get the forum post type
* @uses bbp_get_topic_post_type() To get the topic post type
* @uses bbp_get_reply_post_type() TO get the reply post type
* @uses bbp_get_topic_forum_id() To get the topic forum id
* @uses bbp_get_reply_forum_id() To get the reply forum id
* @uses bbp_is_forum_private() To check if the forum is private or not
* @uses bbp_set_404() To set a 404 status
*/
function bbp_forum_enforce_private()
{
// Bail if not viewing a single item or if user has caps
if (!is_singular() || bbp_is_user_keymaster() || current_user_can('read_private_forums')) {
return;
}
global $wp_query;
// Define local variable
$forum_id = 0;
// Check post type
switch ($wp_query->get('post_type')) {
// Forum
case bbp_get_forum_post_type():
$forum_id = bbp_get_forum_id($wp_query->post->ID);
break;
// Topic
// Topic
case bbp_get_topic_post_type():
$forum_id = bbp_get_topic_forum_id($wp_query->post->ID);
break;
// Reply
// Reply
case bbp_get_reply_post_type():
$forum_id = bbp_get_reply_forum_id($wp_query->post->ID);
break;
}
// If forum is explicitly hidden and user not capable, set 404
if (!empty($forum_id) && bbp_is_forum_private($forum_id) && !current_user_can('read_private_forums')) {
bbp_set_404();
}
}
开发者ID:jenia-buianov,项目名称:all_my_sites,代码行数:48,代码来源:functions.php
示例16: bbp_get_breadcrumb
//.........这里部分代码省略.........
$pre_current_text = bbp_get_reply_title();
// Topic Tag (or theme compat topic tag)
} elseif (bbp_is_topic_tag() || get_query_var('bbp_topic_tag') && !bbp_is_topic_tag_edit()) {
// Always include the tag name
$tag_data[] = bbp_get_topic_tag_name();
// If capable, include a link to edit the tag
if (current_user_can('manage_topic_tags')) {
$tag_data[] = '<a href="' . bbp_get_topic_tag_edit_link() . '" class="bbp-edit-topic-tag-link">' . __('(Edit)', 'bbpress') . '</a>';
}
// Implode the results of the tag data
$pre_current_text = sprintf(__('Topic Tag: %s', 'bbpress'), implode(' ', $tag_data));
// Edit Topic Tag
} elseif (bbp_is_topic_tag_edit()) {
$pre_current_text = __('Edit', 'bbpress');
// Single
} else {
$pre_current_text = get_the_title();
}
/** Parse Args ********************************************************/
// Parse args
$defaults = array('before' => '<div class="bbp-breadcrumb"><p>', 'after' => '</p></div>', 'sep' => __('›', 'bbpress'), 'pad_sep' => 1, 'include_home' => $pre_include_home, 'home_text' => $pre_front_text, 'include_root' => $pre_include_root, 'root_text' => $pre_root_text, 'include_current' => $pre_include_current, 'current_text' => $pre_current_text);
$r = bbp_parse_args($args, $defaults, 'get_breadcrumb');
extract($r);
/** Ancestors *********************************************************/
// Get post ancestors
if (is_page() || is_single() || bbp_is_forum_edit() || bbp_is_topic_edit() || bbp_is_reply_edit()) {
$ancestors = array_reverse(get_post_ancestors(get_the_ID()));
}
// Do we want to include a link to home?
if (!empty($include_home) || empty($home_text)) {
$crumbs[] = '<a href="' . trailingslashit(home_url()) . '" class="bbp-breadcrumb-home">' . $home_text . '</a>';
}
// Do we want to include a link to the forum root?
if (!empty($include_root) || empty($root_text)) {
// Page exists at root slug path, so use its permalink
$page = bbp_get_page_by_path(bbp_get_root_slug());
if (!empty($page)) {
$root_url = get_permalink($page->ID);
// Use the root slug
} else {
$root_url = get_post_type_archive_link(bbp_get_forum_post_type());
}
// Add the breadcrumb
$crumbs[] = '<a href="' . $root_url . '" class="bbp-breadcrumb-root">' . $root_text . '</a>';
}
// Ancestors exist
if (!empty($ancestors)) {
// Loop through parents
foreach ((array) $ancestors as $parent_id) {
// Parents
$parent = get_post($parent_id);
// Switch through post_type to ensure correct filters are applied
switch ($parent->post_type) {
// Forum
case bbp_get_forum_post_type():
$crumbs[] = '<a href="' . bbp_get_forum_permalink($parent->ID) . '" class="bbp-breadcrumb-forum">' . bbp_get_forum_title($parent->ID) . '</a>';
break;
// Topic
// Topic
case bbp_get_topic_post_type():
$crumbs[] = '<a href="' . bbp_get_topic_permalink($parent->ID) . '" class="bbp-breadcrumb-topic">' . bbp_get_topic_title($parent->ID) . '</a>';
break;
// Reply (Note: not in most themes)
// Reply (Note: not in most themes)
case bbp_get_reply_post_type():
$crumbs[] = '<a href="' . bbp_get_reply_permalink($parent->ID) . '" class="bbp-breadcrumb-reply">' . bbp_get_reply_title($parent->ID) . '</a>';
break;
// WordPress Post/Page/Other
// WordPress Post/Page/Other
default:
$crumbs[] = '<a href="' . get_permalink($parent->ID) . '" class="bbp-breadcrumb-item">' . get_the_title($parent->ID) . '</a>';
break;
}
}
// Edit topic tag
} elseif (bbp_is_topic_tag_edit()) {
$crumbs[] = '<a href="' . get_term_link(bbp_get_topic_tag_id(), bbp_get_topic_tag_tax_id()) . '" class="bbp-breadcrumb-topic-tag">' . sprintf(__('Topic Tag: %s', 'bbpress'), bbp_get_topic_tag_name()) . '</a>';
}
/** Current ***********************************************************/
// Add current page to breadcrumb
if (!empty($include_current) || empty($pre_current_text)) {
$crumbs[] = '<span class="bbp-breadcrumb-current">' . $current_text . '</span>';
}
/** Separator *********************************************************/
// Wrap the separator in a span before padding and filter
if (!empty($sep)) {
$sep = '<span class="bbp-breadcrumb-separator">' . $sep . '</span>';
}
// Pad the separator
if (!empty($pad_sep)) {
$sep = str_pad($sep, strlen($sep) + (int) $pad_sep * 2, ' ', STR_PAD_BOTH);
}
/** Finish Up *********************************************************/
// Filter the separator and breadcrumb
$sep = apply_filters('bbp_breadcrumb_separator', $sep);
$crumbs = apply_filters('bbp_breadcrumbs', $crumbs);
// Build the trail
$trail = !empty($crumbs) ? $before . implode($sep, $crumbs) . $after : '';
return apply_filters('bbp_get_breadcrumb', $trail, $crumbs, $r);
}
开发者ID:rmccue,项目名称:bbPress,代码行数:101,代码来源:bbp-common-template.php
示例17: bbp_get_reply_edit_url
/**
* Return URL to the reply edit page
*
* @since bbPress (r2753)
*
* @param int $reply_id Optional. Reply id
* @uses bbp_get_reply_id() To get the reply id
* @uses bbp_get_reply() To get the reply
* @uses bbp_get_reply_post_type() To get the reply post type
* @uses add_query_arg() To add custom args to the url
* @uses apply_filters() Calls 'bbp_get_reply_edit_url' with the edit
* url and reply id
* @return string Reply edit url
*/
function bbp_get_reply_edit_url($reply_id = 0)
{
global $wp_rewrite;
$bbp = bbpress();
$reply = bbp_get_reply(bbp_get_reply_id($reply_id));
if (empty($reply)) {
return;
}
$reply_link = bbp_remove_view_all(bbp_get_reply_permalink($reply_id));
// Pretty permalinks
if ($wp_rewrite->using_permalinks()) {
$url = trailingslashit($reply_link) . $bbp->edit_id;
$url = trailingslashit($url);
// Unpretty permalinks
} else {
$url = add_query_arg(array(bbp_get_reply_post_type() => $reply->post_name, $bbp->edit_id => '1'), $reply_link);
}
// Maybe add view all
$url = bbp_add_view_all($url);
return apply_filters('bbp_get_reply_edit_url', $url, $reply_id);
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:35,代码来源:template.php
示例18: bbp_get_user_replies_created
/**
* Get the replies that a user created
*
* @since bbPress (r4225)
*
* @param int $user_id Optional. User id
* @uses bbp_get_user_id() To get the topic id
* @uses bbp_has_replies() To get the topics created by the user
* @return array|bool Results if the user has created topics, otherwise false
*/
function bbp_get_user_replies_created($user_id = 0)
{
// Validate user
$user_id = bbp_get_user_id($user_id);
if (empty($user_id)) {
return false;
}
// Try to get the topics
$query = bbp_has_replies(array('post_type' => array(bbp_get_topic_post_type(), bbp_get_reply_post_type()), 'post_parent' => 'any', 'posts_per_page' => bbp_get_replies_per_page(), 'paged' => bbp_get_paged(), 'orderby' => 'date', 'order' => 'DESC', 'author' => $user_id, 'show_stickies' => false));
return apply_filters('bbp_get_user_replies_created', $query, $user_id);
}
开发者ID:hscale,项目名称:webento,代码行数:21,代码来源:functions.php
示例19: bbp_get_reply_move_template
/**
* Get the reply move template
*
* @since bbPress (r4521)
*
* @uses bbp_get_reply_post_type()
* @uses bbp_get_query_template()
* @return string Path to template file
*/
function bbp_get_reply_move_template()
{
$templates = array('single-' . bbp_get_reply_post_type() . '-move.php');
return bbp_get_query_template('reply_move', $templates);
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:14,代码来源:template-loader.php
示例20: enqueue_scripts
/**
* Enqueue any admin scripts we might need
*
* @since bbPress (r4260)
*/
public function enqueue_scripts()
{
wp_enqueue_script('suggest');
// Get the version to use for JS
$version = bbp_get_version();
// Post type checker (only topics and replies)
if ('post' === get_current_screen()->base) {
switch (get_current_screen()->post_type) {
case bbp_get_reply_post_type():
case bbp_get_topic_post_type():
// Enqueue the common JS
wp_enqueue_script('bbp-admin-common-js', $this->js_url . 'common.js', array('jquery'), $version);
// Topics admin
if (bbp_get_topic_post_type() === get_current_screen()->post_type) {
wp_enqueue_script('bbp-admin-topics-js', $this->js_url . 'topics.js', array('jquery'), $version);
// Replies admin
} elseif (bbp_get_reply_post_type() === get_current_screen()->post_type) {
wp_enqueue_script('bbp-admin-replies-js', $this->js_url . 'replies.js', array('jquery'), $version);
}
break;
}
}
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:28,代码来源:admin.php
注:本文中的bbp_get_reply_post_type函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论