• Resolved David Gard

    (@duck_boy)


    Hey all,

    I’m getting some strangeness with WP plugins and wondering if someone can help? Basically, I have written a couple for a website and when I test these on my local machine they work fine.

    Now that I have put these plugins on a dev site that is on line I am being told that the functions I call through the site do not exist, yet when I’m in the backend the plugins are working fine. Below is have I have declared my external files and called the various functions, perhaps someone could take a look and make sure i have not messed anything up?

    Thanks.

    require_once('functions.php');
    require_once('functions-meta.php');
    require_once('pages/office-details.php');
    require_once('pages/add-office.php');
    require_once('pages/functions-library.php');
    require_once('user-functions/user-functions.php');
    require_once('user-functions/functions-help.php');
    add_action('admin_init', 'register_office_details');
    add_action('admin_menu', 'office_detials_menu');
    add_action('admin_head', 'office_details_header');
Viewing 1 replies (of 1 total)
  • Thread Starter David Gard

    (@duck_boy)

    Ah, I think I found the problem, and it is a combination of a very random one and a silly mistake by me –

    Apparently the FTP client I am using is changing the ‘Line ending’ setting on my files from ‘Widows (CRLF)’ to ‘Simple (LF)’, and after correcting on the files that are causing me problems it is now fine.

    In addition to that, I was only requiring the files if a user could ‘manage_options’, which of course any logged in user could not do, meaning the functions were never defined.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin functions not working on front end but fine on back end’ is closed to new replies.