Current File : /home/bravrvjk/cepurhuye.rw/wp-content/plugins/bopea-function/inc/bbpress//helper.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'jelly_bbp_get_sidebar_name' ) ) {
function jelly_bbp_get_sidebar_name() {
if ( bbp_is_user_home() || bbp_is_single_user() || bbp_is_user_home_edit() || bbp_is_single_user_edit() ) {
return false;
}
if ( function_exists( 'bbp_is_single_forum' ) && ( bbp_is_single_forum() || bbp_is_forum_archive() ) ) {
$sidebar = get_option( 'jelly_bbp_forum_sidebar' );
if ( '_default' !== $sidebar ) {
return $sidebar;
}
} elseif ( function_exists( 'bbp_is_single_topic' ) && bbp_is_single_topic() ) {
$sidebar = get_option( 'jelly_bbp_topic_sidebar' );
if ( '_default' !== $sidebar ) {
return $sidebar;
}
} elseif ( function_exists( 'bbp_has_shortcode' ) && bbp_has_shortcode() ) {
$sidebar = get_option( 'jelly_bbp_shortcode_sidebar' );
if ( '_default' !== $sidebar ) {
return $sidebar;
}
}
return get_option( 'jelly_bbp_sidebar' );
}
}
if ( ! function_exists( 'jelly_bbp_validate_html_field' ) ) {
function jelly_bbp_validate_html_field( $content ) {
return wp_kses( $content, [
'a' => array(
'href' => true,
'title' => true,
'rel' => true,
'target' => true
),
'blockquote' => array(
'cite' => true
),
'code' => array(),
'pre' => array(
'class' => true
),
'em' => array(),
'strong' => array(),
'del' => array(
'datetime' => true,
'cite' => true
),
'ins' => array(
'datetime' => true,
'cite' => true
),
'img' => array(
'src' => true,
'border' => true,
'alt' => true,
'height' => true,
'width' => true,
)
] );
}
}
if ( ! function_exists( 'jelly_bbp_status_config' ) ) {
function jelly_bbp_status_config() {
return apply_filters( 'jelly_bbp_status', [
'0' => esc_html__( '- Default -', 'bopea-function' ),
'resolved' => get_option( 'jelly_bbp_topic_status_1', esc_html__( 'Resolved', 'bopea-function' ) ),
'unresolved' => get_option( 'jelly_bbp_topic_status_2', esc_html__( 'Not Resolved', 'bopea-function' ) ),
'solution' => get_option( 'jelly_bbp_topic_status_3', esc_html__( 'Has a Solution', 'bopea-function' ) ),
] );
}
}