本文整理汇总了PHP中bbp_allow_search函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_allow_search函数的具体用法?PHP bbp_allow_search怎么用?PHP bbp_allow_search使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_allow_search函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bbp_is_search_results
/**
* Check if current page is a search results page
*
* @since bbPress (r4919)
*
* @global WP_Query $wp_query To check if WP_Query::bbp_is_search is true
* @uses bbp_is_query_name() To get the query name
* @return bool Is it a search page?
*/
function bbp_is_search_results()
{
global $wp_query;
// Bail if search is disabled
if (!bbp_allow_search()) {
return false;
}
// Assume false
$retval = false;
// Check query
if (!empty($wp_query->bbp_search_terms)) {
$retval = true;
}
// Check query name
if (empty($retval) && bbp_is_query_name('bbp_search_results')) {
$retval = true;
}
// Check $_REQUEST
if (empty($retval) && !empty($_REQUEST[bbp_get_search_rewrite_id()])) {
$retval = true;
}
return (bool) apply_filters('bbp_is_search_results', $retval);
}
示例2: do_action
/**
* Archive Forum Content Part
*
* @package bbPress
* @subpackage Theme
*/
?>
<?php
do_action('oxy-bbpress-global-top');
?>
<div id="bbpress-forums">
<?php
if (bbp_allow_search()) {
?>
<div class="bbp-search-form">
<?php
bbp_get_template_part('form', 'search');
?>
</div>
<?php
}
?>
<?php
示例3: widget
/**
* Displays the output, the search form
*
* @since bbPress (r4579)
*
* @uses apply_filters() Calls 'bbp_search_widget_title' with the title
* @uses get_template_part() To get the search form
*/
public function widget($args, $instance)
{
// Bail if search is disabled
if (!bbp_allow_search()) {
return;
}
// 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_search_widget_title', $settings['title'], $instance, $this->id_base);
echo $args['before_widget'];
if (!empty($settings['title'])) {
echo $args['before_title'] . $settings['title'] . $args['after_title'];
}
bbp_get_template_part('form', 'search');
echo $args['after_widget'];
}
示例4: add_search_form
/**
* Render the search form.
*/
public function add_search_form()
{
if (bbp_allow_search()) {
?>
<div class="bbp-search-form">
<?php
bbp_get_template_part('form', 'search');
?>
</div>
<?php
}
}
示例5: bbp_admin_setting_callback_search
/**
* Allow forum wide search
*
* @since 2.4.0 bbPress (r4970)
*
* @uses checked() To display the checked attribute
*/
function bbp_admin_setting_callback_search()
{
?>
<input name="_bbp_allow_search" id="_bbp_allow_search" type="checkbox" value="1" <?php
checked(bbp_allow_search(true));
bbp_maybe_admin_setting_disabled('_bbp_allow_search');
?>
/>
<label for="_bbp_allow_search"><?php
esc_html_e('Allow forum wide search', 'bbpress');
?>
</label>
<?php
}
示例6: display_search
/**
* Display the contents of search results in an output buffer and return to
* ensure that post/page contents are displayed first.
*
* @since bbPress (r4579)
*
* @param array $attr
* @param string $content
* @uses bbp_search_query()
* @uses get_template_part()
*/
public function display_search($attr, $content = '')
{
// Sanity check required info
if (!empty($content)) {
return $content;
}
// Bail if search is disabled
if (!bbp_allow_search()) {
return;
}
// Trim search attribute if it's set
if (isset($attr['search'])) {
$attr['search'] = trim($attr['search']);
}
// Set passed attribute to $search_terms for clarity
$search_terms = empty($attr['search']) ? bbp_get_search_terms() : $attr['search'];
// Unset globals
$this->unset_globals();
// Set terms for query
set_query_var(bbp_get_search_rewrite_id(), $search_terms);
// Start output buffer
$this->start(bbp_get_search_rewrite_id());
// Output template
bbp_get_template_part('content', 'search');
// Return contents of output buffer
return $this->end();
}
示例7: wm_bbp_search_form
function wm_bbp_search_form()
{
//Helper variables
$enable_button = apply_filters('wmhook_wm_bbp_search_form_enable_button', false);
$single_forum = $enable_button && bbp_is_single_forum() && bbp_current_user_can_access_create_topic_form();
//Output
if (bbp_allow_search()) {
echo '<div class="bbp-search-form">';
if ($single_forum) {
echo '<div class="wm-row"><div class="wm-column width-2-3">';
}
bbp_get_template_part('form', 'search');
if ($single_forum) {
echo '</div><div class="wm-column width-1-3 last">';
echo apply_filters('wmhook_wm_bbp_search_form_new_post_link', '<a href="#new-post" class="wm-button">' . __('Create a new topic', 'mustang') . '</a>');
echo '</div></div>';
}
echo '</div>';
}
}
示例8: wi_bbp_common_issues
/**
* Common Issues
*/
function wi_bbp_common_issues()
{
if (bbp_is_topic_edit()) {
return;
}
?>
<div id="give-bbp-common-issues">
<div id="give-bbp-common-issues">
<label>Is your ticket about one of these issues?</label>
<select id="give-bbp-common-issues-select" name="give-bbp-common-issues">
<option value="0">Select from common issues . . .</option>
<option value="install-addon">I do not know how to install the add-on I purchased</option>
<option value="pending">I need support for the Give Core plugin</option>
<option value="emails">Email receipts not being sent to customers</option>
<option value="no">No, I need to open a new ticket</option>
</select>
<div id="give-common-ticket-answers">
<div id="give-common-issue-install-addon" class="bbp-template-notice" style="display:none;">
<p>Add-ons are installed in the same way that standard WordPress plugins are installed. See
<a href="http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" target="_blank">this article at WPBeginner</a> for details.
</p>
</div>
<div id="give-common-issue-pending" class="bbp-template-notice" style="display:none;">
<p>All support for the FREE Give Core plugin is handled at the WordPress Repository. We do not take requests for Support through this form or by email.</p>
</div>
<div id="give-common-issue-emails" class="bbp-template-notice" style="display:none;">
<p>If your emails are not getting delivered, it could be due to a plugin conflict or common server issue. See
<a href="https://easydigitaldownloads.com/docs/email-receipts-sent/">this FAQ for more information</a>.
</p>
</div>
<div id="give-common-issue-fes-upload" class="bbp-template-notice" style="display:none;">
<p>Upload errors can happen for a number of reasons and are usually the result of a conflicting plugin. See
<a href="https://easydigitaldownloads.com/docs/fes-faqs/">this FAQ for more information</a>.</p>
</div>
</div>
<div class="documentation-gate">
<label>Have you consulted the documentation?</label>
<div>
<label for="give-bbp-docs-no-help">
<input type="radio" id="give-bbp-docs-no-help" name="give-bbp-docs-help" value="1" /> I read the documentation but it did not help or the docs aren't applicable to my situation
</label>
</div>
<div>
<label for="give-bbp-no-read-docs">
<input type="radio" id="give-bbp-no-read-docs" name="give-bbp-docs-help" value="3" /> I did not read the documentation
</label>
</div>
<div>
<label for="give-bbp-no-docs">
<input type="radio" id="give-bbp-no-docs" name="give-bbp-docs-help" value="2" /> I did not find any documentation about my issue
</label>
</div>
</div>
<div id="give-bbp-google-search" style="display:none">
<p><?php
_e('Enter keywords to search for documentation or similar tickets to your issue.', 'wi_bpp');
?>
</p>
<?php
if (bbp_allow_search()) {
?>
<div class="bbp-search-form">
<?php
bbp_get_template_part('form', 'search');
?>
</div>
<?php
}
?>
</div>
</div>
</div>
<?php
}
示例9: if
<?php
/**
* Archive Topic Content Part
*
* @package bbPress
* @subpackage Theme
*/
?>
<div id="bbpress-forums">
<?php if ( bbp_allow_search() ) : ?>
<div class="bbp-search-form">
<?php bbp_get_template_part( 'form', 'search' ); ?>
</div>
<?php endif; ?>
<?php if ( bbp_is_topic_tag() ) bbp_topic_tag_description(); ?>
<?php do_action( 'bbp_template_before_topics_index' ); ?>
<?php if ( bbp_has_topics() ) : ?>
<?php bbp_get_template_part( 'pagination', 'topics' ); ?>