Genesis Post Class Patch
Recently, I was asked about a fix for the Genesis Post Class not saving. Here is a patch that will stop executing when Genesis upgrades to 1.9.0 which will re-write this section of the code.
This code does assume WordPress 3.4.x which uses wp_get_theme() instead of get_theme_data(). Please use accordingly in functions.php.
[Infographic] BloggingPro WordPress History
Bail Function for save_post Hook
I am often using (and see others using) a set of code, that I see constantly and almost everywhere. Usually on save_post, many people bail out of the function if it's doing auto-save or ajax or cron. So you see a lot of copy-paste in these functions.
[php]
/** Bail out if running an autosave, ajax or a cron */
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
return;
if ( defined( 'DOING_CRON' ) && DOING_CRON )
return;
[/php]
However, I turned this into a function:
Please let me know what you think!!
[Infographic] Ozh Making a WordPress Plugin
- « Previous Page
- 1
- …
- 14
- 15
- 16
- 17
- 18
- …
- 61
- Next Page »