Solve Kindeditor picture upload path problem

Source: Internet
Author: User
Tags php file

I. Demand

Through the WordPress Kindeditor plugin with the image upload function to achieve with <a></a> tag links. That is, the Changed to <a href= "http://www.111cn.net/2015/03/ Test.jpg "></a>".

Ii. Adjustment

1. Change from relative URL to absolute URL


Change to

Enter the Wp-content/plugins/kindeditor-for-wordpress plug-in directory, modify the upload_json.php file to change the following two parts:

File Save directory path

$save _path = $php _path. '.. /.. /.. /uploads/';

Change to

$save _path = '/data1/img ';

File Save Directory URL

$save _url = $php _url. ' uploads/';

Change to

$save _url = ' http://img.91it.org/';

2, add link tag

Upload Add <a></a> quote tags,

Change to

<a href= "http://www.111cn.net/2015/03/test.jpg" ></a>

Modified: Wp-content/plugins/kindeditor-for-wordpress/kindeditor.js file, Insertimage:function (a,b,c,d,e,g) Section:

108 lines or so

' Change to
' <a href= ' + C (a) + ' ">a+= ' alt= "' +c (b) + '"; a+= "/>"
Change to
a+= ' alt= "' +c (b) + '"; a+= "/></a>"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.