174 reputation
18
bio website stevendesu.com
location Kentucky
age 23
visits member for 2 years, 8 months
seen Aug 4 '11 at 23:31

I like to code. That's about it. I prefer web-based application. PHP, MySQL, HTML, CSS, javascript... I can also code in Perl for shell automation and C++ when I need something to run fast. I'm learning ASM. I'm a junior in Computer Engineering, minoring in Japanese and considering a double major in Electrical Engineering. Math and algorithms come easily for me. Art and graphics do not.

I'm also a certified Mac Genius. Summer jobs. Whee. I don't own a Macintosh, but I can tear them apart, rebuild them, and fix just about any problem with them.


Jul
30
comment What are the advantages to the Settings API?
I certainly hope it's improved. I honestly see no advantages to the Settings API, but rather every advantage I'm enjoying now is the result of the framework that I borrowed for it. I like that all form elements are now dynamically generated with the same appearance... but that isn't Settings API. I like that default settings and registering settings are handled by the same definitions... but that isn't Settings API. I like that jQuery not only makes the forms pretty, but is progressively enhanced - but I had to manually code the progressive enhancement...
Jul
30
comment What are the advantages to the Settings API?
I finally got my Settings page working with help from this tutorial: alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1 and with the help of the switch statements and helper functions I must say that things are now more orderly in my code (which is nice since I plan on moving from my two test settings to 15-20 total settings).
Jul
29
comment What are the advantages to the Settings API?
Are you aware that the source code you pointed to implements the functions oenology_get_settings_by_tab() and oenology_get_default_options without ever first defining them? I thought it was bad enough at 209 lines of code (after removing comments and blank lines), but once those functions are defined it'll be even longer... For four options?
Jul
29
comment What are the advantages to the Settings API?
So it essentially forces security and aesthetic standards that I was already following without its help? I will read through the tutorial you linked, though. If it makes the Settings API as easy as manually coding the forms (or easier) then I'll accept this answer
Jul
29
comment $GLOBALS array for wordpress
I think it should also be noted that if you declare ANY variable in the global scope it is automatically added to the $GLOBALS array without ever typing $GLOBALS[, so a grep search wouldn't possibly return every global variable in WordPress.
Jul
29
comment Broken wordpress permalinks on pages only
I actually was recently making changes to a PremiumPress theme and had a similar issue. Randomly getting a 404 when you edited a post, page, or anything. I found that my issue was an infinite add_action() loop. Look for anywhere that you called add_action() or add_filter() and make sure the callback function doesn't run any core WordPress functions which would call the same hook or filter.
Jul
29
comment WordPress and Security
I have a good example of a crappy host (although I realize this is VERY late). A client of mine had a website running on LiquidWeb. I'm not sure what their security vulnerability was (they obviously can't divulge that information), however his website was crawling with links and ads that he didn't put there. It was only a few minutes to restore an old database backup, however, and get things working again.
Jul
29
comment add_action with a class method is causing fatal errors
Issue with the Walker actually had nothing to do with this issue (although this issue was still causing bugs here and there, and you did answer the question very well). I solved the walker issue and included the answer in my original question.
Jul
29
comment add_action with a class method is causing fatal errors
Now test.php is functioning properly, but the Walker class is still messed up... I'm going to edit my original question to include my simplified plugin class.
Jul
29
comment add_action with a class method is causing fatal errors
Actually, I just figured it out. Instead of public static function MyClass(){ it should be just function MyClass(){. That's actually probably what problem was all along. I kept using public static function instead of public function.
Jul
29
comment add_action with a class method is causing fatal errors
This gave me a new error: Fatal error: Constructor MyClass::MyClass() cannot be static in /home/coupon/public_html/wp-content/plugins/test.php on line 11
Jul
28
comment How do I access the menus produced by Dashboard > Appearance > Menus
I actually just realized (with the help of a response to stackoverflow.com/questions/6862887/…) that I can use wp_nav_menu_args to pass my own custom walker class. For the recommendation to look at available filters, I'm accepting this answer as it does answer the original question. Although I recently have a problem with my Walker class, I can make a new question for this...
Jul
28
comment How do I access the menus produced by Dashboard > Appearance > Menus
Problem is (mentioned in the previous question) I wanted to make this plugin with the assumption that I had no power to edit the theme (since it will be used on multiple different themes and the client may likely change themes at some point in time). My solution so far was to copy/paste the code from nav-menu-template.php except for this line: $items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args );. I can change this line to implement my own walker. However this means wp_nav_menu() is essentially run twice, with the first output discarded. Kind of wasteful.
Jul
28
comment How do I access the menus produced by Dashboard > Appearance > Menus
For options I was going by WordPress's own documentation: codex.wordpress.org/Writing_a_Plugin Although I don't have any options yet. At the moment I'm making this a very simple plugin that will support one use case, then I'll expand it and add options as necessary. Although I have been reading through core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/… to find the best method of accessing menu items. Since I want to edit the menu output and not the item list I think I may have to re-generate the item list (silly, I know)...
Jul
28
comment Replacing WordPress menu functionality with a plugin
Ah. I didn't have a menu defined. That actually resolved the entire issue. I can't believe I spent the entire morning looking up walker classes and how to override WordPress functions when I had it right from the start. Thank you.
Jul
28
comment Replacing WordPress menu functionality with a plugin
The only plugin on the entire site is my custom plugin.
Jul
28
comment Replacing WordPress menu functionality with a plugin
I saw the wp_nav_menu filter in some (but not all) lists of WordPress filters when I was trying to solve this myself, however I tried the following code: add_filter('wp_nav_menu', 'my_menu_func'); function my_menu_func(){print "Testing 123";} and it never displayed Testing 123. Am I doing something wrong? I don't work with WordPress much