[wordpress插件] Bit.ly Shortlinks Multisite (Uses OAuth 2 API)Bit.ly短链接多站点(使用OAuth 2 API)

wordpress 插件 文章 2020-03-05 18:00 473 0 全屏看文

AI助手支持GPT4.0

评分
74
描述

WordPress generates shortlinks for your posts and pages.

WordPress为您的帖子和页面生成短链接。

By default it uses the ?p= with the post ID added to it, but if you have a rather long domain name this isn’t very useful.

默认情况下,它使用?p = 并添加了帖子ID,但是如果您的域名很长,那么它就不是很有用。

If you use Bit.ly, this plugin will help you replace the shortlink WordPress generates with a proper Bit.ly shortlink.

如果您使用 Bit.ly ,此插件将帮助您将WordPress生成的短链接替换为适当的Bit.ly短链接。

p>

>

This plugin uses the latest Bit.ly OAuth 2 draft specification API instead of its deprecated V3 API and enables you to use generic access token to automatically enable Bit.ly shortlinks in your entire multisite network without the need for each site user to

此插件使用最新的Bit.ly OAuth 2草案规范API而不是其过时的V3 API,并允许您使用通用访问令牌在整个多站点网络中自动启用Bit.ly短链接,而无需每个站点用户

have to tinker with any settings or authentication configurations.

必须修改任何设置或身份验证配置。

安装步骤

    1. Upload the plugin folder to the /wp-content/plugins/ directory
    2. plugin 文件夹上载到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Insert this code to define your bit.ly generic access token in your wp-config.php at the end right above “That’s all, stop editing!

      在“代码” wp-config.php 中的“最后,停止编辑!”后面插入此代码,以定义您的bit.ly通用访问令牌。

      Happy blogging.”:

      祝您博客愉快。”:

      define(‘BITLY_ACCESS_TOKEN’, ‘your_generic_access_token_goes_here’);

      定义(“ BITLY_ACCESS_TOKEN”,“ your_generic_access_token_goes_here”);

    You can get your generic access token here: https://bitly.com/a/oauth_apps

    您可以在此处获取通用访问令牌: https://bitly.com/a/oauth_apps

    Multisite Installation

    多站点安装

    Install and set up your access token the same way as a single site installation but make sure you Network Activate the plugin.

    以与单个站点安装相同的方式安装和设置访问令牌,但请确保您通过网络激活插件。

    How To Call Bitly Shortlinks In Your Templates

    如何在模板中调用位短链接

    I’ve included the function get_bitly($url) to help developers easily shorten URLs in their templates.

    我已包含函数 get_bitly($ url),以帮助开发人员轻松缩短其模板中的URL。

    Example Usage:

    示例用法:

      <?php    

    $url = 'http://YourLongURL.com';    

    $ url ='http://YourLongURL.com';    

    echo get_bitly($url);

    回声get_bitly($ url);

    // display your shortened URL

    //显示缩短的网址

    ?>

    ?>

下载地址
https://downloads.wordpress.org/plugin/bitly-shortlinks-multisite.1.2.zip
-EOF-

AI助手支持GPT4.0