digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Website and Server Troubleshooting (https://www.digitalfaq.com/forum/web-tech/)
-   -   WordPress editor gone after jQuery Colorbox plugin activated? (https://www.digitalfaq.com/forum/web-tech/4597-wordpress-editor-after.html)

kpmedia 09-25-2012 03:34 AM

WordPress editor gone after jQuery Colorbox plugin activated?
 
A longer explanation of Visual Editor errors is here: http://www.digitalfaq.com/forum/web-...al-editor.html
I wrote that last night, using this same jQuery Colorbox (JCB) problem as an example.

In plugins\jquery-colorbox\includes\jquery-colorbox-backend.php, the following code adds jQuery Colorbox to the editor:
Code:

    //add style selector dropdown to TinyMCE
    add_filter('mce_buttons_2', array(& $this, 'addStyleSelectorBox'), 100);
    //add Colorbox CSS class to TinyMCE dropdown box
    add_filter('mce_css', array(& $this, 'addColorboxLinkClass'), 100);

What often happens is that some other plugin or theme code (in functions.php) is trying to add one of the same piece of code to the editor as JCB is doing. You can then either choose to remove the code from the JCB plugin, or remove it from the other plugin/theme -- if you can find it. Sometimes it's just easier to comment out the code in JCB and see what happens.

Neither of these are overly important anyway, as best as I can tell.

On sites where I'm using this plugin, I have it set to automatically use Colorbox on any image in the post/page, where an image has been linked -- all of which is done in the styling/linking options of the media editor. So I've been entirely sure what benefit comes from having JCB code crammed into the Wordpress visual editor.

Hope that helps somebody. :2cents:

_______________


Need a good web host? — Read our 2018 Review of the Best Web Hosts
Quite often, problems with web sites are caused by having a rotten web host. Worse yet, many hosts try to blame you (the customer) for the problems! So dump that lousy company. Say goodbye to slow sites, unresponsive support techs, and downtime. Find yourself a new host today. Whether you need shared, reseller, VPS, semi-dedicated, cloud, or dedicated hosting, something on our list should be a good upgrade for you.


kpmedia 09-27-2012 04:36 AM

I just found another error thrown by jQuery Colorbox, when WordPress has debugging enabled:

Code:

Notice: Trying to get property of non-object in X:\...\wp-content\plugins\jquery-colorbox\includes\jquery-colorbox-frontend.php on line 106
On line 106 of includes\jquery-colorbox-front.php is an odd request syntax:
Code:

$replacement = '<img$1class=$2$3 colorbox-' . $post->ID . '$4$5>';
Replace with:
Code:

// $replacement = '<img$1class=$2$3 colorbox-' . $post->ID . '$4$5>';
  $replacement = '<img$1class=$2$3 colorbox-' . ($post && $post->ID) . '$4$5>';

... and the error goes away. :)


All times are GMT -5. The time now is 05:04 AM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.