Ready to get started?Download WordPress


[resolved] How to use native WordPress functions inside my own... (2 posts)

  1. scheda
    Posted 4 years ago #

    I'm trying to use "add_options" inside an install function.

    Here is my code...

    function installPlugin() {
    			add_option("shTitle", "Stick Header");

    From what I understand, the register_activation_hook function will run when the plugin is activated, meaning the installPlugin function should run then and create the option, if it doesn't already exist.

    However, it's not. Do you know why?


  2. scheda
    Posted 4 years ago #

    Nevermind... I got it :) I didn't have the object in an array for the call.

    Here's the working code now.

    register_activation_hook(__FILE__,array($fade, 'installPlugin'));

Topic Closed

This topic has been closed to new replies.

About this Topic