Call to s2class::user_menu() terminates prematurely (4 posts)

  1. aschne
    Posted 4 years ago #


    I wanted to move the settings-page from the wp-admin area to a separate page (because users on my site should not be allowed to access wp-admin).

    I found in another thread that you suggested to call s2class::user_menu() within a page.

    I tried that but the execution terminates because this error occurs:

    Call to undefined method WPShortcodeExecPHP::get_usermeta_keyname() in /wp-content/plugins/subscribe2/subscribe2.php on line 2548

    I have added a shortcode within the plugin "WP Shortcode Exec PHP" which just calls "s2class:user_menu()".

    Do I need to import other php-files? How to resolve this?

    It would be great if Subscribe2 would have such a shortcode that the form for changing user settings could be included anywhere!


  2. mattyrob
    Posted 4 years ago #


    You need to be able to access the entire class rather than just the one function.

    Try making the class a global and then calling the user_menu(), something like this perhaps:

    global $mysubscribe2;
  3. aschne
    Posted 4 years ago #

    Thanks for the quick feedback.

    Instead of using a global var I instantiated the class again and now it seems to work (but still mangles my layout, need to look into this later).

    I now call it like this:

    $mysubscribe2 = new s2class;

  4. debsch
    Posted 4 years ago #

    Thank you for the code!

    global $mysubscribe2;

    I have been looking so long for this to move the notification settings back end options to the front end.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Subscribe2
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic