WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. aschne
    Member
    Posted 2 years ago #

    Hi,

    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!

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 2 years ago #

    @aschne,

    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;
    $mysubscribe2->user_menu();
  3. aschne
    Member
    Posted 2 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;
    $mysubscribe2->user_menu();

  4. debsch
    Member
    Posted 2 years ago #

    Thank you for the code!

    global $mysubscribe2;
    $mysubscribe2->user_menu();

    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

About this Topic

Tags