Categories
jQuery

Get Content from CkEditor Using JQuery

In a recent project I used the CkEditor to add a WYSIWYG editor to the private control panel. It was easy to add the editor to the page, but I struggled to get content from CkEditor using jQuery.

Normally I would use the following code to get content on submit. But that does not work when using CkEditor .

var myContent = jQuery('#my_content').val();

The above code works as long as it is a textarea. Once you add the CkEditor class to the textarea the textarea is replaced with a rich text editor.

#my_content

is the id of the textarea field on the form. For example

< textarea id="my_content" class="ckeditor" >

Now to get the content on submit you have to use the following

var myContent = CKEDITOR.instances.my_content.getData()
Categories
Hosting

Migrate Email From One Host To Another Host

When migrating to a new host it is important to consider how email will be handled and do old emails need to be preserved. Most WordPress backup solutions will not backup email related data. That means to completely migrate to a new server you have to manually move your email. In this short tutorial I will explain how to manually migrate email from one cPanel hosting account to another cPanel hosting account.

    • Log into the old cpanel account

Compress Etc

    • Compress (tar) the etc directory located at /home/user/etc

Compress Mail

    • Compress (tar) the mail directory located at /home/user/mail

Download

    • Download the .tar files
    • Log into the new cpanel account
    • Create the email accounts under the new hosting account.
      Note: The password you set when creating the new email accounts are unimportant. They will be overwritten when you unzip the tar files.

Extract

  • Upload the .tar files to the correct directory and extract the files.
  • Send a test email or two to make sure everything works.