Beranda > WordPress > Bagaimana Membuat Plugin Breadcrumb NavXT Mendukung Banyak Bahasa

Bagaimana Membuat Plugin Breadcrumb NavXT Mendukung Banyak Bahasa

Hari ini saya baru menyadari bahwa ketika saya mencoba menggunakan plugin Breadcrumb NavXT untuk salah satu situs saya yang multi bahasa, ternyata plugin ini belum mendukung fitur tersebut sepenuhnya, meskipun di dalam plugin ini sudah tersedia beberapa berkas.mo untuk mendukung banyak bahasa di dalam sub direktori languages. Saya tidak tahu mengapa belum ada komplain sampai sejauh ini? Saya menduga bahwa mereka yang menggunakan plugin ini hanya menggunakan satu bahasa saja, yaitu English sehingga tidak terlalu melihat dampak fitur multi bahasanya. Lalu, supaya mendukung banyak bahasa, maka saya memodifikasi berkas breadcrumb_navxt_class.php. Mohon dicatat bahwa modifikasi ini saya terapkan pada Breadcrumb NavXT versi 3.4.1. Saya berharap agar modifikasi ini dapat diimplementasikan pada versi berikutnya oleh pembuat plugin ini.

Temukan kode ini:

		$this->anchor = str_replace('%title%', strip_tags($this->title), str_replace('%link%', $url, $template));

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$this->anchor = str_replace('%title%', strip_tags(__($this->title, 'breadcrumb_navxt')), str_replace('%link%', $url, $template));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

		$breadcrumb = $this->add(new bcn_breadcrumb(wp_specialchars($s, 1), $this->opt['search_prefix'], $this->opt['search_suffix']));

lalu timpa dengan kode berikut:

		$breadcrumb = $this->add(new bcn_breadcrumb(wp_specialchars($s, 1), __($this->opt['search_prefix'], 'breadcrumb_navxt'), __($this->opt['search_suffix'], 'breadcrumb_navxt') ));

Cari lagi kode yang ini:

			$breadcrumb->set_anchor($this->opt['search_anchor'], $url);

lalu timpa dengan kode berikut:

			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['search_anchor'], 'breadcrumb_navxt'), $url);
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

		$this->trail[] = new bcn_breadcrumb(get_the_title(), $this->opt['attachment_prefix'], $this->opt['attachment_suffix']);

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$this->trail[] = new bcn_breadcrumb(get_the_title(), __($this->opt['attachment_prefix'], 'breadcrumb_navxt'), __($this->opt['attachment_suffix'], 'breadcrumb_navxt') );
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

			$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $parent->post_title),
				$this->opt['post_prefix'], $this->opt['post_suffix']));
			//Assign the anchor properties
			$breadcrumb->set_anchor($this->opt['post_anchor'], get_permalink($parent_id));

lalu timpa dengan kode berikut:

			$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $parent->post_title),
				__($this->opt['post_prefix'], 'breadcrumb_navxt'), __($this->opt['post_suffix'], 'breadcrumb_navxt') ));
			//Assign the anchor properties
 
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['post_anchor'], 'breadcrumb_navxt'), get_permalink($parent_id));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

			$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_author', $curauth->$author_display),
				$this->opt['author_prefix'], $this->opt['author_suffix']));
			if(is_paged() && $this->opt['paged_display'])
			{
				$breadcrumb->set_anchor($this->opt['author_anchor'], get_author_posts_url($curauth->ID));
			}

lalu timpa dengan kode berikut:

			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_author', $curauth->$author_display),
				__($this->opt['author_prefix'], 'breadcrumb_navxt'), __($this->opt['author_suffix'], 'breadcrumb_navxt') ));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
 
			if(is_paged() && $this->opt['paged_display'])
			{
				// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
				$breadcrumb->set_anchor(__($this->opt['author_anchor'], 'breadcrumb_navxt'), get_author_posts_url($curauth->ID));
				// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			}

Cari lagi kode yang ini:

		$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $parent->post_title), $this->opt['page_prefix'], 
			$this->opt['page_suffix']));
		//Assign the anchor properties
		$breadcrumb->set_anchor($this->opt['page_anchor'], get_permalink($id));

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language 
		$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $parent->post_title), __($this->opt['page_prefix'], 'breadcrumb_navxt'), 
			__($this->opt['page_suffix'], 'breadcrumb_navxt') ));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
 
		//Assign the anchor properties
 
		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb->set_anchor(__($this->opt['page_anchor'], 'breadcrumb_navxt'), get_permalink($id));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

		$this->trail[] = new bcn_breadcrumb(get_the_title(), $this->opt['page_prefix'], $this->opt['page_suffix']);

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$this->trail[] = new bcn_breadcrumb(get_the_title(), __($this->opt['page_prefix'], 'breadcrumb_navxt'), __($this->opt['page_suffix'], 'breadcrumb_navxt') );
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

				//This is a bit hackish, but it compiles the tag anchor and appends it to the current breadcrumb title
				$bcn_breadcrumb->title .= $this->opt[$taxonomy . '_prefix'] . str_replace('%title%', $term->name, str_replace('%link%', get_term_link($term, $taxonomy), $this->opt[$taxonomy . '_anchor'])) .
					$term->name . '</a>' . $this->opt[$taxonomy . '_suffix'];

lalu timpa dengan kode berikut:

				// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
				//This is a bit hackish, but it compiles the tag anchor and appends it to the current breadcrumb title
				$bcn_breadcrumb->title .= __($this->opt[$taxonomy . '_prefix'], 'breadcrumb_navxt') . str_replace('%title%', $term->name, str_replace('%link%', get_term_link($term, $taxonomy), __($this->opt[$taxonomy . '_anchor'], 'breadcrumb_navxt') )) .
					$term->name . '</a>' . __($this->opt[$taxonomy . '_suffix'], 'breadcrumb_navxt');
				// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, $this->opt[$taxonomy . '_prefix'], $this->opt[$taxonomy . '_suffix']));
		//Figure out the anchor for the term
		$breadcrumb->set_anchor($this->opt[$taxonomy . '_anchor'], get_term_link($term, $taxonomy));

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, __($this->opt[$taxonomy . '_prefix'], 'breadcrumb_navxt'), __($this->opt[$taxonomy . '_suffix'], 'breadcrumb_navxt') ));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
 
		//Figure out the anchor for the term
		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb->set_anchor(__($this->opt[$taxonomy . '_anchor'], 'breadcrumb_navxt'), get_term_link($term, $taxonomy));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language

Cari lagi kode yang ini:

		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, $this->opt[$term->taxonomy . '_prefix'] . $this->opt['archive_' . $term->taxonomy . '_prefix'],
			$this->opt['archive_' . $term->taxonomy . '_suffix'] . $this->opt[$term->taxonomy . '_suffix']));
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for current category
			$breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term, $term->taxonomy));
		}

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, __($this->opt[$term->taxonomy . '_prefix'], 'breadcrumb_navxt') . __($this->opt['archive_' . $term->taxonomy . '_prefix'], 'breadcrumb_navxt'),
			__($this->opt['archive_' . $term->taxonomy . '_suffix'], 'breadcrumb_navxt') . __($this->opt[$term->taxonomy . '_suffix'], 'breadcrumb_navxt')));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
 
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for current category
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt[$term->taxonomy . '_anchor'], 'breadcrumb_navxt'), get_term_link($term, $term->taxonomy));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		}

Cari lagi kode yang ini:

		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, $this->opt['archive_' . $term->taxonomy . '_prefix'] . $this->opt[$term->taxonomy . '_prefix'], 
			$this->opt[$term->taxonomy . '_suffix'] . $this->opt['archive_' . $term->taxonomy . '_suffix']));
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for current category
			$breadcrumb->set_anchor($this->opt[$term->taxonomy . '_anchor'], get_term_link($term, $term->taxonomy));
		}

lalu timpa dengan kode berikut:

		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb = $this->add(new bcn_breadcrumb($term->name, __($this->opt['archive_' . $term->taxonomy . '_prefix'], 'breadcrumb_navxt') . __($this->opt[$term->taxonomy . '_prefix'], 'breadcrumb_navxt'), 
			__($this->opt[$term->taxonomy . '_suffix'], 'breadcrumb_navxt') . __($this->opt['archive_' . $term->taxonomy . '_suffix'], 'breadcrumb_navxt') ));
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
 
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for current category
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt[$term->taxonomy . '_anchor'], 'breadcrumb_navxt'), get_term_link($term, $term->taxonomy));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		}

Cari lagi kode yang ini:

	function do_archive_by_date()
	{
		global $wp_query;
		//First deal with the day breadcrumb
		if(is_day() || is_single())
		{
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('d'), $this->opt['archive_date_prefix'], $this->opt['archive_date_suffix']));
			//If we're paged, let's link to the first page
			if(is_paged() && $this->opt['paged_display'] || is_single())
			{
				//Deal with the anchor
				$breadcrumb->set_anchor($this->opt['date_anchor'], get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')));
			}
		}
		//Now deal with the month breadcrumb
		if(is_month() || is_day() || is_single())
		{
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('F'), $this->opt['archive_date_prefix'], $this->opt['archive_date_suffix']));
			//If we're paged, or not in the archive by month let's link to the first archive by month page
			if(is_day() || is_single() || (is_month() && is_paged() && $this->opt['paged_display']))
			{
				//Deal with the anchor
				$breadcrumb->set_anchor($this->opt['date_anchor'], get_month_link(get_the_time('Y'), get_the_time('m')));
			}
		}
		//Place the year breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
		$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('Y'), $this->opt['archive_date_prefix'], $this->opt['archive_date_suffix']));
		//If we're paged, or not in the archive by year let's link to the first archive by year page
		if(is_day() || is_month() || is_single() || (is_paged() && $this->opt['paged_display']))
		{
			//Deal with the anchor
			$breadcrumb->set_anchor($this->opt['date_anchor'], get_year_link(get_the_time('Y')));
		}
	}

lalu timpa dengan kode berikut:

	function do_archive_by_date()
	{
		global $wp_query;
		//First deal with the day breadcrumb
		if(is_day() || is_single())
		{
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('d'), __($this->opt['archive_date_prefix'], 'breadcrumb_navxt'), __($this->opt['archive_date_suffix'], 'breadcrumb_navxt') ));
			//If we're paged, let's link to the first page
			if(is_paged() && $this->opt['paged_display'] || is_single())
			{
				//Deal with the anchor
				// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
				$breadcrumb->set_anchor(__($this->opt['date_anchor'], 'breadcrumb_navxt'), get_day_link(get_the_time('Y'), get_the_time('m'), get_the_time('d')));
				// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			}
		}
		//Now deal with the month breadcrumb
		if(is_month() || is_day() || is_single())
		{
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('F'), __($this->opt['archive_date_prefix'], 'breadcrumb_navxt'), __($this->opt['archive_date_suffix'], 'breadcrumb_navxt') ));
			//If we're paged, or not in the archive by month let's link to the first archive by month page
			if(is_day() || is_single() || (is_month() && is_paged() && $this->opt['paged_display']))
			{
				//Deal with the anchor
				// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
				$breadcrumb->set_anchor(__($this->opt['date_anchor'], 'breadcrumb_navxt'), get_month_link(get_the_time('Y'), get_the_time('m')));
				// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			}
		}
		//Place the year breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
		$breadcrumb = $this->add(new bcn_breadcrumb(get_the_time('Y'), __($this->opt['archive_date_prefix'], 'breadcrumb_navxt'), __($this->opt['archive_date_suffix'], 'breadcrumb_navxt') ));
		//If we're paged, or not in the archive by year let's link to the first archive by year page
		if(is_day() || is_month() || is_single() || (is_paged() && $this->opt['paged_display']))
		{
			//Deal with the anchor
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['date_anchor'], 'breadcrumb_navxt'), get_year_link(get_the_time('Y')));
			// End of modified by Masino Sinaga, April 24, 2010, in order to suppor multi-language
		}
	}

Cari lagi kode yang ini:

	function do_post()
	{
		global $post;
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb(get_the_title(), $this->opt['post_prefix'], $this->opt['post_suffix']);
		//Handle the post's taxonomy
		$this->post_taxonomy($post->ID);
	}

lalu timpa dengan kode berikut:

	function do_post()
	{
		global $post;
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb(get_the_title(), __($this->opt['post_prefix'], 'breadcrumb_navxt'), __($this->opt['post_suffix'], 'breadcrumb_navxt') );
		//Handle the post's taxonomy
		$this->post_taxonomy($post->ID);
	}

Cari lagi kode yang ini:

	function do_front_page()
	{
		global $post;
		//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
		$breadcrumb = $this->add(new bcn_breadcrumb($this->opt['home_title'], $this->opt['home_prefix'], $this->opt['home_suffix']));
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for home page
			$breadcrumb->set_anchor($this->opt['home_anchor'], get_option('home'));
		}
	}

lalu timpa dengan kode berikut:

	function do_front_page()
	{
		global $post;
		//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
 
		$breadcrumb = $this->add(new bcn_breadcrumb(__($this->opt['home_title'], 'breadcrumb_navxt'), __($this->opt['home_prefix'], 'breadcrumb_navxt'), __($this->opt['home_suffix'], 'breadcrumb_navxt') ));
		//If we're paged, let's link to the first page
		if(is_paged() && $this->opt['paged_display'])
		{
			//Figure out the anchor for home page
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['home_anchor'], 'breadcrumb_navxt'), get_option('home'));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		}
	}

Cari lagi kode yang ini:

	function do_home()
	{
		global $post;
		//We only need the "blog" portion on members of the blog, and only if we're in a static frontpage environment
		if($this->opt['blog_display'] && get_option('show_on_front') == 'page' && (is_single() || is_archive() || is_author() || is_home()))
		{
			//We'll have to check if this ID is valid, e.g. user has specified a posts page
			$posts_id = get_option('page_for_posts');
			$frontpage_id = get_option('page_on_front');
			if($posts_id != NULL)
			{
				//Get the blog page
				$bcn_post = get_post($posts_id);
				//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
				$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $bcn_post->post_title), $this->opt['page_prefix'],
					$this->opt['page_suffix']));
				//If we're not on the current item we need to setup the anchor
				if(!is_home() || (is_paged() && $this->opt['paged_display']))
				{
					//Deal with the anchor
					$breadcrumb->set_anchor($this->opt['blog_anchor'], get_permalink($bcn_post->ID));
				}
				//Done with the current item, now on to the parents
				//If there is a parent page let's find it
				if($bcn_post->post_parent && $bcn_post->ID != $bcn_post->post_parent && $frontpage_id != $bcn_post->post_parent)
				{
					$this->page_parents($bcn_post->post_parent, $frontpage_id);
				}
			}
		}
		//On everything else we need to link, but no current item (pre/suf)fixes
		if($this->opt['home_display'])
		{
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb($this->opt['home_title'], $this->opt['home_prefix'], $this->opt['home_suffix']));
			//Deal with the anchor
			$breadcrumb->set_anchor($this->opt['home_anchor'], get_option('home'));
		}
	}

lalu timpa dengan kode berikut:

	function do_home()
	{
		global $post;
 
		//We only need the "blog" portion on members of the blog, and only if we're in a static frontpage environment
		if($this->opt['blog_display'] && get_option('show_on_front') == 'page' && (is_single() || is_archive() || is_author() || is_home()))
		{
			//We'll have to check if this ID is valid, e.g. user has specified a posts page
			$posts_id = get_option('page_for_posts');
			$frontpage_id = get_option('page_on_front');
			if($posts_id != NULL)
			{
				//Get the blog page
				$bcn_post = get_post($posts_id);
				//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
				$breadcrumb = $this->add(new bcn_breadcrumb(apply_filters('the_title', $bcn_post->post_title), __($this->opt['page_prefix'], 'breadcrumb_navxt'),
					__($this->opt['page_suffix'], 'breadcrumb_navxt') ));
				//If we're not on the current item we need to setup the anchor
				if(!is_home() || (is_paged() && $this->opt['paged_display']))
				{
					//Deal with the anchor
					// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
					$breadcrumb->set_anchor(__($this->opt['blog_anchor'], 'breadcrumb_navxt'), get_permalink($bcn_post->ID));
					// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
				}
				//Done with the current item, now on to the parents
				//If there is a parent page let's find it
				if($bcn_post->post_parent && $bcn_post->ID != $bcn_post->post_parent && $frontpage_id != $bcn_post->post_parent)
				{
					$this->page_parents($bcn_post->post_parent, $frontpage_id);
				}
			}
		}
		//On everything else we need to link, but no current item (pre/suf)fixes
		if($this->opt['home_display'])
		{
 
			//Place the breadcrumb in the trail, uses the constructor to set the title, prefix, and suffix, get a pointer to it in return
			$breadcrumb = $this->add(new bcn_breadcrumb(__($this->opt['home_title'], 'breadcrumb_navxt'), __($this->opt['home_prefix'], 'breadcrumb_navxt'), __($this->opt['home_suffix'], 'breadcrumb_navxt') ));
			//Deal with the anchor
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['home_anchor'], 'breadcrumb_navxt'), get_option('home'));
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		}
	}

Cari lagi kode yang ini:

	function do_404()
	{
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb($this->opt['404_title'], $this->opt['404_prefix'], $this->opt['404_suffix']);
	}

lalu timpa dengan kode berikut:

	function do_404()
	{
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb($this->opt['404_title'], __($this->opt['404_prefix'], 'breadcrumb_navxt'), __($this->opt['404_suffix'], 'breadcrumb_navxt') );
	}

Cari lagi kode yang ini:

	function do_paged()
	{
		global $paged;
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb($paged, $this->opt['paged_prefix'], $this->opt['paged_suffix']);
	}

lalu timpa dengan kode berikut:

	function do_paged()
	{
		global $paged;
		//Place the breadcrumb in the trail, uses the bcn_breadcrumb constructor to set the title, prefix, and suffix
		$this->trail[] = new bcn_breadcrumb($paged, __($this->opt['paged_prefix'], 'breadcrumb_navxt'), __($this->opt['paged_suffix'], 'breadcrumb_navxt') );
	}

Cari lagi kode yang ini:

	function current_item($breadcrumb)
	{
		//Prepend the current item prefix
		$breadcrumb->prefix = $this->opt['current_item_prefix'] . $breadcrumb->prefix;
		//Append the current item suffix
		$breadcrumb->suffix .= $this->opt['current_item_suffix'];
		//Link the current item, if required
		if($this->opt['current_item_linked'])
		{
			$breadcrumb->set_anchor($this->opt['current_item_anchor'], '');
		}
	}

lalu timpa dengan kode berikut:

	function current_item($breadcrumb)
	{
		//Prepend the current item prefix
		// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		$breadcrumb->prefix = __($this->opt['current_item_prefix'] . $breadcrumb->prefix, 'breadcrumb_navxt');
		//Append the current item suffix
		$breadcrumb->suffix .= __($this->opt['current_item_suffix'], 'breadcrumb_navxt');
		// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		//Link the current item, if required
		if($this->opt['current_item_linked'])
		{
			// Begin of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
			$breadcrumb->set_anchor(__($this->opt['current_item_anchor'], 'breadcrumb_navxt'), '');
			// End of modified by Masino Sinaga, April 24, 2010, in order to support multi-language
		}
	}
  • Share/Bookmark
241 kali dibaca Cetak Artikel Ini Cetak Artikel Ini