SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 35
  1. #1
    SitePoint Member lilainoz's Avatar
    Join Date
    May 2010
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating Custom Options Pages in WordPress

    Notice: This is a discussion thread for comments about the SitePoint article, Creating Custom Options Pages in WordPress.
    __________

    Show us your new great power! How far can you take your Options page further?

  2. #2
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    This is a fantastic write-up and comes at a most convenient time!

    Off Topic:

    I rated the article but it doesn't show up. The ratings functionality seems out of order.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great article/tutorial.

    If you'd like to add your "sub-menu" to a section other than the "Settings" menu use the following:

    Code:
    add_dashboard_page(...) // Add sub-menu to Dashboard menu
    add_posts_page(...) // Add sub-menu to Posts menu
    add_media_page(...) // Add sub-menu to Media menu
    add_links_page(...) // Add sub-menu to Links menu
    add_pages_page(...) // Add sub-menu to Pages menu
    add_comments_page(...) // Add sub-menu to Comments menu
    add_theme_page(...) // Add sub-menu to Appearance menu
    add_plugins_page(...) // Add sub-menu to Plugins menu
    add_users_page(...) // Add sub-menu to Users menu
    add_management_page(...) // Add sub-menu to Tools menu
    For different icons, buttons, and other admin panel styles see: How to design and style your WordPress plugin admin panel (Onextrapixel.com)

  4. #4
    SitePoint Addict raydenx's Avatar
    Join Date
    Jun 2003
    Location
    Singapore
    Posts
    208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the wonderful info about adding to different sections of the WordPress admin.

    I've always wondered how to do that.

  5. #5
    SitePoint Member loveglory's Avatar
    Join Date
    Aug 2010
    Location
    Islamabad
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for cool information, but let me know is it free of cost.

  6. #6
    SitePoint Member
    Join Date
    Aug 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This topic is totally new to me. I find it so informative. Thanks for the post.

  7. #7
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jeffrey, thanks for the great article. It's well explained and laid out. I really appreciate the work you've done with books and articles.
    I've followed through to the point of "rendering the outputs" and am getting a php error "Call to undefined function add_settings_section()". I've looked through the code and tried changing several things with no luck. I copied the code exactly and still get the error. Any thoughts?
    I'm also wondering about the use of the $plugin_options variable in the validate_setting function. Is that correct to use that variable there?

  8. #8
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tsalagi View Post
    I've followed through ...
    I didn't "follow through" close enough. I missed adding statements to the register_build_options function. Onward and upward!

    Thanks again

  9. #9
    SitePoint Zealot
    Join Date
    Jul 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That
    was
    awesome

    Thanks so much.
    Patriotism is the virtue of the vicious.

  10. #10
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome postů Thanks for the share....

  11. #11
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its great to developed creative custom option and such a revealing information you share with us, We learn a lot from it and will be in touch with you for more add-ons. Wish you all the best.

    <snip />
    Last edited by SpacePhoenix; Sep 5, 2010 at 23:48. Reason: removed fake signature

  12. #12
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please add the source code link.

  13. #13
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with akshayaurora. There should be a link to download the code.
    I believe this is on topic. Just some related thoughts and questions for those following this thread. If you have built an options page using the Options API and then one using the Settings API, which do you think is better as far as efficiency and security? I have spent the last few days digging into the Settings APIi and it sure seems like a lot of work in contrast to the Options API. Maybe if one built a class to do all of this it would be lighter. Does anyone have any experience building a settings API class, or know of a tutorial on the subject? I'm not versed in OOP and maybe the code isn't fit for a class. What do you think?

  14. #14
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Jeffrey! I've been looking through TONS of pages to find something like this. On the video tutorial you mention downloading the source code, but I don't see a link for that. Will that still be available? Thanks!

  15. #15
    SitePoint Member
    Join Date
    Sep 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I am looking for how to have an options page change something that normally is configured in a css file. Is this possible, to change the css file on the fly?

  16. #16
    SitePoint Zealot
    Join Date
    Sep 2009
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by sgtranceman View Post
    Thanks. I am looking for how to have an options page change something that normally is configured in a css file. Is this possible, to change the css file on the fly?
    Do you want to change the style of only one element or switch the style of the site overall? If you want to change the overall style you can create several style sheets and use a select box to choose which style to use. This can be accomplished via PHP or Javascript. There are tons of tutorials out there Google away! If you want to change an element of your pages that can also be done via a form to post to a css value applied by php. Ditto: Google.

  17. #17
    SitePoint Member
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So... I'm the only person that can't get this to work, eh?
    I get the "Theme Options" in the Settings panel just fine, but all clicking that does is refresh my Dashboard...
    No need to post the code here, I don't think, as I am merely copying/pasting right from the article...
    This is a localhost installation that, otherwise, works just fine... Any thoughts/guesses?
    Thanks,
    Atg
    Aaron T. Grogg
    aarontgrogg.com/

  18. #18
    SitePoint Member
    Join Date
    Jul 2007
    Location
    New York, NY
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by aarontgrogg View Post
    So... I'm the only person that can't get this to work, eh?
    Issue was "__FILE__" when on a localhost...

    Argh...

    Atg
    Aaron T. Grogg
    aarontgrogg.com/

  19. #19
    SitePoint Member
    Join Date
    Jan 2009
    Location
    Lopez Island, WA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm also getting a "Fatal error: Call to undefined function add_settings_section()." I'm also trying to get this to work on localhost.

    Jeffrey, PLEASE post the finished admin-menu.php code as a download. The tutorial jumps around so much it's hard to see what code goes where.

  20. #20
    SitePoint Member
    Join Date
    Jan 2009
    Location
    Lopez Island, WA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't seem to edit my own post any more. :-( Anyway, I found the complete code for this tutorial (?) over at Github: http://github.com/JeffreyWay/WordPre...e-Options-Page

  21. #21
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In case someone can't get this to work on a local setup and need some practical advice, replace all instances of:

    PHP Code:
    __FILE__ 
    with:

    PHP Code:
    basename(__FILE__
    And you're good to go.

  22. #22
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where is the file I can download located that is mentioned in the video?

  23. #23
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kasiem View Post
    where is the file I can download located that is mentioned in the video?
    nevermind I found the link above... would be nice if it was on the article page though...

  24. #24
    SitePoint Member
    Join Date
    Jan 2008
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You, Thank You. This was GREAT!

  25. #25
    SitePoint Member
    Join Date
    Oct 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the example code.
    It cleared alot of things off and gave me a base to work off of.

    with the logo upload, I'm renaming the file to logo.jpg and then uploding it.
    however everytime I run the script the new file saved in the upload folder increments the file name.

    logo1.jpg
    logo2.jpg
    logo3.jpg... etc..

    I would like to simply overwrite the one file..
    So logo.jpg is overwritten every time a new upload on the settings page me made..

    Thanks again..
    hope to hear from you soon..



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •