• i get error call to undefined function get_option().

    My main plugin file code

    defined(‘ABSPATH’) or die( ‘Ah ah ah, you didn\’t say the magic word’ );
    require_once (‘assets/CallerService.php’);

    add_option(‘wop_testmode’);
    add_option(‘wop_app_user_name’);
    add_option(‘wop_app_password_id’);
    add_option(‘wop_app_signature_id’);
    add_option(‘wop_success_page_url’);
    add_option(‘wop_cancle_page_url’);

    CallerService.php

    define(‘API_USERNAME’, get_option(‘wop_app_user_name’));
    define(‘API_PASSWORD’, get_option(‘wop_app_password_id’));
    define(‘API_SIGNATURE’, get_option(‘wop_app_signature_id’));

  • The topic ‘how to get_option(‘myoption’) in plugin file’ is closed to new replies.