• I’m working on a plugin, a very simple one for a client and I’m trying to work on an edit function by passing the id around ?id=1234

    However I’m getting permission denied when clicking the link I’ve created.

    What do I need to do, to allow this?

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter alexolder

    (@alexolder)

    I have changed the URLs at the bottom to be more human friendly and less .php etc but this should cause any problems.

    Sorry for the delay… 🙂

    You should be forming your links like this..

    admin.php?page=bluefly-faq/edit&faq=11

    or

    admin.php?page=bluefly-faq/edit/&faq=11

    You can’t use a question mark because there’s already an existing query var in the URL, ?page=bluefly , all vars except the first must be preceded by a &

    Try this though..
    http://wordpress.pastebin.ca/1816262

    Should help you along a little… 😉

    Thread Starter alexolder

    (@alexolder)

    Yeah just a little,

    Thank you very much!

    I tried not to toy with it too much, i could see some areas were “in progress” so to speak…

    The point of moving the code into a class is that you avoid the need to do any..

    if( function_exists() )

    …checks around your functions..

    Ideally you should have just one around the class name..

    if( class_exists() )
     etc...

    Although neither is a requirement, it’s always a good idea to check a function or class does not exist before declaring one, functions inside a class are less likely to cause naming conflicts though, because they are part of the class, and not regular named functions.

    Additionally class functions can be marked as private, this means that particular function can only be called inside the scope of the class (ie. only another function in the class can call the function). Small things like this can be really handy if you want to write a function that can only used inside the context of the code you’re writing (ie. inside the class).

    If you get stuck on something else, post back, i don’t mind helping if you need suggestions or guidance.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Passing parameters around in Plugin’ is closed to new replies.