Replace Kata di WordPress? Buat Plugin aja..

17 Maret 10

Beberapa orang suka menuliskan url webnya diawal postingan. Hal ini bertujuan untuk meningkatkan visibilitas urlnya (mungkin ) dan dengan alasan kedua agar url nampak saat import blog ke facebook. Nah, dalam melakukan hal tersebut mungkin sebagian orang akan menulis urlnya secara manual di awal tiap posting atau menuliskannya dalam script tema blognya sebelelum the_content, namun 2 cara tersebut menpunyai kelemahan agak repot. Dan untuk mengatasinya kita bisa bikin pluginnya yang hanya membutuhkan waktu kurang dari 5 menit saja dan file hanya 1kB.
Dalam setiap plugin di wordpress mensyaratkan namanya agar bisa tampil di menu olah plugin kita, script metanya seperti ini:

1
2
3
4
5
6
7
8
9
10
11
12
<?php /*
 
**************************************************************************
 
Plugin Name:  Ganti Kata
Version:      1.0.0
Description:  Repalce a word to other word 
Author:       Rochsid Tehape
Author URI:   http://www.duritajam.web.id/
 
**************************************************************************/
?>

Script di atas hanya bagian Plugin Name aja yang wajib diisi. Dan ini penampakan di halaman plugin kita:
plugin-ganti-kata
Sedangkan untuk script fungsi replacenya adalah sebagai berikut:

1
2
3
4
5
6
7
<?php
function fungsiku($kata){
	$kata=str_replace('oci','duritajam.web.id',$kata);
	return $kata;
}
add_filter('the_content','fungsiku');
?>

Jadi setiap menulis kata duritajam.web.id akan direplace dengan kata duritajam.web.id. Kalau mau donlot pluginnya disini . Jangan lupa untuk mengganti bagian kata yang akan direplace.

11 responses to “Replace Kata di WordPress? Buat Plugin aja..”

  1. ibel.394 mengatakan:

    error mas..

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘daftar’ was given in C:\xampp\htdocs\PYA\wp-includes\plugin.php on line 166

    • rochsid tehape mengatakan:

      lho kok errornya di plugin.php? apa mas mengubah cmsnya wordpress?..

    • Freestyle Vest(13) mengatakan:

      “I’m not concerned there are a lot of unionist candidates,Michael Kors, I’m concerned that people go out and vote… and then we’ll be fine,Michael Kors Outlet,” he said.

    • 揗y concern is the constant work schedules these officers are involved with presently, then adding on special employment on their days off,”燗ngelo said last week.?It really isn抰 the break and time away from work that I think one needs in order to relax a little bit and get away from the workplace.敔

  2. Katherin mengatakan:

    Besides, it can be done by inserting thin needles
    that are usually special to every affected person and work community
    I love. When someone is not only relieves pain, headaches, neck pain and headaches all in your best before, if any mild symptoms develop.

  3. Thanks for a marvelous posting! I seriously enjoyed reading it, you
    are a great author. I will be sure to bookmark your blog and
    will often come back very soon. I want to encourage continue your great posts,
    have a nice afternoon!

  4. true cyber minds mengatakan:

    I like looking through a post that will make men and women think.
    Also, thank you for permitting me to comment!

  5. binary options demo mengatakan:

    Traders who use these instruments have to pay close attention to
    their particular person broker’s rules, particularly concerning payouts and dangers, how expiry prices are calculated and what occurs if the choice expires straight on the strike worth.

  6. Tiffani mengatakan:

    What a information of un-ambiguity and preserveness of
    precious experience concerning unexpected feelings.

  7. whale doormat mengatakan:

    It’s a shame you don’t have a donate button! I’d without a doubt donate to this fantastic
    blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
    I look forward to fresh updates and will share this site with
    my Facebook group. Talk soon!

  8. This article will help the internet visitors for
    setting up new webpage or even a blog from start to end.

Tinggalkan Balasan