Take the 2-minute tour ×
WordPress Development Stack Exchange 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

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, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the 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
add comment

Browse other questions tagged or ask your own question.