The Loop

Where humor doesn’t work.
Apr 22, 2014 16:36
I guess I don't get the pain point with custom post meta data
Apr 22, 2014 16:35
suffer core?
Apr 22, 2014 16:35
*aren't
Apr 22, 2014 16:34
add_meta_box() and its subordinates isn't that difficult to crank out in one-off situations like that
Apr 22, 2014 16:34
@Rarst one or two custom meta data keys? Just write the callbacks to handle them explicitly.
Apr 22, 2014 16:32
@Rarst "some extra inputs for a couple CPTs" - I would normally consider that use case (the same one I usually encounter) to be one where a framework would be far too heavy.
Apr 22, 2014 16:28
What is the need for a "custom fields framework"?
Apr 22, 2014 16:13
@kaiser have it in good shape, but letting it sit for a bit while I think about how to proceed from where it is
Apr 22, 2014 15:08
Finally! A fun question to answer: wordpress.stackexchange.com/a/142057/3966
Apr 21, 2014 00:51
@kaiser the moderating itself isn't a bad thing. There's a useful question and solution buried in there that needs to be brought out.
Apr 21, 2014 00:47
@toscho of course not! Far be it from me to overwork poor little bunnies!
Apr 17, 2014 16:00
am I wrong? Would the callbacks I had yesterday not become methods if the whole thing were wrapped up in a class?
Apr 17, 2014 15:59
My next step is to convert the whole thing to a class. Did I waste my time eliminating the callbacks, that would have been turned into class methods (that I would now have to re-create)?
Apr 17, 2014 15:58
@toscho how are they different from class methods?
Apr 17, 2014 15:56
@toscho I had everything broken out into callbacks, and got raked over the coals yesterday for it
Apr 17, 2014 15:56
@toscho $breadcrumbs['base_link']
Apr 17, 2014 15:55
@toscho the order is intentionally the same as template-loader.php
Apr 17, 2014 15:51
If there's a way to reduce the amount of code, I'm all ears
Apr 17, 2014 15:50
I don't understand. How is testing a class method different from/better than testing a callback?
Apr 17, 2014 15:43
how does that help? Asked another way: how is that any different/better than the callback functions that you didn't like?
Apr 17, 2014 15:42
How would you break it down, then?
Apr 17, 2014 15:36
Okay @toscho is this a step in a better direction? Not a class yet, but the main function is better abstracted: gist.github.com/chipbennett/10013478
Apr 16, 2014 20:52
That's why I'm trying to find the balance
Apr 16, 2014 20:46
@G.M. and that level of flexibility would be debated for five years as a core patch
Apr 16, 2014 20:18
@G.M. I think that's WAY too complex for what I'm trying to get into core
Apr 16, 2014 20:15
Not getting fixed, because some Plugins might break :/
Apr 16, 2014 20:14
@boscho there's already a ticket/patch for the issue - 21 months old, of course: core.trac.wordpress.org/ticket/21213
Apr 16, 2014 20:05
I think I'll patch it up and submit it. Thanks!
Apr 16, 2014 20:01
Would it be this? $type = preg_replace( '|[^a-z0-9-_]+|', '', $type );
Apr 16, 2014 20:00
This is pretty explicit intent to have a front_page_template filter name: return get_query_template( 'front_page', $templates );
Apr 16, 2014 20:00
how would the regex be constructed to allow for the underscore that is intended to be passed?
Apr 16, 2014 19:59
@boscho so that's a bug then, right?
Apr 16, 2014 19:52
so what's going on?
Apr 16, 2014 19:52
I see no underscore there
Apr 16, 2014 19:52
$type = preg_replace( '|[^a-z0-9-]+|', '', $type );
Apr 16, 2014 19:52
get_query_template() does this to $type:
Apr 16, 2014 19:51
But add_filter( 'frontpage_template', $callback ) does work
Apr 16, 2014 19:51
But if you try add_filter( 'front_page_template', $callback ), it doesn't wok
Apr 16, 2014 19:50
return get_query_template( 'front_page', $templates );
Apr 16, 2014 19:50
Front page template passes front_page as $type
Apr 16, 2014 19:50
get_query_template() applies a filter: apply_filters( "{$type}_template", $template )
Apr 16, 2014 19:49
Apr 16, 2014 19:48
Yeah, I just see lots of complexity
Apr 16, 2014 19:25
I'll take a look at making it a class
Apr 16, 2014 19:20
let's get rid of paginate_links(), posts_nav_links(), etc.
Apr 16, 2014 19:19
@Rarst then why have any core template functions at all?
Apr 16, 2014 19:16
@Rarst because I have a vested interest in what mutually benefits Theme developers and end users
Apr 16, 2014 19:15
but core needs something
Apr 16, 2014 19:15
Heck, pull the Hybrid class into core for all I care
Apr 16, 2014 19:14
@Rarst "not theme-specific" is a key point: it's template-specific output that should have at least a basic core implementation.