function porto_page_title() { global $porto_settings; $output = ''; if (!is_front_page()) { } elseif (is_home()) { $output .= $porto_settings['blog-title']; } if (is_singular()) { $output .= porto_page_title_leaf(); } else { if (is_post_type_archive()) { if (is_search()) { $output .= porto_page_title_leaf('search'); } else { $output .= porto_page_title_archive(); } } elseif (is_tax() || is_tag() || is_category()) { $html = porto_page_title_leaf('term'); if (is_tag()) { $output .= sprintf(__('Tag - %s', 'porto'), $html); } elseif (is_tax('product_tag')) { $output .= sprintf(__('Product Tag - %s', 'porto'), $html); } else { $output .= $html; } } elseif (is_date()) { if (is_year()) { $output .= porto_page_title_leaf('year'); } elseif (is_month()) { $output .= porto_page_title_leaf('month'); } elseif (is_day()) { $output .= porto_page_title_leaf('day'); } } elseif (is_author()) { $output .= porto_page_title_leaf('author'); } elseif (is_search()) { $output .= porto_page_title_leaf('search'); } elseif (is_404()) { $output .= porto_page_title_leaf('404'); } elseif (class_exists('bbPress') && is_bbpress()) { if (bbp_is_search()) { $output .= porto_page_title_leaf('bbpress_search'); } elseif (bbp_is_single_user()) { $output .= porto_page_title_leaf('bbpress_user'); } else { $output .= porto_page_title_leaf(); } } else { if (is_home() && !is_front_page()) { if (get_option('show_on_front') == 'page') { $output .= get_the_title(get_option('page_for_posts', true)); } else { $output .= $porto_settings['blog-title']; } } } } return apply_filters('porto_page_title', $output); }
/** * Add live search JavaScript to the footer */ function st_add_live_search() { if (of_get_option('st_live_search') == '0') { if (class_exists('bbPress')) { if (get_post_type() == 'forum' || get_post_type() == 'topic' || get_post_type() == 'reply' || bbp_is_search()) { // If BBPRess ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#live-search #s').liveSearch({url: '<?php bbp_search_url(); ?> /?ajax=on&bbp_search='}); }); </script> <?php } } else { // If KB ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#live-search #s').liveSearch({url: '<?php echo home_url(); ?> /?ajax=on&post_type=st_kb&s='}); }); </script> <?php } } }
/** * Get sidebar settings based on the page type * * @return array */ public function sidebar_options() { if (is_home()) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position')); } elseif (function_exists('is_bbpress') && is_bbpress()) { $sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position')); if (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search()) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position')); } } elseif (function_exists('is_buddypress') && is_buddypress()) { $sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position')); } elseif (class_exists('WooCommerce') && (is_product() || is_shop())) { $sidebars = array('global' => Avada()->settings->get('woo_global_sidebar'), 'sidebar_1' => Avada()->settings->get('woo_sidebar'), 'sidebar_2' => Avada()->settings->get('woo_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position')); } elseif (class_exists('WooCommerce') && (is_product_category() || is_product_tag())) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('woocommerce_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('woocommerce_archive_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position')); } elseif (is_page()) { $sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos')); } elseif (is_single()) { $sidebars = array('global' => Avada()->settings->get('posts_global_sidebar'), 'sidebar_1' => Avada()->settings->get('posts_sidebar'), 'sidebar_2' => Avada()->settings->get('posts_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position')); if (is_singular('avada_portfolio')) { $sidebars = array('global' => Avada()->settings->get('portfolio_global_sidebar'), 'sidebar_1' => Avada()->settings->get('portfolio_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position')); } else { if (is_singular('tribe_events') || is_singular('tribe_organizer') || is_singular('tribe_venue')) { $sidebars = array('global' => Avada()->settings->get('ec_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos')); } } if (is_singular('tribe_organizer') || is_singular('tribe_venue')) { $sidebars['global'] = 1; } } elseif (is_archive()) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position')); if (is_post_type_archive('avada_portfolio') || is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags')) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('portfolio_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_archive_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position')); } } elseif (is_search()) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('search_sidebar'), 'sidebar_2' => Avada()->settings->get('search_sidebar_2'), 'position' => Avada()->settings->get('search_sidebar_position')); } else { $sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos')); } if (class_exists('Tribe__Events__Main') && is_events_archive()) { $sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos')); } // Remove sidebars from the certain woocommerce pages if (class_exists('WooCommerce')) { if (is_cart() || is_checkout() || is_account_page() || get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))) { $sidebars = array(); } } return $sidebars; }
public function load_modules() { if (!function_exists('bbp_version')) { return; } if (function_exists('bbp_is_search')) { $this->is_search = bbp_is_search(); } if (is_admin()) { if ($this->o['admin_disable_active'] == 1 && !d4p_bbp_is_role('admin_disable')) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/access.php'; $this->mod['a'] = new gdbbMod_Access(); } } else { if ($this->o['quote_active'] == 1 && d4p_bbp_is_role('quote') && !$this->is_search) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/quote.php'; $this->mod['q'] = new gdbbMod_Quote($this->o['quote_location'], $this->o['quote_method']); } } if ($this->o['signature_active'] == 1) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/signature.php'; $this->mod['i'] = new gdbbMod_Signature($this->o['signature_length'], d4p_bbp_is_role('signature_enhanced'), $this->o['signature_method'], $this->o['signature_buddypress_profile_group']); $this->mod['i']->active = d4p_bbp_is_role('signature'); } if ($this->o['bbcodes_active'] == 1) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/bbcodes.php'; $this->mod['s'] = new gdbbMod_Shortcodes($this->o['bbcodes_bbpress_only'] == 1, !d4p_bbp_is_role('bbcodes_special'), 'info', $this->o['bbcodes_deactivated'], $this->o['bbcodes_notice'] == 1); } if (GDBBPRESSTOOLS_WPV > 32 && $this->o['toolbar_active'] == 1 && d4p_bbp_is_role('toolbar')) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/toolbar.php'; $this->mod['t'] = new gdbbMod_Toolbar(); } $views = array(); $active = false; foreach ($this->o as $key => $val) { if (substr($key, 0, 5) == 'view_') { $parts = explode('_', $key, 3); $views[$parts[1]][$parts[2]] = $val; if (!$active && $parts[2] == 'active' && $val == 1) { $active = true; } } } if ($active) { require_once GDBBPRESSTOOLS_PATH . 'code/mods/views.php'; $this->mod['s'] = new gdbbMod_Views($views); } }
/** * Possibly intercept the template being loaded * * Listens to the 'template_include' filter and waits for any bbPress specific * template condition to be met. If one is met and the template file exists, * it will be used; otherwise * * Note that the _edit() checks are ahead of their counterparts, to prevent them * from being stomped on accident. * * @since bbPress (r3032) * * @param string $template * * @uses bbp_is_single_user() To check if page is single user * @uses bbp_get_single_user_template() To get user template * @uses bbp_is_single_user_edit() To check if page is single user edit * @uses bbp_get_single_user_edit_template() To get user edit template * @uses bbp_is_single_view() To check if page is single view * @uses bbp_get_single_view_template() To get view template * @uses bbp_is_search() To check if page is search * @uses bbp_get_search_template() To get search template * @uses bbp_is_forum_edit() To check if page is forum edit * @uses bbp_get_forum_edit_template() To get forum edit template * @uses bbp_is_topic_merge() To check if page is topic merge * @uses bbp_get_topic_merge_template() To get topic merge template * @uses bbp_is_topic_split() To check if page is topic split * @uses bbp_get_topic_split_template() To get topic split template * @uses bbp_is_topic_edit() To check if page is topic edit * @uses bbp_get_topic_edit_template() To get topic edit template * @uses bbp_is_reply_move() To check if page is reply move * @uses bbp_get_reply_move_template() To get reply move template * @uses bbp_is_reply_edit() To check if page is reply edit * @uses bbp_get_reply_edit_template() To get reply edit template * @uses bbp_set_theme_compat_template() To set the global theme compat template * * @return string The path to the template file that is being used */ function bbp_template_include_theme_supports($template = '') { // Editing a user if (bbp_is_single_user_edit() && ($new_template = bbp_get_single_user_edit_template())) { // User favorites } elseif (bbp_is_favorites() && ($new_template = bbp_get_favorites_template())) { // User favorites } elseif (bbp_is_subscriptions() && ($new_template = bbp_get_subscriptions_template())) { // Viewing a user } elseif (bbp_is_single_user() && ($new_template = bbp_get_single_user_template())) { // Single View } elseif (bbp_is_single_view() && ($new_template = bbp_get_single_view_template())) { // Search } elseif (bbp_is_search() && ($new_template = bbp_get_search_template())) { // Forum edit } elseif (bbp_is_forum_edit() && ($new_template = bbp_get_forum_edit_template())) { // Single Forum } elseif (bbp_is_single_forum() && ($new_template = bbp_get_single_forum_template())) { // Forum Archive } elseif (bbp_is_forum_archive() && ($new_template = bbp_get_forum_archive_template())) { // Topic merge } elseif (bbp_is_topic_merge() && ($new_template = bbp_get_topic_merge_template())) { // Topic split } elseif (bbp_is_topic_split() && ($new_template = bbp_get_topic_split_template())) { // Topic edit } elseif (bbp_is_topic_edit() && ($new_template = bbp_get_topic_edit_template())) { // Single Topic } elseif (bbp_is_single_topic() && ($new_template = bbp_get_single_topic_template())) { // Topic Archive } elseif (bbp_is_topic_archive() && ($new_template = bbp_get_topic_archive_template())) { // Reply move } elseif (bbp_is_reply_move() && ($new_template = bbp_get_reply_move_template())) { // Editing a reply } elseif (bbp_is_reply_edit() && ($new_template = bbp_get_reply_edit_template())) { // Single Reply } elseif (bbp_is_single_reply() && ($new_template = bbp_get_single_reply_template())) { // Editing a topic tag } elseif (bbp_is_topic_tag_edit() && ($new_template = bbp_get_topic_tag_edit_template())) { // Viewing a topic tag } elseif (bbp_is_topic_tag() && ($new_template = bbp_get_topic_tag_template())) { } // A bbPress template file was located, so override the WordPress template // and use it to switch off bbPress's theme compatibility. if (!empty($new_template)) { $template = bbp_set_template_included($new_template); } return apply_filters('bbp_template_include_theme_supports', $template); }
function x_bbpress_filter_breadcrumbs($r) { if (bbp_is_search()) { $current_text = bbp_get_search_title(); } elseif (bbp_is_forum_archive()) { $current_text = bbp_get_forum_archive_title(); } elseif (bbp_is_topic_archive()) { $current_text = bbp_get_topic_archive_title(); } elseif (bbp_is_single_view()) { $current_text = bbp_get_view_title(); } elseif (bbp_is_single_forum()) { $current_text = bbp_get_forum_title(); } elseif (bbp_is_single_topic()) { $current_text = bbp_get_topic_title(); } elseif (bbp_is_single_reply()) { $current_text = bbp_get_reply_title(); } 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="' . esc_url(bbp_get_topic_tag_edit_link()) . '" class="bbp-edit-topic-tag-link">' . esc_html__('(Edit)', 'bbpress') . '</a>'; } // Implode the results of the tag data $current_text = sprintf(__('Topic Tag: %s', 'bbpress'), implode(' ', $tag_data)); } elseif (bbp_is_topic_tag_edit()) { $current_text = __('Edit', 'bbpress'); } else { $current_text = get_the_title(); } $r = array('before' => '', 'after' => '', 'sep' => x_get_breadcrumb_delimiter(), 'pad_sep' => 0, 'sep_before' => '', 'sep_after' => '', 'crumb_before' => '', 'crumb_after' => '', 'include_home' => false, 'home_text' => x_get_breadcrumb_home_text(), 'include_root' => true, 'root_text' => bbp_get_forum_archive_title(), 'include_current' => true, 'current_text' => $current_text, 'current_before' => x_get_breadcrumb_current_before(), 'current_after' => x_get_breadcrumb_current_after()); return $r; }
the_post(); if (has_excerpt()) { the_excerpt(); } } } } elseif (class_exists('WooCommerce') and is_shop() || is_singular('product') || is_tax('product_cat') || is_tax('product_tag')) { if (hippo_option('shop-short-description')) { ?> <p><?php echo wp_kses(hippo_option('shop-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array()))); ?> </p> <?php } } elseif (function_exists('is_bbpress') and is_bbpress() || bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_topic_tag() || bbp_is_single_forum() || bbp_is_single_topic() || bbp_is_single_user() || bbp_is_search()) { if (hippo_option('forum-short-description')) { ?> <p><?php echo wp_kses(hippo_option('forum-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array()))); ?> </p> <?php } } else { if (hippo_option('blog-short-description')) { ?> <p><?php echo wp_kses(hippo_option('blog-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array()))); ?>
protected function get_page_header_title() { global $oxy_theme_options; if (bbp_is_forum_archive()) { return $oxy_theme_options['bbpress_header_forums']; } else { if (bbp_is_topic_archive()) { return $oxy_theme_options['bbpress_header_topics']; } else { if (bbp_is_single_view()) { return bbp_get_view_title(); } else { if (bbp_is_single_forum()) { return bbp_get_forum_title(); } else { if (bbp_is_single_topic()) { return bbp_get_topic_title(); } else { if (bbp_is_topic_tag()) { return __('Tag: ', 'omega-td') . bbp_get_topic_tag_name(); } else { if (bbp_is_single_reply()) { return bbp_get_reply_title(); } else { if (bbp_is_topic_tag_edit()) { return __('Edit', 'omega-td'); } else { if (bbp_is_search()) { return bbp_get_search_title(); } else { if (bbp_is_single_user()) { return bbp_get_displayed_user_field('display_name'); } else { return get_the_title(); } } } } } } } } } } }
} if ($sidebar_1 != 'None' && $sidebar_2 != 'None') { $body_classes[] = 'double-sidebars'; } } else { $sidebar_1 = get_post_meta($c_pageID, 'sbg_selected_sidebar_replacement', true); $sidebar_2 = get_post_meta($c_pageID, 'sbg_selected_sidebar_2_replacement', true); if (is_array($sidebar_1) && $sidebar_1[0]) { $body_classes[] = 'has-sidebar'; } if (is_array($sidebar_1) && $sidebar_1[0] && is_array($sidebar_2) && $sidebar_2[0]) { $body_classes[] = 'double-sidebars'; } } } if (is_bbpress() && (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search())) { $sidebar_1 = $smof_data['ppbress_sidebar']; $sidebar_2 = $smof_data['ppbress_sidebar_2']; if ($sidebar_1 != 'None') { $body_classes[] = 'has-sidebar'; } if ($sidebar_1 != 'None' && $sidebar_2 != 'None') { $body_classes[] = 'double-sidebars'; } } if (class_exists('TribeEvents') && is_events_archive()) { if ($smof_data['pages_sidebar'] != 'None') { $sidebar_1 = array($smof_data['pages_sidebar']); } else { $sidebar_1 = ''; }
/** * Prepare the full output of the breadcrumb path * * @return void */ private function prepare_breadcrumb_html() { // Add the path prefix $this->html_markup = $this->get_breadcrumb_prefix(); // Add the "Home" link $this->html_markup .= $this->get_breadcrumb_home(); // Woocommerce path prefix (e.g "Shop" ) if (class_exists('Woocommerce') && (is_woocommerce() && is_archive() && !is_shop() || is_cart() || is_checkout() || is_account_page())) { $this->html_markup .= $this->get_woocommerce_shop_page(); } // bbPress path prefix (e.g "Forums" ) if (class_exists('bbPress') && is_bbpress() && (bbp_is_topic_archive() || bbp_is_single_user() || bbp_is_search())) { $this->html_markup .= $this->get_bbpress_main_archive_page(); } // Single Posts and Pages (of all post types) if (is_singular()) { // If the post type of the current post has an archive link, display the archive breadcrumb if (isset($this->post->post_type) && get_post_type_archive_link($this->post->post_type) && $this->show_post_type_archive) { $this->html_markup .= $this->get_post_type_archive(); } // If the post doesn't have parents if (isset($this->post->post_parent) && $this->post->post_parent == 0) { $this->html_markup .= $this->get_post_terms(); // If there are parents; mostly for pages } else { $this->html_markup .= $this->get_post_ancestors(); } $this->html_markup .= $this->get_breadcrumb_leaf_markup(); } else { // Custom post types archives if (is_post_type_archive()) { $this->html_markup .= $this->get_post_type_archive(FALSE); // Search on custom post type (e.g. Woocommerce) if (is_search()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('search'); } // Taxonomy Archives } elseif (is_tax() || is_tag() || is_category()) { // If we have a tag archive, add the tag prefix if (is_tag()) { $this->html_markup .= $this->tag_archive_prefix; } $this->html_markup .= $this->get_taxonomies(); $this->html_markup .= $this->get_breadcrumb_leaf_markup('term'); // Date Archives } elseif (is_date()) { global $wp_locale; // Set variables $year = esc_html(get_query_var('year')); if (is_month() || is_day()) { $month = get_query_var('monthnum'); $month_name = $wp_locale->get_month($month); } // Year Archive, only is a leaf if (is_year()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('year'); // Month Archive, needs year link and month leaf } elseif (is_month()) { $this->html_markup .= $this->get_single_breadcrumb_markup($year, get_year_link($year)); $this->html_markup .= $this->get_breadcrumb_leaf_markup('month'); // Day Archive, needs year and month link and day leaf } elseif (is_day()) { $this->html_markup .= $this->get_single_breadcrumb_markup($year, get_year_link($year)); $this->html_markup .= $this->get_single_breadcrumb_markup($month_name, get_month_link($year, $month)); $this->html_markup .= $this->get_breadcrumb_leaf_markup('day'); } // Author Archives } elseif (is_author()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('author'); // Search Page } elseif (is_search()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('search'); // 404 Page } elseif (is_404()) { // Special treatment for Events Calendar to avoid 404 messages on list view if (class_exists('TribeEvents') && tribe_is_event() || is_events_archive()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('events'); // Default case } else { $this->html_markup .= $this->get_breadcrumb_leaf_markup('404'); } // bbPress } elseif (class_exists('bbPress')) { // Search Page if (bbp_is_search()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('bbpress_search'); // User page } elseif (bbp_is_single_user()) { $this->html_markup .= $this->get_breadcrumb_leaf_markup('bbpress_user'); } } } }
<!-- #page-header --> <div id="page-header"> <div class="container"> <h1><?php if (bbp_is_search()) { _e("Search: ", "framework"); } echo of_get_option('st_forum_title'); ?> </h1> <!-- #live-search --> <div id="live-search"> <form role="search" method="get" id="searchform" class="clearfix" action="<?php bbp_search_url(); ?> " autocomplete="off"> <input type="text" onfocus="if (this.value == '<?php _e("Search the forum...", "framework"); ?> ') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("Search the forum...", "framework"); ?> ';}" value="<?php _e("Search the forum...", "framework"); ?> " name="bbp_search" id="s" /> </form>
function wm_bbp_content_type($content_type) { //Preparing output if (bbp_is_search() || bbp_is_topic_tag() || bbp_is_single_view()) { $content_type = 'bbpress-archive'; } elseif (bbp_is_single_reply() || bbp_is_topic_edit() || bbp_is_topic_merge() || bbp_is_topic_split() || bbp_is_reply_edit() || bbp_is_reply_move() || bbp_is_topic_tag_edit() || bbp_is_single_user() || bbp_is_single_user_edit()) { $content_type = 'bbpress-article'; } //Output return apply_filters('wmhook_wm_bbp_content_type_output', $content_type); }
function porto_breadcrumbs() { // use yoast breadcrumbs if enabled if (function_exists('yoast_breadcrumb')) { $yoast_breadcrumbs = yoast_breadcrumb('', '', false); if ($yoast_breadcrumbs) { return $yoast_breadcrumbs; } } global $porto_settings; $post = isset($GLOBALS['post']) ? $GLOBALS['post'] : null; $output = ''; // add breadcrumbs prefix if (!is_front_page()) { if (isset($porto_settings['breadcrumbs-prefix']) && $porto_settings['breadcrumbs-prefix']) { $output .= '<span class="breadcrumbs-prefix">' . $porto_settings['breadcrumbs-prefix'] . '</span>'; } } // breadcrumbs start wrap $output .= '<ul class="breadcrumb">'; // add home link if (!is_front_page()) { $output .= porto_breadcrumbs_link(__('Home', 'porto'), apply_filters('woocommerce_breadcrumb_home_url', home_url())); } elseif (is_home()) { $output .= porto_breadcrumbs_link($porto_settings['blog-title']); } // add woocommerce shop page link if (class_exists('WooCommerce') && (is_woocommerce() && is_archive() && !is_shop() || is_cart() || is_checkout() || is_account_page())) { $output .= porto_breadcrumbs_shop_link(); } // add bbpress forums link if (class_exists('bbPress') && is_bbpress() && (bbp_is_topic_archive() || bbp_is_single_user() || bbp_is_search() || bbp_is_topic_tag() || bbp_is_edit())) { $output .= porto_breadcrumbs_link(bbp_get_forum_archive_title(), get_post_type_archive_link('forum')); } if (is_singular()) { if (isset($post->post_type) && get_post_type_archive_link($post->post_type) && (isset($porto_settings['breadcrumbs-archives-link']) && $porto_settings['breadcrumbs-archives-link'])) { $output .= porto_breadcrumbs_archive_link(); } elseif (isset($post->post_type) && $post->post_type == 'post' && get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) { $output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts'))); } if (isset($post->post_parent) && $post->post_parent == 0) { $output .= porto_breadcrumbs_terms_link(); } else { $output .= porto_breadcrumbs_ancestors_link(); } $output .= porto_breadcrumb_leaf(); } else { if (is_post_type_archive()) { if (is_search()) { $output .= porto_breadcrumbs_archive_link(); $output .= porto_breadcrumb_leaf('search'); } else { $output .= porto_breadcrumbs_archive_link(false); } } elseif (is_tax() || is_tag() || is_category()) { $html = porto_breadcrumbs_taxonomies_link(); $html .= porto_breadcrumb_leaf('term'); if (is_tag()) { if (get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) { $output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts'))); } $output .= sprintf(__('Tag - %s', 'porto'), $html); } elseif (is_tax('product_tag')) { $output .= sprintf(__('Product Tag - %s', 'porto'), $html); } else { if (is_category() && get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) { $output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts'))); } if (is_tax('portfolio_cat') || is_tax('portfolio_skills')) { $output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('portfolio'), get_post_type_archive_link('portfolio')); } if (is_tax('member_cat')) { $output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('member'), get_post_type_archive_link('member')); } if (is_tax('faq_cat')) { $output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('faq'), get_post_type_archive_link('faq')); } $output .= $html; } } elseif (is_date()) { global $wp_locale; if (get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) { $output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts'))); } $year = esc_html(get_query_var('year')); if (is_month() || is_day()) { $month = get_query_var('monthnum'); $month_name = $wp_locale->get_month($month); } if (is_year()) { $output .= porto_breadcrumb_leaf('year'); } elseif (is_month()) { $output .= porto_breadcrumbs_link($year, get_year_link($year)); $output .= porto_breadcrumb_leaf('month'); } elseif (is_day()) { $output .= porto_breadcrumbs_link($year, get_year_link($year)); $output .= porto_breadcrumbs_link($month_name, get_month_link($year, $month)); $output .= porto_breadcrumb_leaf('day'); } } elseif (is_author()) { $output .= porto_breadcrumb_leaf('author'); } elseif (is_search()) { $output .= porto_breadcrumb_leaf('search'); } elseif (is_404()) { $output .= porto_breadcrumb_leaf('404'); } elseif (class_exists('bbPress') && is_bbpress()) { if (bbp_is_search()) { $output .= porto_breadcrumb_leaf('bbpress_search'); } elseif (bbp_is_single_user()) { $output .= porto_breadcrumb_leaf('bbpress_user'); } else { $output .= porto_breadcrumb_leaf(); } } else { if (is_home() && !is_front_page()) { if (get_option('show_on_front') == 'page') { $output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true))); } else { $output .= porto_breadcrumbs_link($porto_settings['blog-title']); } } } } // breadcrumbs end wrap $output .= '</ul>'; return apply_filters('porto_breadcrumbs', $output); }
/** * Displays or hides specific widget */ private function restrict_widget($instance, $filter = true, $args = array()) { global $wp_query; $display_lang = $display_user = $display_device = $display_main = ''; $empty_lang = $empty_user = $empty_device = $empty_main = true; $return = false; $post_id = $wp_query->get_queried_object_id(); $display_type = isset($instance['rw_opt']['widget_select']) ? $instance['rw_opt']['widget_select'] : false; //languages if (isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'lang') === false) { if ($this->polylang_active === true || $this->wpml_active === true) { $empty_lang = false; //fix for WPML if (function_exists('icl_object_id')) { global $sitepress; if (isset($sitepress)) { $post_id = icl_object_id($post_id, 'page', true, $sitepress->get_default_language()); } else { $post_id = icl_object_id($post_id, 'page', false); } } $found_lang = defined('ICL_LANGUAGE_CODE') && isset($instance['rw_opt']['language_' . ICL_LANGUAGE_CODE]) ? true : false; if ($display_type === true) { if ($found_lang === true) { $display_lang = true; } else { $return = true; $display_lang = false; } } else { $display_lang = $found_lang === true ? false : true; } } else { $display_lang = true; } } else { $display_lang = true; } //users if ($return === false) { if (isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'user') === false) { $empty_user = false; if (is_user_logged_in()) { if (isset($instance['rw_opt']['users_logged_in'], $instance['rw_opt']['users_logged_out']) || isset($instance['rw_opt']['users_logged_in'])) { $found_user = true; } elseif (isset($instance['rw_opt']['users_logged_out'])) { $found_user = false; } } else { if (isset($instance['rw_opt']['users_logged_out'], $instance['rw_opt']['users_logged_in']) || isset($instance['rw_opt']['users_logged_out'])) { $found_user = true; } elseif (isset($instance['rw_opt']['users_logged_in'])) { $found_user = false; } } if ($display_type === true) { if ($found_user === true) { $display_user = true; } else { $return = true; $display_user = false; } } else { $display_user = $found_user === true ? false : true; } } else { $display_user = true; } } //devices if ($return === false) { if (isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'device') === false) { $empty_device = false; if (wp_is_mobile()) { if (isset($instance['rw_opt']['devices_mobile'], $instance['rw_opt']['devices_desktop']) || isset($instance['rw_opt']['devices_mobile'])) { $found_device = true; } elseif (isset($instance['rw_opt']['devices_desktop'])) { $found_device = false; } } else { if (isset($instance['rw_opt']['devices_desktop'], $instance['rw_opt']['devices_mobile']) || isset($instance['rw_opt']['devices_desktop'])) { $found_device = true; } elseif (isset($instance['rw_opt']['devices_mobile'])) { $found_device = false; } } if ($display_type === true) { if ($found_device === true) { $display_device = true; } else { $return = true; $display_device = false; } } else { $display_device = $found_device === true ? false : true; } } else { $display_device = true; } } //others if ($return === false) { if (isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'main') === false) { $empty_main = false; if (is_front_page()) { $found_main = isset($instance['rw_opt']['others_front_page']) ? true : false; if (is_home() && $found_main == false) { $found_main = isset($instance['rw_opt']['others_blog_page']) ? true : false; } } elseif (is_home()) { $found_main = isset($instance['rw_opt']['others_blog_page']) ? true : false; } elseif (is_singular()) { if (is_page()) { if (isset($instance['rw_opt']['cpt_' . get_post_type($post_id)])) { $found_main = true; } else { $found_main = isset($instance['rw_opt']['pageid_' . $post_id]) ? true : false; } } else { $found_main = isset($instance['rw_opt']['cpt_' . get_post_type($post_id)]) ? true : false; if (is_single() && $found_main == false) { $found_main = isset($instance['rw_opt']['others_single_post']) ? true : false; } } } elseif (is_post_type_archive()) { $found_main = isset($instance['rw_opt']['cpta_' . get_query_var('post_type')]) ? true : false; } elseif (is_category()) { $found_main = isset($instance['rw_opt']['category_' . get_query_var('cat')]) ? true : false; } elseif (is_tag()) { if (($object = get_queried_object()) !== NULL && isset($object->taxonomy) && $object->taxonomy === 'post_tag') { $tag = 'wp_log_type'; } else { $tag = ''; } $found_main = isset($instance['rw_opt']['taxonomy_' . $tag]) ? true : false; } elseif (is_tax()) { $found_main = isset($instance['rw_opt']['taxonomy_' . get_query_var('taxonomy')]) ? true : false; } elseif (is_404()) { $found_main = isset($instance['rw_opt']['others_404_page']) ? true : false; } elseif (is_sticky()) { $found_main = isset($instance['rw_opt']['others_sticky_post']) ? true : false; } elseif (is_search()) { $found_main = isset($instance['rw_opt']['others_search_page']) ? true : false; } elseif (is_author()) { $found_main = isset($instance['rw_opt']['others_author_archive']) ? true : false; } elseif (is_date()) { $found_main = isset($instance['rw_opt']['others_date_archive']) ? true : false; } elseif (function_exists('bbp_is_search') && bbp_is_search()) { $found_main = isset($instance['rw_opt']['bbpress_search']) ? true : false; } elseif (function_exists('bbp_is_single_user') && bbp_is_single_user()) { $found_main = isset($instance['rw_opt']['bbpress_single_user']) ? true : false; } elseif (function_exists('bbp_is_topic_tag') && bbp_is_topic_tag()) { $found_main = isset($instance['rw_opt']['bbpress_topic_tag']) ? true : false; } $display_main = $display_type === true ? $found_main === true ? true : false : ($found_main === true ? false : true); } else { $display_main = true; } } if ($filter === false) { $instance = true; } if ($display_type === true) { $final_return = $display_lang === true && $display_user === true && $display_device === true && $display_main === true ? $instance : false; } else { $final_return = $empty_lang === false && $empty_user === false && $empty_device === false && $empty_main === false && $display_lang === false && $display_user === false && $display_device === false && $display_main === false || $empty_lang === false && $empty_user === false && $empty_device === false && $display_lang === false && $display_user === false && $display_device === false || $empty_lang === false && $empty_user === false && $empty_main === false && $display_lang === false && $display_user === false && $display_main === false || $empty_lang === false && $empty_device === false && $empty_main === false && $display_lang === false && $display_device === false && $display_main === false || $empty_user === false && $empty_device === false && $empty_main === false && $display_user === false && $display_device === false && $display_main === false || $empty_lang === false && $empty_user === false && $display_lang === false && $display_user === false || $empty_lang === false && $empty_device === false && $display_lang === false && $display_device === false || $empty_lang === false && $empty_main === false && $display_lang === false && $display_main === false || $empty_user === false && $empty_device === false && $display_user === false && $display_device === false || $empty_user === false && $empty_main === false && $display_user === false && $display_main === false || $empty_device === false && $empty_main === false && $display_device === false && $display_main === false || $empty_lang === false && $display_lang === false || $empty_user === false && $display_user === false || $empty_device === false && $display_device === false || $empty_main === false && $display_main === false ? false : $instance; } //filter true or false if ($filter === true) { $final_return = apply_filters_ref_array('rw_display_widget', array($final_return, $instance)); } //if true return instance $final_return = $final_return === false ? false : $instance; //display: return $instance, hide: return false return $final_return; }
function hippo_title_text() { $query = get_queried_object(); if (is_archive()) { if (is_day()) { $archive_title = get_the_time('d F, Y'); $title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title); } elseif (is_month()) { $archive_title = get_the_time('F Y'); $title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title); } elseif (is_year()) { $archive_title = get_the_time('Y'); $title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title); } } if (is_404()) { $title = esc_html__('404 Not Found', 'monsoon'); } if (is_search()) { $title = sprintf(esc_html__('Search result for: "%s"', 'monsoon'), get_search_query()); } if (function_exists('bbp_is_search') and bbp_is_search()) { $title = sprintf(esc_html__('Search result for: "%s"', 'monsoon'), get_search_query()); } if (is_category()) { $title = sprintf(esc_html__('Category: %s', 'monsoon'), $query->name); } if (is_tag()) { $title = sprintf(esc_html__('Tag: %s', 'monsoon'), $query->name); } if (function_exists('bbp_is_topic_tag') and bbp_is_topic_tag()) { $title = sprintf(esc_html__('Tag: %s', 'monsoon'), $query->name); } if (is_author()) { $title = sprintf(esc_html__('Posts of: %s', 'monsoon'), $query->display_name); } if (is_page()) { $title = esc_html($query->post_title); } if (is_home() or is_single()) { $title = esc_html(hippo_option('blog-title')); } if (is_singular('service')) { $title = esc_html(get_the_title()); } if (is_singular('portfolio')) { $title = esc_html(get_the_title()); } if (is_tax('portfolio-type')) { $title = sprintf(esc_html__('%s', 'monsoon'), $query->name); } if (is_singular('team')) { $title = esc_html(get_the_title()); } if (is_singular('forum')) { $title = esc_html(get_the_title()); } if (is_singular('topic')) { $title = esc_html(get_the_title()); } if (is_singular('product')) { $title = esc_html(get_the_title()); } if (is_post_type_archive('product')) { $title = esc_html(post_type_archive_title('', FALSE)); } if (is_post_type_archive('forum')) { $title = esc_html(post_type_archive_title('', FALSE)); } if (is_post_type_archive('topic')) { $title = esc_html(post_type_archive_title('', FALSE)); } if (function_exists('bbp_is_single_user') and bbp_is_single_user()) { $title = esc_html(get_the_title()); } if (function_exists('bbp_is_reply_edit') and bbp_is_reply_edit()) { $title = esc_html(get_the_title()); } if (class_exists('WooCommerce')) { if (is_product_category()) { $title = sprintf(esc_html__('%s', 'monsoon'), $query->name); } if (is_product_tag()) { $title = sprintf(esc_html__('%s', 'monsoon'), $query->name); } } $title = apply_filters('hippo_title_text', $title, $title); if (empty($title)) { $title = esc_html(get_bloginfo('name')); } return $title; }
public static function template_no_access($template) { global $wp_query, $post; $check_perm = false; if (bbp_is_single_user_edit() || bbp_is_single_user()) { } elseif (bbp_is_forum_archive()) { } elseif (bbp_is_forum_edit()) { $forum_id = bbp_get_forum_id(); if (bbp_is_forum($forum_id) && !bbp_user_can_view_forum(array('forum_id' => $forum_id)) && !bbp_is_forum_private($forum_id, false)) { $check_perm = true; } } elseif (bbp_is_single_forum()) { $forum_id = bbp_get_forum_id(); if (bbp_is_forum($forum_id) && !bbp_user_can_view_forum(array('forum_id' => $forum_id)) && !bbp_is_forum_private($forum_id, false)) { $check_perm = true; } } elseif (bbp_is_topic_archive()) { } elseif (bbp_is_topic_edit() || bbp_is_single_topic()) { $check_perm = true; } elseif (is_post_type_archive(bbp_get_reply_post_type())) { } elseif (bbp_is_reply_edit() || bbp_is_single_reply()) { $check_perm = true; } elseif (bbp_is_single_view()) { } elseif (bbp_is_search()) { } elseif (bbp_is_topic_tag_edit() || bbp_is_topic_tag()) { } if ($check_perm && empty($post->post_content)) { $user_id = get_current_user_id(); $forum_id = bbp_get_forum_id(); if (!self::view_forum(false, $forum_id, $user_id)) { ob_start(); bbp_get_template_part('feedback', 'no-access'); $content = ob_get_clean(); $post->post_content = "\n{$content}\n"; $wp_query->post = $post; $wp_query->posts = array($post); } } return $template; }
/** * Calculate any extra classes for the <body> element. * These are then added using the 'body_class' filter. * Documentation: ttps://codex.wordpress.org/Plugin_API/Filter_Reference/body_class */ public function body_classes($classes) { $sidebar_1 = $this->sidebar_context(1); $sidebar_2 = $this->sidebar_context(2); $c_pageID = Avada::c_pageID(); $classes[] = 'fusion-body'; if (is_page_template('blank.php')) { $classes[] = 'body_blank'; } if (!Avada()->settings->get('header_sticky_tablet')) { $classes[] = 'no-tablet-sticky-header'; } if (!Avada()->settings->get('header_sticky_mobile')) { $classes[] = 'no-mobile-sticky-header'; } if (Avada()->settings->get('mobile_slidingbar_widgets')) { $classes[] = 'no-mobile-slidingbar'; } if (Avada()->settings->get('status_totop')) { $classes[] = 'no-totop'; } if (!Avada()->settings->get('status_totop_mobile')) { $classes[] = 'no-mobile-totop'; } if ('horizontal' == Avada()->settings->get('woocommerce_product_tab_design') && is_singular('product')) { $classes[] = 'woo-tabs-horizontal'; } if ('modern' == Avada()->settings->get('mobile_menu_design')) { $classes[] = 'mobile-logo-pos-' . strtolower(Avada()->settings->get('logo_alignment')); } if ('Boxed' == Avada()->settings->get('layout') && 'default' == get_post_meta($c_pageID, 'pyre_page_bg_layout', true) || 'boxed' == get_post_meta($c_pageID, 'pyre_page_bg_layout', true)) { $classes[] = 'layout-boxed-mode'; } else { $classes[] = 'layout-wide-mode'; } if (is_array($sidebar_1) && !empty($sidebar_1) && ($sidebar_1[0] || '0' == $sidebar_1[0]) && !is_buddypress() && !is_bbpress() && !is_page_template('100-width.php') && (!class_exists('WooCommerce') || class_exists('WooCommerce') && !is_cart() && !is_checkout() && !is_account_page() && !(get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))))) { $classes[] = 'has-sidebar'; } if (is_array($sidebar_1) && $sidebar_1[0] && is_array($sidebar_2) && $sidebar_2[0] && !is_buddypress() && !is_bbpress() && !is_page_template('100-width.php') && (!class_exists('WooCommerce') || class_exists('WooCommerce') && !is_cart() && !is_checkout() && !is_account_page() && !(get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))))) { $classes[] = 'double-sidebars'; } if (is_page_template('side-navigation.php') && is_array($sidebar_2) && $sidebar_2[0]) { $classes[] = 'double-sidebars'; } if (is_home()) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if (is_archive() && (!is_buddypress() && !is_bbpress() && (class_exists('WooCommerce') && !is_shop()) || !class_exists('WooCommerce')) && !is_tax('portfolio_category') && !is_tax('portfolio_skills') && !is_tax('portfolio_tags') && !is_tax('product_cat') && !is_tax('product_tag')) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if (is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags')) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if (is_tax('product_cat') || is_tax('product_tag')) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if (is_search()) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if ((is_bbpress() || is_buddypress()) && !bbp_is_forum_archive() && !bbp_is_topic_archive() && !bbp_is_user_home() && !bbp_is_search()) { if (Avada()->settings->get('bbpress_global_sidebar')) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } else { if (is_array($sidebar_1) && $sidebar_1[0]) { $classes[] = 'has-sidebar'; } if (is_array($sidebar_1) && $sidebar_1[0] && is_array($sidebar_2) && $sidebar_2[0]) { $classes[] = 'double-sidebars'; } } } if ((is_bbpress() || is_buddypress()) && (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search())) { if ('None' != $sidebar_1) { $classes[] = 'has-sidebar'; } if ('None' != $sidebar_1 && 'None' != $sidebar_2) { $classes[] = 'double-sidebars'; } } if (class_exists('Tribe__Events__Main') && is_events_archive()) { if (is_array($sidebar_1) && $sidebar_1[0] && !is_bbpress() && !is_page_template('100-width.php') && (!class_exists('WooCommerce') || class_exists('WooCommerce') && !is_cart() && !is_checkout() && !is_account_page() && !(get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))))) { $classes[] = 'has-sidebar'; } if (is_array($sidebar_1) && $sidebar_1[0] && is_array($sidebar_2) && $sidebar_2[0] && !is_bbpress() && !is_page_template('100-width.php') && (!class_exists('WooCommerce') || class_exists('WooCommerce') && !is_cart() && !is_checkout() && !is_account_page() && !(get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))))) { $classes[] = 'double-sidebars'; } } if ('no' != get_post_meta($c_pageID, 'pyre_display_header', true)) { if ('Left' == Avada()->settings->get('header_position') || 'Right' == Avada()->settings->get('header_position')) { $classes[] = 'side-header'; } if ('Left' == Avada()->settings->get('header_position')) { $classes[] = 'side-header-left'; } elseif ('Right' == Avada()->settings->get('header_position')) { $classes[] = 'side-header-right'; } $classes[] = 'menu-text-align-' . strtolower(Avada()->settings->get('menu_text_align')); } $classes[] = 'mobile-menu-design-' . Avada()->settings->get('mobile_menu_design'); return $classes; }
static function media_view_settings($settings, $post) { $forum_id = 0; if (is_admin()) { } elseif (bbp_is_single_user_edit() || bbp_is_single_user()) { } elseif (bbp_is_forum_archive()) { } elseif (bbp_is_forum_edit()) { $forum_id = bbp_get_forum_id(); } elseif (bbp_is_single_forum()) { $forum_id = bbp_get_forum_id(); } elseif (bbp_is_topic_archive()) { } elseif (bbp_is_topic_edit() || bbp_is_single_topic()) { $forum_id = bbp_get_forum_id(); } elseif (is_post_type_archive(bbp_get_reply_post_type())) { } elseif (bbp_is_reply_edit() || bbp_is_single_reply()) { $forum_id = bbp_get_forum_id(); } elseif (bbp_is_single_view()) { } elseif (bbp_is_search()) { } elseif (bbp_is_topic_tag_edit() || bbp_is_topic_tag()) { $forum_id = bbp_get_forum_id(); } if ($forum_id) { // @setcookie('_bbp_forum_id', $forum_id, 0, COOKIEPATH, COOKIE_DOMAIN); if (empty($settings['post'])) { $settings['post'] = array('id' => $forum_id, 'nonce' => wp_create_nonce('update-post_' . $forum_id)); } } else { // @setcookie('_bbp_forum_id', ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN); } return $settings; }
/** * Custom page title for bbPress pages * * @since bbPress (r2788) * * @param string $title Optional. The title (not used). * @param string $sep Optional, default is '»'. How to separate the * various items within the page title. * @param string $seplocation Optional. Direction to display title, 'right'. * @uses bbp_is_single_user() To check if it's a user profile page * @uses bbp_is_single_user_edit() To check if it's a user profile edit page * @uses bbp_is_user_home() To check if the profile page is of the current user * @uses get_query_var() To get the user id * @uses get_userdata() To get the user data * @uses bbp_is_single_forum() To check if it's a forum * @uses bbp_get_forum_title() To get the forum title * @uses bbp_is_single_topic() To check if it's a topic * @uses bbp_get_topic_title() To get the topic title * @uses bbp_is_single_reply() To check if it's a reply * @uses bbp_get_reply_title() To get the reply title * @uses is_tax() To check if it's the tag page * @uses get_queried_object() To get the queried object * @uses bbp_is_single_view() To check if it's a view * @uses bbp_get_view_title() To get the view title * @uses apply_filters() Calls 'bbp_raw_title' with the title * @uses apply_filters() Calls 'bbp_profile_page_wp_title' with the title, * separator and separator location * @return string The tite */ function bbp_title($title = '', $sep = '»', $seplocation = '') { // Title array $new_title = array(); /** Archives **************************************************************/ // Forum Archive if (bbp_is_forum_archive()) { $new_title['text'] = bbp_get_forum_archive_title(); // Topic Archive } elseif (bbp_is_topic_archive()) { $new_title['text'] = bbp_get_topic_archive_title(); /** Edit ******************************************************************/ // Forum edit page } elseif (bbp_is_forum_edit()) { $new_title['text'] = bbp_get_forum_title(); $new_title['format'] = esc_attr__('Forum Edit: %s', 'bbpress'); // Topic edit page } elseif (bbp_is_topic_edit()) { $new_title['text'] = bbp_get_topic_title(); $new_title['format'] = esc_attr__('Topic Edit: %s', 'bbpress'); // Reply edit page } elseif (bbp_is_reply_edit()) { $new_title['text'] = bbp_get_reply_title(); $new_title['format'] = esc_attr__('Reply Edit: %s', 'bbpress'); // Topic tag edit page } elseif (bbp_is_topic_tag_edit()) { $new_title['text'] = bbp_get_topic_tag_name(); $new_title['format'] = esc_attr__('Topic Tag Edit: %s', 'bbpress'); /** Singles ***************************************************************/ // Forum page } elseif (bbp_is_single_forum()) { $new_title['text'] = bbp_get_forum_title(); $new_title['format'] = esc_attr__('Forum: %s', 'bbpress'); // Topic page } elseif (bbp_is_single_topic()) { $new_title['text'] = bbp_get_topic_title(); $new_title['format'] = esc_attr__('Topic: %s', 'bbpress'); // Replies } elseif (bbp_is_single_reply()) { $new_title['text'] = bbp_get_reply_title(); // Topic tag page } elseif (bbp_is_topic_tag() || get_query_var('bbp_topic_tag')) { $new_title['text'] = bbp_get_topic_tag_name(); $new_title['format'] = esc_attr__('Topic Tag: %s', 'bbpress'); /** Users *****************************************************************/ // Profile page } elseif (bbp_is_single_user()) { // User is viewing their own profile if (bbp_is_user_home()) { $new_title['text'] = esc_attr_x('Your', 'User viewing his/her own profile', 'bbpress'); // User is viewing someone else's profile (so use their display name) } else { $new_title['text'] = sprintf(esc_attr_x("%s's", 'User viewing another users profile', 'bbpress'), get_userdata(bbp_get_user_id())->display_name); } // User topics created if (bbp_is_single_user_topics()) { $new_title['format'] = esc_attr__("%s Topics", 'bbpress'); // User rueplies created } elseif (bbp_is_single_user_replies()) { $new_title['format'] = esc_attr__("%s Replies", 'bbpress'); // User favorites } elseif (bbp_is_favorites()) { $new_title['format'] = esc_attr__("%s Favorites", 'bbpress'); // User subscriptions } elseif (bbp_is_subscriptions()) { $new_title['format'] = esc_attr__("%s Subscriptions", 'bbpress'); // User "home" } else { $new_title['format'] = esc_attr__("%s Profile", 'bbpress'); } // Profile edit page } elseif (bbp_is_single_user_edit()) { // Current user if (bbp_is_user_home_edit()) { $new_title['text'] = esc_attr__('Edit Your Profile', 'bbpress'); // Other user } else { $new_title['text'] = get_userdata(bbp_get_user_id())->display_name; $new_title['format'] = esc_attr__("Edit %s's Profile", 'bbpress'); } /** Views *****************************************************************/ // Views } elseif (bbp_is_single_view()) { $new_title['text'] = bbp_get_view_title(); $new_title['format'] = esc_attr__('View: %s', 'bbpress'); /** Search ****************************************************************/ // Search } elseif (bbp_is_search()) { $new_title['text'] = bbp_get_search_title(); } // This filter is deprecated. Use 'bbp_before_title_parse_args' instead. $new_title = apply_filters('bbp_raw_title_array', $new_title); // Set title array defaults $new_title = bbp_parse_args($new_title, array('text' => $title, 'format' => '%s'), 'title'); // Get the formatted raw title $new_title = sprintf($new_title['format'], $new_title['text']); // Filter the raw title $new_title = apply_filters('bbp_raw_title', $new_title, $sep, $seplocation); // Compare new title with original title if ($new_title === $title) { return $title; } // Temporary separator, for accurate flipping, if necessary $t_sep = '%WP_TITILE_SEP%'; $prefix = ''; if (!empty($new_title)) { $prefix = " {$sep} "; } // sep on right, so reverse the order if ('right' === $seplocation) { $new_title_array = array_reverse(explode($t_sep, $new_title)); $new_title = implode(" {$sep} ", $new_title_array) . $prefix; // sep on left, do not reverse } else { $new_title_array = explode($t_sep, $new_title); $new_title = $prefix . implode(" {$sep} ", $new_title_array); } // Filter and return return apply_filters('bbp_title', $new_title, $sep, $seplocation); }
function origamiez_bbpress_body_class($classes) { global $post; $tax = get_queried_object(); $query_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : NULL; if (is_singular('topic') || is_singular('forum') || is_post_type_archive('forum') || is_post_type_archive('topic') || isset($tax->taxonomy) && in_array($tax->taxonomy, array('topic-tag')) || bbp_is_search()) { array_push($classes, 'origamiez-layout-right-sidebar', 'origamiez-layout-single'); } return $classes; }
?> <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> <?php } ?> <?php if (!bbp_is_search()) { ?> <?php do_action('bbp_theme_before_reply_admin_links'); ?> <?php bbp_reply_admin_links(array('sep' => ' ')); ?> <?php do_action('bbp_theme_after_reply_admin_links'); ?> <?php
/** * Reset main query vars and filter 'the_content' to output a bbPress * template part as needed. * * @since 2.0.0 bbPress (r3032) * * @param string $template * @uses bbp_is_single_user() To check if page is single user * @uses bbp_get_single_user_template() To get user template * @uses bbp_is_single_user_edit() To check if page is single user edit * @uses bbp_get_single_user_edit_template() To get user edit template * @uses bbp_is_single_view() To check if page is single view * @uses bbp_get_single_view_template() To get view template * @uses bbp_is_search() To check if page is search * @uses bbp_get_search_template() To get search template * @uses bbp_is_forum_edit() To check if page is forum edit * @uses bbp_get_forum_edit_template() To get forum edit template * @uses bbp_is_topic_merge() To check if page is topic merge * @uses bbp_get_topic_merge_template() To get topic merge template * @uses bbp_is_topic_split() To check if page is topic split * @uses bbp_get_topic_split_template() To get topic split template * @uses bbp_is_topic_edit() To check if page is topic edit * @uses bbp_get_topic_edit_template() To get topic edit template * @uses bbp_is_reply_move() To check if page is reply move * @uses bbp_get_reply_move_template() To get reply move template * @uses bbp_is_reply_edit() To check if page is reply edit * @uses bbp_get_reply_edit_template() To get reply edit template * @uses bbp_set_theme_compat_template() To set the global theme compat template */ function bbp_template_include_theme_compat($template = '') { /** * Bail if a root template was already found. This prevents unintended * recursive filtering of 'the_content'. * * @link https://bbpress.trac.wordpress.org/ticket/2429 */ if (bbp_is_template_included()) { return $template; } /** * If BuddyPress is activated at a network level, the action order is * reversed, which causes the template integration to fail. If we're looking * at a BuddyPress page here, bail to prevent the extra processing. * * This is a bit more brute-force than is probably necessary, but gets the * job done while we work towards something more elegant. */ if (function_exists('is_buddypress') && is_buddypress()) { return $template; } // Define local variable(s) $bbp_shortcodes = bbpress()->shortcodes; // Bail if shortcodes are unset somehow if (!is_a($bbp_shortcodes, 'BBP_Shortcodes')) { return $template; } /** Users *************************************************************/ if (bbp_is_single_user_edit() || bbp_is_single_user()) { // Reset post bbp_theme_compat_reset_post(array('ID' => 0, 'post_author' => 0, 'post_date' => 0, 'post_content' => bbp_buffer_template_part('content', 'single-user', false), 'post_type' => '', 'post_title' => bbp_get_displayed_user_field('display_name'), 'post_status' => bbp_get_public_status_id(), 'is_single' => true, 'is_archive' => false, 'comment_status' => 'closed')); /** Forums ************************************************************/ // Forum archive } elseif (bbp_is_forum_archive()) { // Page exists where this archive should be $page = bbp_get_page_by_path(bbp_get_root_slug()); // Should we replace the content... if (empty($page->post_content)) { // Use the topics archive if ('topics' === bbp_show_on_root()) { $new_content = $bbp_shortcodes->display_topic_index(); // No page so show the archive } else { $new_content = $bbp_shortcodes->display_forum_index(); } // ...or use the existing page content? } else { $new_content = apply_filters('the_content', $page->post_content); } // Should we replace the title... if (empty($page->post_title)) { // Use the topics archive if ('topics' === bbp_show_on_root()) { $new_title = bbp_get_topic_archive_title(); // No page so show the archive } else { $new_title = bbp_get_forum_archive_title(); } // ...or use the existing page title? } else { $new_title = apply_filters('the_title', $page->post_title); } // Reset post bbp_theme_compat_reset_post(array('ID' => !empty($page->ID) ? $page->ID : 0, 'post_title' => $new_title, 'post_author' => 0, 'post_date' => 0, 'post_content' => $new_content, 'post_type' => bbp_get_forum_post_type(), 'post_status' => bbp_get_public_status_id(), 'is_archive' => true, 'comment_status' => 'closed')); // Single Forum } elseif (bbp_is_forum_edit()) { // Reset post bbp_theme_compat_reset_post(array('ID' => bbp_get_forum_id(), 'post_title' => bbp_get_forum_title(), 'post_author' => bbp_get_forum_author_id(), 'post_date' => 0, 'post_content' => $bbp_shortcodes->display_forum_form(), 'post_type' => bbp_get_forum_post_type(), 'post_status' => bbp_get_forum_visibility(), 'is_single' => true, 'comment_status' => 'closed')); } elseif (bbp_is_single_forum()) { // Reset post bbp_theme_compat_reset_post(array('ID' => bbp_get_forum_id(), 'post_title' => bbp_get_forum_title(), 'post_author' => bbp_get_forum_author_id(), 'post_date' => 0, 'post_content' => $bbp_shortcodes->display_forum(array('id' => bbp_get_forum_id())), 'post_type' => bbp_get_forum_post_type(), 'post_status' => bbp_get_forum_visibility(), 'is_single' => true, 'comment_status' => 'closed')); /** Topics ************************************************************/ // Topic archive } elseif (bbp_is_topic_archive()) { // Page exists where this archive should be $page = bbp_get_page_by_path(bbp_get_topic_archive_slug()); // Should we replace the content... if (empty($page->post_content)) { $new_content = $bbp_shortcodes->display_topic_index(); // ...or use the existing page content? } else { $new_content = apply_filters('the_content', $page->post_content); } // Should we replace the title... if (empty($page->post_title)) { $new_title = bbp_get_topic_archive_title(); // ...or use the existing page title? } else { $new_title = apply_filters('the_title', $page->post_title); } // Reset post bbp_theme_compat_reset_post(array('ID' => !empty($page->ID) ? $page->ID : 0, 'post_title' => bbp_get_topic_archive_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => $new_content, 'post_type' => bbp_get_topic_post_type(), 'post_status' => bbp_get_public_status_id(), 'is_archive' => true, 'comment_status' => 'closed')); // Single Topic } elseif (bbp_is_topic_edit() || bbp_is_single_topic()) { // Split if (bbp_is_topic_split()) { $new_content = bbp_buffer_template_part('form', 'topic-split', false); // Merge } elseif (bbp_is_topic_merge()) { $new_content = bbp_buffer_template_part('form', 'topic-merge', false); // Edit } elseif (bbp_is_topic_edit()) { $new_content = $bbp_shortcodes->display_topic_form(); // Single } else { $new_content = $bbp_shortcodes->display_topic(array('id' => bbp_get_topic_id())); } // Reset post bbp_theme_compat_reset_post(array('ID' => bbp_get_topic_id(), 'post_title' => bbp_get_topic_title(), 'post_author' => bbp_get_topic_author_id(), 'post_date' => 0, 'post_content' => $new_content, 'post_type' => bbp_get_topic_post_type(), 'post_status' => bbp_get_topic_status(), 'is_single' => true, 'comment_status' => 'closed')); /** Replies ***********************************************************/ // Reply archive } elseif (is_post_type_archive(bbp_get_reply_post_type())) { // Reset post bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => __('Replies', 'bbpress'), 'post_author' => 0, 'post_date' => 0, 'post_content' => $bbp_shortcodes->display_reply_index(), 'post_type' => bbp_get_reply_post_type(), 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed')); // Single Reply } elseif (bbp_is_reply_edit() || bbp_is_single_reply()) { // Move if (bbp_is_reply_move()) { $new_content = bbp_buffer_template_part('form', 'reply-move', false); // Edit } elseif (bbp_is_reply_edit()) { $new_content = $bbp_shortcodes->display_reply_form(); // Single } else { $new_content = $bbp_shortcodes->display_reply(array('id' => get_the_ID())); } // Reset post bbp_theme_compat_reset_post(array('ID' => bbp_get_reply_id(), 'post_title' => bbp_get_reply_title(), 'post_author' => bbp_get_reply_author_id(), 'post_date' => 0, 'post_content' => $new_content, 'post_type' => bbp_get_reply_post_type(), 'post_status' => bbp_get_reply_status(), 'comment_status' => 'closed')); /** Views *************************************************************/ } elseif (bbp_is_single_view()) { // Reset post bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => bbp_get_view_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => $bbp_shortcodes->display_view(array('id' => get_query_var(bbp_get_view_rewrite_id()))), 'post_type' => '', 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed')); /** Search ************************************************************/ } elseif (bbp_is_search()) { // Reset post bbp_theme_compat_reset_post(array('ID' => 0, 'post_title' => bbp_get_search_title(), 'post_author' => 0, 'post_date' => 0, 'post_content' => $bbp_shortcodes->display_search(array('search' => get_query_var(bbp_get_search_rewrite_id()))), 'post_type' => '', 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed')); /** Topic Tags ********************************************************/ // Topic Tag Edit } elseif (bbp_is_topic_tag_edit() || bbp_is_topic_tag()) { // Stash the current term in a new var set_query_var('bbp_topic_tag', get_query_var('term')); // Show topics of tag if (bbp_is_topic_tag()) { $new_content = $bbp_shortcodes->display_topics_of_tag(array('id' => bbp_get_topic_tag_id())); // Edit topic tag } elseif (bbp_is_topic_tag_edit()) { $new_content = $bbp_shortcodes->display_topic_tag_form(); } // Reset the post with our new title bbp_theme_compat_reset_post(array('ID' => 0, 'post_author' => 0, 'post_date' => 0, 'post_content' => $new_content, 'post_type' => '', 'post_title' => sprintf(__('Topic Tag: %s', 'bbpress'), '<span>' . bbp_get_topic_tag_name() . '</span>'), 'post_status' => bbp_get_public_status_id(), 'comment_status' => 'closed', 'is_tax' => true)); } /** * Bail if the template already matches a bbPress template. This includes * archive-* and single-* WordPress post_type matches (allowing * themes to use the expected format) as well as all bbPress-specific * template files for users, topics, forums, etc... * * We do this after the above checks to prevent incorrect 404 body classes * and header statuses, as well as to set the post global as needed. * * @see https://bbpress.trac.wordpress.org/ticket/1478/ */ if (bbp_is_template_included()) { return $template; /** * If we are relying on bbPress's built in theme compatibility to load * the proper content, we need to intercept the_content, replace the * output, and display ours instead. * * To do this, we first remove all filters from 'the_content' and hook * our own function into it, which runs a series of checks to determine * the context, and then uses the built in shortcodes to output the * correct results from inside an output buffer. * * Uses bbp_get_theme_compat_templates() to provide fall-backs that * should be coded without superfluous mark-up and logic (prev/next * navigation, comments, date/time, etc...) * * Hook into the 'bbp_get_bbpress_template' to override the array of * possible templates, or 'bbp_bbpress_template' to override the result. */ } elseif (bbp_is_theme_compat_active()) { bbp_remove_all_filters('the_content'); $template = bbp_get_theme_compat_templates(); } return apply_filters('bbp_template_include_theme_compat', $template); }
/** * Root search queries to seperate templates */ function st_search_template_chooser($template) { global $wp_query; $post_type = get_query_var('post_type'); // If posts if ($wp_query->is_search && $post_type == 'post') { return locate_template('search-posts.php'); } elseif ($wp_query->is_search && $post_type == 'st_kb') { return locate_template('search-st_kb.php'); } elseif (class_exists('bbPress')) { if (bbp_is_search()) { return locate_template('search-topics.php'); } } return $template; }
* @subpackage Theme */ ?> <div id="post-<?php bbp_reply_id(); ?> " <?php bbp_reply_class(); ?> > <div class="bbp-reply-header x-bbp-item-info-header"> <?php if (bbp_is_single_user_replies() || bbp_is_search()) { ?> <h3 class="x-context-title"> <?php _e('In reply to: ', 'bbpress'); ?> <a href="<?php bbp_topic_permalink(bbp_get_reply_topic_id()); ?> "><?php bbp_topic_title(bbp_get_reply_topic_id()); ?> </a> </h3>