WordPress.org

Ready to get started?Download WordPress

Forums

WordPress-Amazon-Associate
[resolved] FancyBox (2 posts)

  1. Workshopshed
    Member
    Posted 1 year ago #

    The plugin seems to have disappeared from the repositry, is it still supported?

    I've just found an incompatibility with WPBackup. The WPAA plugin is loading it's version of the jancybox javascript library on all admin pages rather than just the WPAA admin pages.

    http://wordpress.org/extend/plugins/wordpress-amazon-associate/

  2. Workshopshed
    Member
    Posted 1 year ago #

    I've fixed this issue in WPAA.php

    A couple of changes:

    in function __construct

    //add_action('admin_print_scripts', array(&$this, 'doPageScripts'));
    add_action('admin_enqueue_scripts',array(&$this, 'doPageScripts') );

    and in doPageScripts, I've used the hook suffix to check directly rather than parsing the parameters and also only install the thickbox and fancybox on the new page and new post as that should be the only places we might want to activate WPAA from, rather than activating on all admin pages. Also spotted an issue with the way that the plugin folder was being referenced.

    function doPageScripts($hook_suffix) {
            if ($hook_suffix == $this->config_hook) {
                wp_enqueue_script('postbox');
                wp_enqueue_script('dashboard');
                wp_enqueue_script('thickbox');
                wp_enqueue_script('media-upload');
            } else if( is_admin() && ($hook_suffix =='post-new.php' or $hook_suffix == 'page-new.php')) {
                wp_enqueue_script('thickbox');
                wp_enqueue_script('fancybox', plugins_url( '/js/fancybox/jquery.fancybox-1.3.4.js' , __FILE__ ));
            }
        }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.