Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter markseymour

    (@markseymour)

    I hate triple-posting, but I cannot edit my posts past a certain time limit. Anyways, I have the admin page working, it was just a matter of swapping minuserlevel for administrator.

    Now all that I need help with it getting the string entered in the text box into a MySQL table, mes_google_analytics_uid, and a description on how to get the ID from the Google Analytics code. Which BTW I am not sure whether the prefix for all GA ID’s are UA-.

    Oh, and BTW, Thanks for helping me, I really appreciate it. ??

    Thread Starter markseymour

    (@markseymour)

    Okay, I have updated the code at https://wordpress.pastebin.ca/331176 ; The only thing that I can see that needs to be done is the Administration panel, and possibly a link in the Dashboard to Google Analytics login.

    I have the code in for the panel, but it doesn’t seem to appear.

    //Adding the Admin options page...
    function mes_google_analytics_options() {
    if (function_exists('add_options_page')) {
    add_options_page('Google Analytics', 'Google Analytics', minuserlevel, basename(__FILE__), 'mes_google_analytics_options_subpanel');
    }
    }

    Thread Starter markseymour

    (@markseymour)

    I am not entirely sure where I am supposed to place the hooks, I’ve looked at the code for a couple of plugins, and they are either at the top, the bottom, or interspersed in the code. Right now I have all of my hooks at the bottom:

    //Google Analytics Plugin hooks (bottom)
    //add_option('mes_google_analytics_uid');
    if ( isset( $_POST['uid'] ) ) { update_option('mes-google-analytics-uid',$_POST['uid']); }
    add_action('admin_menu', 'mes_google_analytics_options');
    add_action ('wp_footer', 'mes_google_analytics');

    Thread Starter markseymour

    (@markseymour)

    When I tested the plugin, I got an error within WordPress: Warning: call_user_func_array(): First argumented is expected to be a valid callback, 'mes_google_analytics_options' was given in /home/dreadhol/public_html/hidden/wordpress/wp-includes/plugin.php on line 123

    Would this have to do with function mes_google_analytics($unused)?

    The full code can be found at https://wordpress.pastebin.ca/331028
    note: I am still working on the admin contol panel.

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