Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I remove the class from the following code and use it without the functions. I tried removing the functions and class and add it in functions.php but it did not work.

class someclass {

    function __construct() {    
        add_action('init', array(&$this, 'action_admin_init'));        
        add_action('admin_enqueue_scripts', array(&$this, 'action_admin_scripts_init'));      
    }

    function action_admin_scripts_init() {
        wp_localize_script( 'jquery', 'myscript', array('folder' => SCRIPT_URL) );
    }

    function action_admin_init() {
        add_filter( 'some_filter', array(&$this, 'register_some_filter') );
    }

}
share|improve this question
1  
Do you want to use the class without functions or the functions without the class? And why? What problem do you want to solve? – toscho Jul 26 '12 at 3:53

closed as not a real question by kaiser, toscho Oct 4 '12 at 0:12

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

Browse other questions tagged or ask your own question.