Title: Method not found
Last modified: August 31, 2016

---

# Method not found

 *  Resolved [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/)
 * Experimenting with your example code for adding an element, I get “Fatal error:
   Call to undefined method Torro_Elements_Manager::register()” called by torro()-
   >elements()->register( ‘My_Element’ );
 * It doesn’t seem that the Torro_Elements_Manager class has or inherits a register()
   method.
 * I noticed the base elements use torro()->element_types()->register(), so I replaced
   elements with element_types and it seemed to work.
 * Maybe something’s changed since you did the documentation, or am I missing something?
 * [https://wordpress.org/plugins/torro-forms/](https://wordpress.org/plugins/torro-forms/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438809)
 * Hello Max,
 * can you please show your code or add a link to your code?
 * Which version you are using?
 * Greetings,
 * Sven
 *  Thread Starter [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438841)
 * Version 1.0.0-beta.3
 * I straight copied and pasted the “Example” code from [http://torro-forms.com/api/extending/elements/](http://torro-forms.com/api/extending/elements/)
   into the root of a plugin. Then I wrapped it in the “How to add your code” function(
   function your_torro_functionality(){}).
 * As I said, it adds the new element just fine when I change it to call the register()
   method from the Torro_Element_Types_Manager class (torro()->element_types()->
   register( ‘My_Element’ );) rather than the Torro_Elements_Manager class (torro()-
   >elements()->register( ‘My_Element’ );) as in the example code.
 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438935)
 * You are totally right! I will check this and give you feedback!
 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438939)
 * Hey Max,
 * Can you please download the latest Version of Torro Forms and checkout our latest
   API changes here:
 * [http://torro-forms.com/api/extending/elements/](http://torro-forms.com/api/extending/elements/)
 * Torro Forms develop version:
 * [https://github.com/awsmug/torro-forms/tree/develop](https://github.com/awsmug/torro-forms/tree/develop)
 * I’m sorry for that issue I have missed to test the examples. But now I did it.
   😉
 * Greetings,
 * Sven
 *  Thread Starter [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438957)
 * The example code works fine now.
 * I might suggest adding a “if( function_exists( torro_load ) )” to the “How to
   add your code” example. If Torro Forms gets deactivated while your custom elements
   plugin is still active you get a fatal error. Ask me how I know.
 * Cheers
 *  Thread Starter [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438967)
 * Looks like you might have to edit the “Register an element” section of [http://torro-forms.com/api/using-torro/torro-elements/](http://torro-forms.com/api/using-torro/torro-elements/)
 * It’s calling that same method: torro()->elements()->register( ‘Element_Class_Name’);
 *  Thread Starter [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7438996)
 * Found another issue with the example code: on viewing the form on the front end,
   I got three errors –
    Warning: Missing argument 1 for Torro_Element_Type::get_input_id()
   Warning: Missing argument 1 for Torro_Element_Type::get_input_id() Warning: Missing
   argument 1 for Torro_Element_Type::get_input_name()
 * The errors correspond to the lines in the example code inside the get_input_html()
   function where $this->get_input_id() is called twice and $this->get_input_name()
   is called once.
 * I noticed that in your core elements, you are passing an $element argument to
   each of those functions, as in $this->get_input_id( $element ), but not in the
   example code. You’re passing in that $element argument when you call the get_input_html(
   $element ) function.
 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/method-not-found/#post-7439028)
 * Thank you! I will take a look! 🙂
 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/method-not-found/#post-7439112)
 * I am very sorry, but as I find out, we have made breaking changes at this place.
   We have changed the way a bit, elements are beeing created because we invented
   the elements Templates that everybody can change the form elements layout for
   their purposes.
 * We did not have finished the docs yet, but we are on it at the moment. I will
   let you know if the docs also have changed or if you want to know more before,
   take a look at our elements code in the Torro Forms beta 4.
 *  Plugin Author [Sven Wagener](https://wordpress.org/support/users/mahype/)
 * (@mahype)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/method-not-found/#post-7439126)
 * Hello Max,
 * we have rewritten the docs for the elements. Here You will find how to add elements
   now:
 * [http://torro-forms.com/api/extending/elements/](http://torro-forms.com/api/extending/elements/)
 * I’m sorry for breaking changes. But we hope you like the changes. 🙂
 * Greetings,
 * Sven
 *  Thread Starter [max_Q](https://wordpress.org/support/users/max_q/)
 * (@max_q)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/method-not-found/#post-7439129)
 * Thanks. Look forward to experimenting.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Method not found’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/torro-forms_a76868.svg)
 * [Torro Forms](https://wordpress.org/plugins/torro-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/torro-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/torro-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/torro-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/torro-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/torro-forms/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [max_Q](https://wordpress.org/support/users/max_q/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/method-not-found/#post-7439129)
 * Status: resolved