• I’m creating a plugin to modify another plugin, but when I activate it, it doesn’t work. I checked the code and saw that the scripts I call are commented out. Is there a reason why the scripts are being commented out? The main plugin code is below:

    <?php
    /*
    Plugin Name: Divi Staff Extras
    Plugin URI: https://just-us.agency/
    Description: An update to Divi staff to override the tabs at the top of the team page
    Version: 1.0
    Author: Charlie Evans
    Author URI: https://just-us.agency
    License: GPL
    */
    if ( ! defined( 'ABSPATH' ) ) exit;
    function dropdown_enqueue() {
      wp_register_script( 'staff_dropdown',  plugin_dir_url(__FILE__) . 'dropdown.js', array( 'jquery' ), TRUE);
    	wp_register_script( 'switcheroo', plugin_dir_url(__FILE__) . 'switcheroo.js', array( 'jquery'), TRUE);
        wp_enqueue_script( 'jquery' );
    	wp_enqueue_script( 'staff_dropdown' );
    	wp_enqueue_script( 'switcheroo' );
    }
    
    add_action( 'init', 'dropdown_enqueue' );
    

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    What’s the other plugin? That’s where you should ask if you are trying to modify that other plugin’s output.

    Thread Starter charliejustus

    (@charliejustus)

    I did ask them, they said it would cost serious money to make the changes I’m trying to implement. Hence the reason why I’m doing this myself.

    I’m not asking about how the plugins interact, I’m just wondering if there is a standard plugin procedure that I’m not following, that would allow the scripts to be called. Why are they being commented out automatically in the head? Does WordPress need certain things to be in place for it to work?

    If I can get some help getting this code to work, then I can carry on with creating the plugin myself.

    Thread Starter charliejustus

    (@charliejustus)

    Also, if you had read the code description I wrote, you would know the name of the plugin I am trying to modify.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I did ask them, they said it would cost serious money to make the changes I’m trying to implement. Hence the reason why I’m doing this myself.

    I did read the code, I was hoping that I was wrong. No one here has access to that commercial code (nor do we want access) so we can’t tell you what it is doing to interfere with your add_action.

    For pro or commercial product support please contact the author directly on their site. This includes any pre-sales topics as well.

    As the author is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘My plugin isn’t working’ is closed to new replies.