Last active
December 21, 2015 03:59
-
-
Save mhulse/6245870 to your computer and use it in GitHub Desktop.
How can I improve my functions organization (inspired to ask this question from reading http://justintadlock.com/archives/2010/12/30/wordpress-theme-function-files)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists('foo_setup')) { | |
function foo_setup() { | |
add_theme_support(...); | |
add_theme_support(...); | |
} | |
} | |
add_action('after_setup_theme', 'foo_setup'); | |
remove_action(...); | |
remove_action(...); | |
remove_action(...); | |
function foo1_xxxx() { ... } | |
add_action(..., 'foo1_xxxx'); | |
function foo2_xxxx() { ... } | |
add_action(..., 'foo2_xxxx'); | |
function foo3_xxxx() { ... } | |
add_action(..., 'foo3_xxxx'); | |
function foo4_xxxx() { ... } | |
add_action(..., 'foo4_xxxx'); | |
function baz1_xxx() { ... } | |
add_filter(..., 'baz1_xxx'); | |
function baz2_xxx() { ... } | |
add_filter(..., 'baz2_xxx'); | |
function baz3_xxx() { ... } | |
add_filter(..., 'baz3_xxx'); | |
function baz4_xxx() { ... } | |
remove_all_filters(...); | |
remove_all_filters(...); | |
add_filter(..., 'baz4_xxx'); | |
function baz5_xxx() { ... } | |
add_filter(..., 'baz5_xxx'); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
function foo_shortcode() { ... } | |
add_shortcode(..., 'foo_shortcode'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! function_exists('foo_setup')) { | |
function foo_setup() { | |
add_theme_support(...); | |
add_theme_support(...); | |
remove_action(...); | |
remove_action(...); | |
remove_action(...); | |
add_action(..., 'foo1_xxxx'); | |
add_action(..., 'foo2_xxxx'); | |
add_action(..., 'foo3_xxxx'); | |
add_action(..., 'foo4_xxxx'); | |
add_filter(..., 'baz1_xxx'); | |
add_filter(..., 'baz2_xxx'); | |
add_filter(..., 'baz3_xxx'); | |
remove_all_filters(...); | |
remove_all_filters(...); | |
add_filter(..., 'baz4_xxx'); | |
add_filter(..., 'baz5_xxx'); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_image_size(...); | |
add_shortcode(..., 'foo_shortcode'); | |
} | |
} | |
add_action('after_setup_theme', 'foo_setup'); | |
function foo1_xxxx() { ... } | |
function foo2_xxxx() { ... } | |
function foo3_xxxx() { ... } | |
function foo4_xxxx() { ... } | |
function baz1_xxx() { ... } | |
function baz2_xxx() { ... } | |
function baz3_xxx() { ... } | |
function baz4_xxx() { ... } | |
function baz5_xxx() { ... } | |
function foo_shortcode() { ... } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussion here.