403Webshell
Server IP : 66.29.132.124  /  Your IP : 18.220.217.228
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/blog.diixadigital.com/wp-content/plugins/rubik-extension/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/blog.diixadigital.com/wp-content/plugins/rubik-extension/rubik-extension.php
<?php
/*
Plugin Name: Rubik Extension
Plugin URI: http://bk-ninja.com
Description: Only Used For Rubik Theme
Author: bkninja
Version: 1.2
Author URI: http://bk-ninja.com
*/
    if (!defined('RUBIK_FUNCTIONS_PLUGIN_DIR')) {
        define('RUBIK_FUNCTIONS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    }
/**
 * Add widgets
 */
    
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_latest_posts.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_index_posts.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_youtube_playlist.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_most_commented.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_social_counter.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_social.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_latest_comments.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_twitter.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_flickr.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_slider.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_facebook.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_ads.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_shortcode.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_categories.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_promo_boxes.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_youtube.php");
    include(RUBIK_FUNCTIONS_PLUGIN_DIR."/widgets/widget_about.php");
    
    if ( ! function_exists( 'bk_contact_data' ) ) {  
        function bk_contact_data($contactmethods) {
        
            unset($contactmethods['aim']);
            unset($contactmethods['yim']);
            unset($contactmethods['jabber']);
            $contactmethods['publicemail'] = 'Public Email';
            $contactmethods['twitter'] = 'Twitter Username';
            $contactmethods['facebook'] = 'Facebook URL';
            $contactmethods['youtube'] = 'Youtube Username';
             
            return $contactmethods;
        }
    }
    add_filter('user_contactmethods', 'bk_contact_data');
    
    /**
     * Rubik Format Buttons
     */
    if(!function_exists('rubik_mce_buttons')) {
        function rubik_mce_buttons($buttons) {
        	array_unshift($buttons, 'styleselect');
        	return $buttons;
        }
        add_filter('mce_buttons', 'rubik_mce_buttons');   
    }
    /*
    * Callback function to filter the MCE settings
    */
    if(!function_exists('rubik_mce_before_init_insert_formats')) {
        function rubik_mce_before_init_insert_formats( $init_array ) {  
        
        // Define the style_formats array
            $style_formats = array(  
                array (
                    'title' => 'Text padding',
                    'items' => array (
                		array(  
                			'parent_id' => 'bk_text_padding',
                            'title' => 'text -',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-0',
                            'wrapper' => true,
                		),  
                		array(  
                			'parent_id' => 'bk_text_padding',
                            'title' => '- text',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-4',
                            'wrapper' => true,
                		),
                		array(  
                			'parent_id' => 'bk_text_padding',
                            'title' => '- text -',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-1',
                            'wrapper' => true,
                		),
                        array(
                            'parent_id' => 'bk_text_padding',
                            'title' => '- text --',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-3',
                            'wrapper' => true,
                        ),
                        array(
                            'parent_id' => 'bk_text_padding',
                            'title' => '-- text -',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-6',
                            'wrapper' => true,
                        ),
                        array(
                            'parent_id' => 'bk_text_padding',
                            'title' => '-- text --',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-2',
                            'wrapper' => true,
                        ),
                        array(
                            'parent_id' => 'bk_text_padding',
                            'title' => '--- text ---',
                            'block' => 'div',
                            'classes' => 'bk-paragraph-padding-5',
                            'wrapper' => true,
                        ),
                    ),
                ),
        	); 
            
        	$init_array['style_formats'] = json_encode( $style_formats );  
        	
        	return $init_array;  
          
        }
        // Attach callback to 'tiny_mce_before_init' 
        add_filter( 'tiny_mce_before_init', 'rubik_mce_before_init_insert_formats' ); 
    }
    
    function rubik_theme_add_editor_styles() {
        add_editor_style( 'custom-editor-style.css' );
    }
    add_action( 'init', 'rubik_theme_add_editor_styles' );
    /**
     * Share Box
     */
    if ( ! function_exists( 'bk_share_box_no_cnt' ) ) {
        function bk_share_box_no_cnt($bkPostId, $social_share, $share_items) {
            
            $item_cnt=6;
            $itemHideClass = array();
            
            for($item_cnt=6; $item_cnt > 0; $item_cnt--) {
                $itemHideClass[$item_cnt] = '';
            }
            
            for($item_cnt=6; $item_cnt > intval($share_items); $item_cnt--) {
                $itemHideClass[$item_cnt] = 'hide item-hide';
            }

            $titleget = get_the_title($bkPostId);
            $social_text = '';
            $share_box = '';
            $fb_oc = "window.open('http://www.facebook.com/sharer.php?u=".urlencode(get_permalink())."','Facebook','width=600,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;";
            $tw_oc = "window.open('http://twitter.com/share?url=".urlencode(get_permalink())."&amp;text=".str_replace(" ", "%20", $titleget)."','Twitter share','width=600,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;";
            $gp_oc = "window.open('https://plus.google.com/share?url=".urlencode(get_permalink())."','Google plus','width=585,height=666,left='+(screen.availWidth/2-292)+',top='+(screen.availHeight/2-333)+''); return false;";
            $stu_oc = "window.open('http://www.stumbleupon.com/submit?url=".urlencode(get_permalink())."','Stumbleupon','width=600,height=300,left='+(screen.availWidth/2-300)+',top='+(screen.availHeight/2-150)+''); return false;";
            $li_oc = "window.open('http://www.linkedin.com/shareArticle?mini=true&amp;url=".urlencode(get_permalink())."','Linkedin','width=863,height=500,left='+(screen.availWidth/2-431)+',top='+(screen.availHeight/2-250)+''); return false;";
            
            $fb_social_text =  '';
            $tw_social_text =  '';
            $gp_social_text =  '';
            $pi_social_text =  '';
            $stu_social_text = '';
            $li_social_text =  '';

            if(isset($social_share['fb_text']) && ($social_share['fb_text'] != null) && ($social_share['fb_text'] != '')){$fb_social_text = '<span>'.$social_share['fb_text'].'</span>';}
            if(isset($social_share['tw_text']) && ($social_share['tw_text'] != null) && ($social_share['tw_text'] != '')){$tw_social_text = '<span>'.$social_share['tw_text'].'</span>';}
            if(isset($social_share['gp_text']) && ($social_share['gp_text'] != null) && ($social_share['gp_text'] != '')){$gp_social_text = '<span>'.$social_share['gp_text'].'</span>';}
            if(isset($social_share['pi_text']) && ($social_share['pi_text'] != null) && ($social_share['pi_text'] != '')){$pi_social_text = '<span>'.$social_share['pi_text'].'</span>';}
            if(isset($social_share['stu_text']) && ($social_share['stu_text'] != null) && ($social_share['stu_text'] != '')){$stu_social_text = '<span>'.$social_share['stu_text'].'</span>';}
            if(isset($social_share['li_text']) && ($social_share['li_text'] != null) && ($social_share['li_text'] != '')){$li_social_text = '<span>'.$social_share['li_text'].'</span>';}
            ?>
            <?php
            $share_box .= '<div class="share-box-wrap '.$share_items.'">';
            $share_box .= '<div class="share-box">';
            $share_box .= '<ul class="social-share clearfix">';
            if ($social_share['fb']):
                $share_box .= '<li class="bk_facebook_share '.$itemHideClass[1].'"><a onClick="'.$fb_oc.'" href="http://www.facebook.com/sharer.php?u='.urlencode(get_permalink()).'"><div class="share-item__icon"><i class="fa fa-facebook " title="Facebook"></i>'.$fb_social_text.'</div></a></li>';
            endif;
            
            if ($social_share['tw']):
                $share_box .= '<li class="bk_twitter_share '.$itemHideClass[2].'"><a onClick="'.$tw_oc.'" href="http://twitter.com/share?url='.urlencode(get_permalink()).'&amp;text='.str_replace(" ", "%20", $titleget).'"><div class="share-item__icon"><i class="fa fa-twitter " title="Twitter"></i>'.$tw_social_text.'</div></a></li>';
            endif;
            
            if ($social_share['gp']):
                $share_box .= '<li class="bk_gplus_share '.$itemHideClass[3].'"><a onClick="'.$gp_oc.'" href="https://plus.google.com/share?url='.urlencode(get_permalink()).'"><div class="share-item__icon"><i class="fa fa-google-plus " title="Google Plus"></i>'.$gp_social_text.'</div></a></li>';
            endif;
            
            if ($social_share['pi']):
                $share_box .= '<li class="bk_pinterest_share '.$itemHideClass[4].'"><a href="javascript:void((function()%7Bvar%20e=document.createElement(&apos;script&apos;);e.setAttribute(&apos;type&apos;,&apos;text/javascript&apos;);e.setAttribute(&apos;charset&apos;,&apos;UTF-8&apos;);e.setAttribute(&apos;src&apos;,&apos;http://assets.pinterest.com/js/pinmarklet.js?r=&apos;+Math.random()*99999999);document.body.appendChild(e)%7D)());"><div class="share-item__icon"><i class="fa fa-pinterest " title="Pinterest"></i>'.$pi_social_text.'</div></a></li>';
            endif;
            
            if ($social_share['stu']):
                $share_box .= '<li class="bk_stumbleupon_share '.$itemHideClass[5].'"><a onClick="'.$stu_oc.'" href="http://www.stumbleupon.com/submit?url='. urlencode(get_permalink()).'"><div class="share-item__icon"><i class="fa fa-stumbleupon " title="Stumbleupon"></i>'.$stu_social_text.'</div></a></li>';
            endif;
            
            if ($social_share['li']):
                $share_box .= '<li class="bk_linkedin_share '.$itemHideClass[6].'"><a onClick="'.$li_oc.'" href="http://www.linkedin.com/shareArticle?mini=true&amp;url='. urlencode(get_permalink()).'"><div class="share-item__icon"><i class="fa fa-linkedin " title="Linkedin"></i>'.$li_social_text.'</div></a></li>';
            endif;            
            $share_box .= '<li class="bk_share_expand_btn"><i class="fa fa-plus" aria-hidden="true"></i></li>';
            $share_box .= '<li class="bk_share_close_btn hide"><i class="fa fa-minus" aria-hidden="true"></i></li>';
            
            $share_box .= '</ul>';
            $share_box .= '</div>';
            $share_box .= '</div>'; 
            return $share_box; 
        }//End Share No CNT
    }
    
    /**-------------------------------------------------------------------------------------------------------------------------
     * remove redux sample config & notice
     */
    if ( ! function_exists( 'rubik_redux_remove_notice' ) ) {
    	function rubik_redux_remove_notice() {
    		if ( class_exists( 'ReduxFrameworkPlugin' ) ) {
    			remove_filter( 'plugin_row_meta', array( ReduxFrameworkPlugin::instance(), 'plugin_metalinks' ), null, 2 );
    			remove_action( 'admin_notices', array( ReduxFrameworkPlugin::get_instance(), 'admin_notices' ) );
    		}
    	}
    	add_action( 'redux/loaded', 'rubik_redux_remove_notice' );
    }
    /**-------------------------------------------------------------------------------------------------------------------------
     * remove redux admin page
     */
    if ( ! function_exists( 'rubik_remove_redux_page' ) ) {
    	function rubik_remove_redux_page() {
    		remove_submenu_page( 'tools.php', 'redux-about' );
    	}
    	add_action( 'admin_menu', 'rubik_remove_redux_page', 12 );
    }
    
    /**-------------------------------------------------------------------------------------------------------------------------
     * rubik_single_save_cookie
     */
    if ( ! function_exists( 'rubik_single_save_cookie' ) ) {
        function rubik_single_save_cookie() {
            $bk_uri = explode('/', $_SERVER["REQUEST_URI"]);
            $bkcookied = 0;
            $cookietime = 30*60;
            if($bk_uri[count($bk_uri) - 1] !== '') {
                $cookie_name = preg_replace('/[^A-Za-z0-9]/', '', $bk_uri[count($bk_uri) - 1]);
            }else {
                $cookie_name = preg_replace('/[^A-Za-z0-9]/', '', $bk_uri[count($bk_uri) - 2]);
            }
            if(!isset($_COOKIE[$cookie_name])) {
                setcookie($cookie_name, '1', time() + $cookietime);  /* expire in 1 hour */
                $bkcookied = 1;
            }else {
                $bkcookied = 0;
            } 
            return $bkcookied;  
        }
    }
    
    add_action( 'add_meta_boxes', 'rubik_meta_box_add' );
    if ( ! function_exists( 'rubik_meta_box_add' ) ) {
        function rubik_meta_box_add() {
            add_meta_box( 'pagenav_pagebuilder', 'The Latest Posts Section', 'rubik_meta_box_cb', 'page', 'normal', 'high' );
        }
    }
    if ( ! function_exists( 'rubik_meta_box_cb' ) ) {
        function rubik_meta_box_cb() {
            // $post is already set, and contains an object: the WordPress post
            global $post;
            $values = get_post_custom( $post->ID );
            $heading_text    = isset( $values['bk_pagenav_heading'][0] )        ? esc_attr( $values['bk_pagenav_heading'][0] ) : '';
            $large_1st       = isset( $values['bk_pagenav_large_1st'][0] )      ? esc_attr( $values['bk_pagenav_large_1st'][0] ) : '';
            $layout_selected = isset( $values['bk_pagenav_layout'][0] ) ? esc_attr( $values['bk_pagenav_layout'][0] ) : '';
            $excerpt_length  = isset( $values['bk_pagenav_excerpt'][0] ) ? esc_attr( $values['bk_pagenav_excerpt'][0] ) : '';
            $icon_selected   = isset( $values['bk_pagenav_post_icon'][0] ) ? esc_attr( $values['bk_pagenav_post_icon'][0] ) : '';
            $sb_selected     = isset( $values['bk_pagenav_sb_select'][0] ) ? esc_attr( $values['bk_pagenav_sb_select'][0] ) : '';
            
            if(isset($excerpt_length) && ($excerpt_length == '')) {
                $excerpt_length = 15;
            }
            
            $bk_sidebar = array();
            $bk_sidebar['global'] = esc_html__( 'From Theme Options', 'rubik' );
            $bk_sidebar['disable'] = esc_html__( 'Disable Sidebar', 'rubik' );
            foreach ( $GLOBALS['wp_registered_sidebars'] as $value => $label ) {
                $bk_sidebar[$value] = ucwords( $label['name'] );
            }
        
            // We'll use this nonce field later on when saving.
            wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );
            ?>
            <p>
                <label for="bk_pagenav_heading">Heading Text</label>
                <input type="text" name="bk_pagenav_heading" value="<?php echo esc_attr($heading_text);?>"/>
            </p>
            <p>
                <label for="bk_pagenav_layout">Latest Layout Option</label>
                <select name="bk_pagenav_layout" id="bk_pagenav_layout">
                    <option value="disable" <?php selected( $layout_selected, 'disable' ); ?>>Disable</option>
                    <option value="classic_blog" <?php selected( $layout_selected, 'classic_blog' ); ?>>Classic Blog</option>
                    <option value="large_blog" <?php selected( $layout_selected, 'large_blog' ); ?>>Large Blog</option>
                    <option value="large_blog_2" <?php selected( $layout_selected, 'large_blog_2' ); ?>>Large Blog 2</option>
                    <option value="masonry" <?php selected( $layout_selected, 'masonry' ); ?>>Masonry</option>
                    <option value="row" <?php selected( $layout_selected, 'row' ); ?>>Row</option>
                    <option value="square_grid" <?php selected( $layout_selected, 'square_grid' ); ?>>Square Grid</option>
                </select>
            </p>
            
            <p>
                <label for="bk_pagenav_excerpt">Excerpt Length</label>
                <input type="text" name="bk_pagenav_excerpt" value="<?php echo esc_attr($excerpt_length);?>"/>
            </p>
            
            <p>
                <label for="bk_pagenav_post_icon">Post Icon For This Section</label>
                <select name="bk_pagenav_post_icon" id="bk_pagenav_post_icon">
                    <option value="show" <?php selected( $icon_selected, 'show' ); ?>>Show</option>
                    <option value="hide" <?php selected( $icon_selected, 'hide' ); ?>>Hide</option>
                </select>
            </p>
            
            <p>
                <label for="bk_pagenav_large_1st">Large Post at first</label>
                <select name="bk_pagenav_large_1st" id="bk_pagenav_large_1st">
                    <option value="disable" <?php selected( $large_1st, 'disable' ); ?>>Disable</option>        
                    <option value="enable" <?php selected( $large_1st, 'enable' ); ?>>Enable</option>
                </select>
            </p>
            
            <p>
                <label for="bk_pagenav_sb_select">Choose a sidebar for this section</label>
                <select name="bk_pagenav_sb_select" id="bk_pagenav_sb_select">
                    <?php
                    foreach ( $bk_sidebar as $sidebarID => $sidebarName ) {
                        ?>
                        <option value="<?php echo $sidebarID;?>" <?php selected( $sb_selected, $sidebarID ); ?>><?php echo $sidebarName;?></option>
                        <?php
                    }
                    ?>
                </select>
            </p>
            <?php    
        }
    }
    add_action( 'save_post', 'rubik_meta_box_save' );
    
    if ( ! function_exists( 'rubik_meta_box_save' ) ) {
        function rubik_meta_box_save( $post_id ){
            // Bail if we're doing an auto save
            if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
             
            // if our nonce isn't there, or we can't verify it, bail
            if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;
             
            // if our current user can't edit this post, bail
            if( !current_user_can( 'edit_post', $post_id ) ) return;
            
            // Make sure your data is set before trying to save it
            
            if( isset( $_POST['bk_pagenav_heading'] ) )
                update_post_meta( $post_id, 'bk_pagenav_heading', esc_attr( $_POST['bk_pagenav_heading'] ) );
                
            if( isset( $_POST['bk_pagenav_layout'] ) )
                update_post_meta( $post_id, 'bk_pagenav_layout', esc_attr( $_POST['bk_pagenav_layout'] ) );
            
            if( isset( $_POST['bk_pagenav_excerpt'] ) )
                update_post_meta( $post_id, 'bk_pagenav_excerpt', esc_attr( $_POST['bk_pagenav_excerpt'] ) );
            
            if( isset( $_POST['bk_pagenav_post_icon'] ) )
                update_post_meta( $post_id, 'bk_pagenav_post_icon', esc_attr( $_POST['bk_pagenav_post_icon'] ) );
            
            if( isset( $_POST['bk_pagenav_large_1st'] ) )
                update_post_meta( $post_id, 'bk_pagenav_large_1st', esc_attr( $_POST['bk_pagenav_large_1st'] ) );
            
            if( isset( $_POST['bk_pagenav_sb_select'] ) )
                update_post_meta( $post_id, 'bk_pagenav_sb_select', esc_attr( $_POST['bk_pagenav_sb_select'] ) );
    
        }
    }
/**
 * Breadcrumbs
 */
    if ( ! function_exists( 'rubik_breadcrumbs' ) ) {
    	function rubik_breadcrumbs($options = array()) 
    	{	
    		
    		global $post;
     
    		$text['home']     = _x('Home', 'breadcrumbs', 'rubik'); // text for the 'Home' link
    		$text['category'] = esc_html__('Category: "%s"', 'rubik'); // text for a category page
    		$text['tax'] 	  = esc_html__('Archive for "%s"', 'rubik'); // text for a taxonomy page
    		$text['search']   = esc_html__('Search Results for "%s" Query', 'rubik'); // text for a search results page
    		$text['tag']      = esc_html__('Posts Tagged "%s"', 'rubik'); // text for a tag page
    		$text['author']   = esc_html__('Author: %s', 'rubik'); // text for an author page
    		$text['404']      = esc_html__('Error 404', 'rubik'); // text for the 404 page
    	
    		$defaults = array(
    			'show_current' => 1, // 1 - show current post/page title in breadcrumbs, 0 - don't show
    			'show_on_home' => 0, // 1 - show breadcrumbs on the homepage, 0 - don't show
    			'delimiter' => '<span class="delim">&rsaquo;</span>',
    			'before' => '<span class="current">',
    			'after' => '</span>',
    			
    			'home_before' => '<i class="fa fa-home"></i>',
    			'home_after' => '',
    			'home_link' => esc_url(home_url('/')) . '/',
    
    			'link_before' => '<span">',
    			'link_after'  => '</span>',
    			'link_attr'   => '',
    			'link_in_before' => '<span>',
    			'link_in_after'  => '</span>'
    		);
    		
    		extract($defaults);
    		
    		$link = '<a href="%1$s">' . $link_in_before . '%2$s' . $link_in_after . '</a>';
    				
    		// form whole link option
    		$link = $link_before . $link . $link_after;
    
    		if (isset($options['text'])) {
    			$options['text'] = array_merge($text, (array) $options['text']);
    		}
    
    		// override defaults
    		extract($options);
    
    		// regex replacement
    		$replace = $link_before . '<a' . $link_attr . '\\1>' . $link_in_before . '\\2' . $link_in_after . '</a>' . $link_after;
    		
    		// normal breadcrumbs
    		if ((is_home() || is_front_page())) {
    			
    			if ($show_on_home == 1) {
    				echo '<div class="bk-breadcrumbs-wrap bkwrapper container"><div class="breadcrumbs">'. $home_before . '<a href="' . $home_link . '">' . $text['home'] . '</a>'. $home_after .'</div>';
    			}
    	
    		} else {
    	
    			echo '<div class="bk-breadcrumbs-wrap bkwrapper container"><div class="breadcrumbs">' . $home_before . sprintf($link, $home_link, $text['home']) . $home_after . $delimiter;
    			
    			if (is_category() || is_tax()) 
    			{
    				$the_cat = get_category(get_query_var('cat'), false);
    				
    				// have parents?
    				if ($the_cat->parent != 0) {
    					
    					$cats = get_category_parents($the_cat->parent, true, $delimiter);					
    					echo (preg_replace('#<a([^>]+)>([^<]+)</a>#', $replace, $cats));
    				}
    								
    				// print category
    				echo $before . sprintf((is_category() ? $text['category'] : $text['tax']), single_cat_title('', false)) . $after;
    	
    			}
    			else if (is_search()) {
    				
    				echo $before . sprintf($text['search'], get_search_query()) . $after;
    	
    			}
    			else if (is_day()) {
    				
    				echo  sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')) . $delimiter
    					. sprintf($link, get_month_link(get_the_time('Y'),get_the_time('m')), get_the_time('F')) . $delimiter
    					. $before . get_the_time('d') . $after;
    	
    			}
    			else if (is_month()) {
    				
    				echo  sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')) . $delimiter
    					. $before . get_the_time('F') . $after;
    	
    			}
    			else if (is_year()) {
    				
    				echo $before . get_the_time('Y') . $after;
    	
    			}
    			// single post or page
    			else if (is_single() && !is_attachment()) {
    				
    				// custom post type
    				if (get_post_type() != 'post') {
    					
    					$post_type = get_post_type_object(get_post_type());
    					printf($link, get_post_type_archive_link(get_post_type()), $post_type->labels->name);
    					
    					if ($show_current == 1) {
    						echo $delimiter . $before . get_the_title() . $after;	
    					}
    				}
    				else {
    					
    					$cat = get_the_category();
    					$cats = get_category_parents($cat[0], true, $delimiter);
    					
    					if ($show_current == 0) {
    						$cats = preg_replace("#^(.+)$delimiter$#", "$1", $cats);	
    					}
    					
    					echo preg_replace('#<a([^>]+)>([^<]+)</a>#', $replace, $cats);
    					
    					if ($show_current == 1) {
    						echo $before . get_the_title() . $after;	
    					}
    				}
    	
    			}
    			elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
    
    				$post_type = get_post_type_object(get_post_type());
    				
    				echo $before . $post_type->labels->name . $after;
    	
    			} 
    			elseif (is_attachment()) {
    				
    				$parent = get_post($post->post_parent);
    				$cat = current(get_the_category($parent->ID));
    				$cats = get_category_parents($cat, true, $delimiter);
    				
    				if (!is_wp_error($cats)) {
    					echo preg_replace('#<a([^>]+)>([^<]+)</a>#', $replace, $cats);
    				}
    				
    				printf($link, get_permalink($parent), $parent->post_title);
    				
    				if ($show_current == 1) {
    					echo $delimiter . $before . get_the_title() . $after;	
    				}
    	
    			}
    			elseif (is_page() && !$post->post_parent && $show_current == 1) {
    	
    				echo $before . get_the_title() . $after;
    	
    			} 
    			elseif (is_page() && $post->post_parent) {
    				
    				$parent_id  = $post->post_parent;
    				$breadcrumbs = array();
    				
    				while ($parent_id) {
    					$page = get_post($parent_id);
    					$breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID));
    					$parent_id  = $page->post_parent;
    				}
    				
    				$breadcrumbs = array_reverse($breadcrumbs);
    				
    				for ($i = 0; $i < count($breadcrumbs); $i++) {
    					
    					echo $breadcrumbs[$i];
    					
    					if ($i != count($breadcrumbs)-1) {
    						echo $delimiter;	
    					}
    				}
    				
    				if ($show_current == 1) {
    					echo $delimiter . $before . get_the_title() . $after;	
    				}
    	
    			}
    			elseif (is_tag()) {
    				echo $before . sprintf($text['tag'], single_tag_title('', false)) . $after;
    	
    			}
    			elseif (is_author()) {
    				
    				global $author;
    				
    				$userdata = get_userdata($author);
    				echo $before . sprintf($text['author'], $userdata->display_name) . $after;
    	
    			}
    			elseif (is_404()) {
    				echo $before . $text['404'] . $after;
    			}
    	
    			// have pages?
    			if (get_query_var('paged')) {
    				
    				if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) {
    					echo ' (' . esc_html__('Page', 'rubik') . ' ' . get_query_var('paged') . ')';
    				}
    			}
    	
    			echo '</div></div>';
    	
    		}
    	
    	} // rubik_breadcrumbs()
    } 

    // Disables the block editor from managing widgets in the Gutenberg plugin.
    add_filter( 'gutenberg_use_widgets_block_editor', '__return_false' );
    // Disables the block editor from managing widgets.
    add_filter( 'use_widgets_block_editor', '__return_false' );

Youez - 2016 - github.com/yon3zu
LinuXploit