Home > IT > Wordpress Plugin: Custom URL Shorter

Wordpress Plugin: Custom URL Shorter

分享家:Addthis中国

本人写的第一个Wordpress的插件——Custom URL Shorter诞生了

  • 起因:最近突然一些原因要在自己的风云阁添加短地址链接,因此就萌生了写这个插件的想法。今天在工作的休息时间写了这个插件的第一个版本。
  • 版本号:0.3.4。
  • 功能:
    • 可以在多个短地址服务中选取自己喜欢的服务进行使用,也可以选择列表中没有的服务
    • 可以对链接文字进行设置
    • 可以发布日志或者页面的时候通过
      [cus]

      来实现短域名链接生成

    • 可以通过直接修改模板添加
      <?php custom_url_shorter(); ?>

      来实现短地址链接的生成

  • 安装与使用
    • 下载Custom URL shorter
    • 上传Custom URL shorter文件夹到你的插件目录下。
    • 在WordPress后台插件菜单下激活Custom URL shorter。
    • 转到Setting => Custom URL shorter,进行设置。
    • 创建 WordPress 页面模板,在该模板中加入下面函数:
      <?php custom_url_shorter(); ?>

      或者创建新日志或者页面时,在内容中添加

      [cus]
  • 备注
    • 本插件现在刚开始,有任何问题等,请与我联系。
    • 目前插件正在向Wordpress.org提交中,提交完成后,下载链接将转至Wordpress.org的空间。
      已提交Wordpress
    • 插件中提及到的adf.ly调用API是需要注册的,插件中使用的是本人的帐号所对用的API地址。如用户觉得不便的话,可以自行去注册后,在插件设置界面的自定义区,输入你的API地址来进行使用
    • 下载:Custom URL shorter
    • Changlog
      = 0.3.3 =
      * Confirmed compatibility with 3.0.1
      Thanks to Den(denicocc@gmail.com)
You don't feel like leaving comments? Please leave your palm-print.
懒得留言?那留下您的掌印吧。
Categories: IT Tags: , , , , ,
  1. gpt
    January 29th, 2010 at 14:57 | #1

    Hi, how i can Create a page template with function custom_url_shorter()?

    Sorry i dont know how, you can helpme, please?

  2. January 29th, 2010 at 15:38 | #2

    You can add the function called “custom_url_shorter” into the .php files of your wordpress template.

    < ?php custom_url_shorter(); ?>
  3. gpt
    January 30th, 2010 at 16:49 | #3

    Hi and with this i redirecting to adf.ly?

  4. January 30th, 2010 at 21:12 | #4

    @gpt
    Ya! This plugin can create adf.ly short links of your posts.

  5. January 30th, 2010 at 21:16 | #5

    @gpt
    Click the “Skip ad” on the top-right corner!

  6. September 15th, 2010 at 04:38 | #6

    i get this when trying to access wp-admin/options-general.php?page=CustomURLShorter

    You do not have sufficient permissions to access this page.

    can you help me.?

  7. September 15th, 2010 at 10:42 | #7

    @QByte
    Try “wp-admin/options-general.php?page=Custom%20URL%20Shorter”

  8. anonim
    September 18th, 2010 at 14:52 | #8

    @Iron_Feet
    what is this file ?

  9. September 18th, 2010 at 18:41 | #9

    @anonim
    The files of your wordpress template.

  10. October 2nd, 2010 at 10:50 | #10

    I tried adding in index.php and singlepost.php of my template near the top of each file, but links aren’t changing.

    Also added my own adf.ly api in the other url shortner spot, and didn’t work either.

    Not sure how to get it working.

  11. October 2nd, 2010 at 12:43 | #11

    @Breck
    This plugin will not change the link of your pages.
    It just generate a short URL of your pages.

  12. October 10th, 2010 at 21:07 | #12

    Hi, I got WP error trying to access the plugin setting page-’You do not have sufficient permissions to access this page’.

  13. October 10th, 2010 at 21:24 | #13

    @Den
    Hey there, sorry for my question regarding the page error. I got it solved just after I posted it. I edited your plugin to make it work for WP 3.01.

  14. October 10th, 2010 at 22:51 | #14

    @Den
    Oh~ Can you send me the patch file to show me the modification?

    I hope I can commit it and add your name into acknowledgement list.

    Thanks~

  15. October 10th, 2010 at 23:25 | #15

    sure thing…after WP 3.0 the slug parameter is being changed from spaces to dashes. Wordpress get_plugin_page_hookname will remove all spaces on your slug parameter instead of leaving it.

    so the parameter at line 161:

    function cus_admin_actions()
    {
    add_options_page(“Custom URL Shorter”, “Custom URL Shorter”, 1, “Custom URL Shorter”, “cus_control”;
    }

    changed to

    function cus_admin_actions()
    {
    add_options_page(“Custom-URL-Shorter”, “Custom URL Shorter”, 1, “Custom-URL-Shorter”, “cus_control”;
    }

  16. October 10th, 2010 at 23:33 | #16

    @Den
    Thank you very much~

  17. x
    November 12th, 2010 at 07:10 | #17

    so when will you be releasing 3.0.1 version. i need it.

  18. November 12th, 2010 at 09:36 | #18

    @x
    This weekend~

  1. No trackbacks yet.

:D 8) :down: 8O :!: :halo: :evil: :heart: :kiss: :lol: :money: :mrgreen: :x :| :pirate: :?: :oops: :roll: :P :( :) :o :up: :vangry: :twisted: ;) :? :cry:

也许您会觉得ReCAPTCHA验证码很繁琐,会认为他和其他所有的验证码一样让你厌烦。那请点击这里,您会了解到ReCAPTCHA为人类文化的传承做出了多大的贡献。请您也为人类知识的保存和传递也出一份力吧,谢谢!
 
    Posts Nav.