tags. Bootstrap needs an additional 'table' class to style tables.
// More info: http://twitter.github.com/bootstrap/base-css.htm
if ( ! function_exists('wpbootstrap_add_table_class') ) {
function wpbootstrap_add_table_class( $content ) {
$table_has_class = preg_match( '/
',
);
return $defaults;
}
add_filter( 'comment_form_default_fields', 'wpbootstrap_comment_form_fields' );
}
// Changes the default password protection form markup
if ( ! function_exists( 'wpbootstrap_password_form' ) ) {
function wpbootstrap_password_form() {
global $post;
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
$form = '';
return $form;
}
add_filter( 'the_password_form', 'wpbootstrap_password_form' );
}
// removes invalid rel="category tag" attribute from the links
if ( ! function_exists('wpbootstrap_remove_category_rel') ) {
function wpbootstrap_remove_category_rel( $link ) {
$link = str_replace( 'rel="category tag"', "", $link );
return $link;
}
add_filter( 'the_category', 'wpbootstrap_remove_category_rel' );
}
// Declare Bootstrap version the theme is built with
if( function_exists('ddlayout_set_framework'))
{
ddlayout_set_framework('bootstrap-3');
}
/**
EMERSON: Custom WPML Switcher for Toolset Starter
Start
*/
/** Load the toolset starter WPML language switcher */
add_filter( 'wp_nav_menu_items', 'toolset_starter_lang_switcher',10,2 );
/** We want to remove the WPML default language switcher hook to load the customized lang switcher designed for this theme */
global $icl_language_switcher,$sitepress_settings,$is_lang_selector_dropdown;
if (is_object($icl_language_switcher)) {
//Check selector type
$is_lang_selector_dropdown=false;
if (isset($sitepress_settings['icl_lang_sel_type'])) {
$selector_type= $sitepress_settings['icl_lang_sel_type'];
if ('dropdown' == $selector_type) {
$is_lang_selector_dropdown=true;
}
}
if ($is_lang_selector_dropdown) {
remove_filter('wp_nav_menu_items', array($icl_language_switcher, 'wp_nav_menu_items_filter'), 10, 2);
}
}
/** Hook function */
function toolset_starter_lang_switcher($items,$args) {
$multilingual=false;
$languages='';
//Check if we are on multilingual mode
$languages= apply_filters( 'wpml_active_languages', NULL, array( 'skip_missing' => 0 ) );
if ((!(empty($languages))) && (is_array($languages))) {
//multilingual
global $sitepress_settings;
$multilingual=true;
}
//Let's retrieved languages
if ($multilingual) {
if (empty($languages)) {
//We have empty languages.
//Test for backward compatibility with older WPML versions where active languages API is not yet defined
if (function_exists('icl_get_languages')) {
$languages = icl_get_languages('skip_missing=0');
}
}
//Languages set, implies WPML is active
global $is_lang_selector_dropdown;
if(!empty($sitepress_settings['display_ls_in_menu']) && ( !function_exists( 'wpml_home_url_ls_hide_check' ) || !wpml_home_url_ls_hide_check() ) && ($is_lang_selector_dropdown) ){
/** We want to display our customized lang switcher ONLY if
/* WPML -> Languages -> Language switcher options -> Language switcher in the WP Menu -> Display the language switcher in the WP Menu is checked
*/
/** TOOLSET STARTER 1.3.4: Add the customized lang switcher to the correct menu set in 'Display the language switcher in the WP Menu' */
/** START */
//Get the menu for WPML language switcher
$menu_match=false;
if (isset($sitepress_settings['menu_for_ls'])) {
$menu_for_ls=$sitepress_settings['menu_for_ls'];
$menu_for_ls=intval($menu_for_ls);
if ($menu_for_ls > 0) {
//menu defined, get the menu slug corresponding this ID
$menu_details = get_term( $menu_for_ls, 'nav_menu' );
$menu_for_ls_slug_setting = $menu_details->slug;
if (isset($args->menu->slug)) {
$menu_slug_under_process=$args->menu->slug;
if ($menu_slug_under_process == $menu_for_ls_slug_setting) {
$menu_match=true;
}
}
}
}
/** END */
if ((1 < count($languages)) && ($menu_match)){
$ll_flag = $languages[ICL_LANGUAGE_CODE]['country_flag_url'];
$ll_url = $languages[ICL_LANGUAGE_CODE]['url'];
$ll_code = $languages[ICL_LANGUAGE_CODE]['language_code'];
$ll_nname = $languages[ICL_LANGUAGE_CODE]['native_name'];
$ll_tname = $languages[ICL_LANGUAGE_CODE]['translated_name'];
//Flag content
//Check if flags are enabled
$flags_enabled=false;
if (isset($sitepress_settings['icl_lso_flags'])) {
$flag_setting=$sitepress_settings['icl_lso_flags'];
if ($flag_setting) {
$flags_enabled=true;
}
}
//Language name in display language
$lang_name_disp_language_enabled=false;
if (isset($sitepress_settings['icl_lso_display_lang'])) {
$icl_lso_display_lang_setting=$sitepress_settings['icl_lso_display_lang'];
if ($icl_lso_display_lang_setting) {
$lang_name_disp_language_enabled=true;
}
}
//Native language name
$native_lang_name_enabled=false;
if (isset($sitepress_settings['icl_lso_native_lang'])) {
$icl_lso_native_lang_setting=$sitepress_settings['icl_lso_native_lang'];
if ($icl_lso_native_lang_setting) {
$native_lang_name_enabled=true;
}
}
$flag_content_main='';
if ($flags_enabled) {
$flag_content_main= '';
}
$native_lang_main='';
if ($native_lang_name_enabled) {
$native_lang_main=$ll_nname;
}
$show_parenthesis=true;
if (!($native_lang_name_enabled)) {
//Native lang off, don't show parenthesis
$show_parenthesis=false;
}
$open_parenthesis='';
$close_parenthesis='';
if ($show_parenthesis) {
$open_parenthesis='(';
$close_parenthesis=')';
}
$lang_name_display_lang_main='';
if ($lang_name_disp_language_enabled) {
$lang_name_display_lang_main= $open_parenthesis.$ll_tname.$close_parenthesis;
}
if (($native_lang_name_enabled) && ($lang_name_disp_language_enabled)) {
$lang_name_display_lang_main='';
}
$items = $items.'
%1$s %2$s', get_comment_author_link(), ( $comment->user_id === $post->post_author ) ? ' ' . __( 'Post author', "toolset_starter" ) . '' : '' ); ?>
', esc_url(get_comment_link( $comment->comment_ID )), get_comment_time( 'c' ), sprintf( '%1$s ' . __( 'at', "toolset_starter" ) . ' %2$s', get_comment_date(), get_comment_time() ) ); ?> comment_approved ) : ?>