« first day (948 days earlier)      last day (3992 days later) » 

12:16 AM
Sorry I'm not sure how to implement this. — user32576 18 mins ago
Wants to override functionality from a parent theme widget. Has no clue of PHP... caveman theory doesn't work.
 
12:55 AM
@bosco You should create a global .gitignore file for that. So you don't need one for every repo
@kaiser :) I actually had one of my PRs accepted ... I think it was to add the capital P to the WordPress.gitignore
 
 
6 hours later…
7:08 AM
Except that there are no plugins to do this, so it’s not a plugin recommendation question. — Synetech 2 hours ago
:)
 
7:24 AM
Secrets Revealed: WLTC and WPTavern - http://www.wptavern.com/secrets-revealed-wltc-and-wptavern
 
8:12 AM
hey @Rarst. is add_action( "show_admin_bar", "__return_true" ); add_filter( "tts_can_switch_themes", "__return_true" ); supposed to be enough to let un-logged-in user switch themes
 
@lkraav is that question or statement? :)
 
well, question. wp-admin/admin-ajax.php?action=tts_set_theme&theme=Bikini admin-ajax request just shows 0
i think it's hitting a stumbling block somewhere in the chain
hmmmm, wait i remember needing two action handlers for admin-ajax - one for priv one for unpriv
boom. fixed add_action( 'wp_ajax_nopriv_tts_set_theme', array( CLASS, 'set_theme' ) );
i guess it should go to my "TTS Unprivileged plugin"
or... how do you feel about upstreaming the unprivileged operation
not even sure how to address your class from another plugin..
 
look through support forum, one of users has this ironed out
you don't need to subclass to add hooks, just use actuall class name in place of __CLASS__ macro
 
lol. exact solution in the first thread.
sigh.
 
I will probably add this to be easily flipped on with code some time. wanted to provide interface but too much trouble with Settings API and stuff :)
 
8:53 AM
We should really stop calling the Settings stuff an API.
How about Settings burden.
 
some day I want to make a list of things which people only learn halfway from snipetts so they have a reference for other half :) __CLASS__ qualifies :)
 
right. i like your way of instanciating a lot better than $somerandomname = new MyClass() at the end of plugin
 
I don't... "static" classes are essentially fake namespace, which 5.2 doesn't have
if need real object instance still need to properly create it and WP doesn't have good place for it to go... thus global or perversions with singletons
I need to try writing plugin with namespaced functions some time
 
9:17 AM
@kaiser it's still an API, a terrible one, but an API nonetheless
speaking of which, what would it look like in WPR?
 
different
 
so we're settled, a complete clone with an identical interface
 
@kaiser Burden_API, functions to slow ya ass down...
 
9:59 AM
where does one report bugs on wordpress.org homepage to?
 
Hm. I must be doing something wrong... Need to merge two arrays. If the first one is empty, I don't need all the different merge logic in between. Now I got two options: Wrap it in a if ( ! empty( $array_one ) ) or do a goto... never thought I would be in the case where I would find a valid use case for goto. Feels wrong.
 
Use count( $array_one )
 
@kaiser there is no valid use for a goto
as punishment for your infraction I sentence you to go read Donald Knuth for the next hour
 
Nvm. Worked around it already.
Just realized that WP_Roles::is_role() actually doesn't question if the role exists, but if it has a display_name set... facepalm for this naming.
 
10:11 AM
the other option is a merge function that returns early if the array is empty
 
Yeah, I needed different joins for capabilities: A) "Full" join (all caps from both arrays), B) "Inner" join (intersect), C) "Outer" join (diff) and D)efault (only new ones).
 
@kaiser You can also do if ( $array === array() )
 
@kaiser misuse shortcode_atts()
 
@toscho interesting idea! but it's role capabilities, so numerical array.
I do the following:
Full = `array_unique( array_merge() )`
Inner = `array_intersect()`
Outer = `array_diff()`
Default = $result = new_caps
 
11:07 AM
Am I right that there's no API method or function that lets me assign additional capabilities to post types or taxonomies aside from assigning them during registration? In other words: No official way of adding custom capabilities to built in post types/taxonomies?
 
add_post_type_support?
 
@userabuser Are we finally forking WP then :)
 
@StephenHarris Forking it with a Knife my friend...
...sorry Kaiser I think that I misunderstood you.
 
@userabuser With a spoon, it'll hurt more
 
Noted, I'll also use a cheese grater for good measure.
 
11:14 AM
@kaiser Thought caps were assigned to user? Or do you mean as adding additional meta caps, like 'edit_post'?
 
↑ adding additional capabilities for the post type outside of register_post_type
 
@StephenHarris I mean the seven additional primitive capabilities.
So you set map_meta_caps to TRUE, then assign a custom string for capability_type to then get those + custom names for the default primitive capabilities then get mapped to the default capabilities by core (but are not used by it).
 
looking at core there is no way to do this it seems.. unless you can do something with the map_meta_cap (capabilities.php line #992) filter?
 
I am going to steal that for tag line: Grease - WordPress Spoon
 
@userabuser Damn it. Haven't thought of that one. But not sure if there's a convenient way of checking what happens there.
 
11:23 AM
@kaiser Looking at the function, it looks complicated... but that seems the only filter available to even get close... hmm
_post_type_meta_capabilities in post.php line 1460 is a private function Stores or returns a list of post type meta caps for map_meta_cap(). so.. yeah not much available to us
 
pffft... what a fucking mess. already forgot how much of a mess this is.
Seems like capabilities change on the fly depending on the post status. This will be fun with register_post_status() and custom post status.
@StephenHarris yes, caps are assigned to users. and they're assigned to roles as well. not sure why this needs to be this way. or if this needs to be this way at all.
 
@kaiser What's your use case?
 
I'm trying to build a basic role manager. More details?
 
Hmm.. Maybe I'd like to help with this for my member plugin?
 
@kaiser Ok, so for example an end user might what to allow users to be able to edit post type X if they have capability Y? And you want to change Y from 'edit_X' to any capability they choose?
 
11:34 AM
Yes, along those lines.
But so far there's no UI. Just a base class that dictates the factory what to do.
 
@kaiser Ok, so map_meta_cap would be it I think. You can replace any capability (primitive or meta) with the new caps chosen. Meta caps at least will have the post ID passed to them via $args from which you can get post type etc.
 
@StephenHarris Well, for a role manager I won't be able to use map_meta_cap() as this "thing" considers different states and screens, while I'd need to have all of them available.
Freaking User and Role management is fucking crap...
 
@kaiser :/. Guessing you can't use get_current_screen()?
 
nope
 
@kaiser Too early?
 
11:46 AM
Problem is that any sort of UI would need to have them available on a separate screen somewhere, somehow. But I wouldn't be able to retrieve them together at some page.
 
11:59 AM
@kaiser Why don't you just inspect the capabilities of the post type and add them to the user?
 
You know: WP sucks in a lot of corners. Roles & Capabilities is such corner. After hours of reading through core, I'm still not sure if it's enough to assign a capability to a role or if I have to assign it to a user as well. When you look at the predefined roles and a basic new user, the user got the role name plus the capabilities.
Stuff is spread between WP_Roles, WP_Role and WP_User and what not else...
 
12:36 PM
@kaiser You assign capabilities to roles, but only primitive capabilities, not meta capabilities... (its confusing)
 
I know. But how about default ones? I mean core adds both the caps + the roles to a user.
 
for the plugin we wrote, we didnt add the capabilities until the filter was added, so they were checked and assigned at runtime, the roles system just wasnt flexible enough
 
1:12 PM
@kaiser yeah it does, but edit_post, read_post, and delete_post are not supposed to be added to a user role, instead, you add to a role such caps as edit_posts, edit_others_posts, delete_posts etc...
 
@TomJNowell urgh... really? which filter?
 
If you look at capabilities for a user you will notice how meta capabilities are not mapped to the user capabilties
...just primitive capabilities are.
 
@kaiser when you check if a user can do something, it runs it through a filter
 
@userabuser yeah, found that out later on and dropped the whole thing.
 
which I dont remember, but it's there
you can either say yes by adding a capability
or you can say yes at runtime via the filter
 
1:15 PM
ok. another layer of obscurity. :P thanks, Tom
 
Still leaves me damn confused either way.
 
Whom not?
 
that's another thing we need in WPR, obscurity
 
1:41 PM
3.6 stops excluding deprecated and strict errors in debug... this will be fun :) not that people use debug
 
2:40 PM
i do
 
The Class that handles the Session for EasyDigitalDownloads is named ... wait for it! ... `WP_Session`
just confuses the hell out of my colleague who's new to WP. great.
final class WP_Session extends Recursive_ArrayAccess implements Iterator, Countable
hehe
 
you can probably thank Eric for that
 
For the name, the extend or the implement?
 
for the class overall
 
oh my... and it doesn't even work in the default, plain vanilla multisite install of my colleague. COO00oookies not saved.
public function session_started() {
	return !!self::$instance;
}
@setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN, false );
Where || are the ... separators.
@Rarst Do you have some source to where Eric might have started this? Just to get behind his concept.
 
Thanks!
 
 
1 hour later…
3:55 PM
hmmm the composer sublime package is all messed up
I think it assumes composer.phar is in the current directory and balks if it isnt
which means if there's no composer.json and I'd like to validate it, I'm buggered
 
@kaiser You there?
 
@userabuser jes
 
just curious, you know on Rilwis Metabox, in some input types he has call to static function add_actions(), is it just me or is he adding multiple actions even if you call a file input 10 times? I'm just asking about efficiency here... (bit tired) thought you might know
actually nevermind, not making much sense now :)
 
@userabuser sorry, haven't done anything on or with it since ages. Currently looking into Pods again. Has some problems as well, but the architecture seems to be more robust, the thing over all more capable and has a better UI
 
Never played with Pods... always glossed over it. Thanks anyway, I was just inspecting his architecture amongst other APIs in comparison to mine. Finally had enough of using multiple classes for meta, options, standard forms...
 
4:12 PM
@Rarst if I setup a private composer repository, how would I handle authentication/access? Can I shove it behind SSH?
 
@userabuser Only possible way I personally see is a Form Field class that can be extended (or better "dependency injected").
 
koolaid flows or what... (wptavern purchase)
 
@userabuser Just to make sure that there's something in common between every possible field type. Starting at input/text fields until Google Maps autocomplete fields.
 
@Rarst hmm I didn't spot that >_< currently adding composer.json to every internal plugin I can
 
4:21 PM
@Rarst generous. and criticism fades away.
 
@TomJNowell composer all the things :) seriously, we need tshirts with that or something
@kaiser generous what?
 
@Rarst generous MM. buying people out. stating that there will be no ads. stating that it was just because they did that much for the community.
 
I don't think it's evil plan, but I think pretense of impartiality to person who pays you at the end of the month is bullshit.
 
Didn't say it's evil plan. It's investment in Matts credibility.
 
btw I quit wptavern long before buy-out when Jeffro said he will cover things in line with "community" (dot org party line) without muddling them with pesky things like objectivity and personal take
 
4:28 PM
@kaiser My Form API is a standalone form field builder of which extends a parent class that handles the additional WP logic and form definitions (metabox, option panels, standard). DI is something I am thinking but need to get mechanics in place first.
 
@Rarst until the recent buy out, I thought it's graphical clone of wp-hackers and therefore never looked :D
@userabuser would separate it much more. one class for meta boxes, one for options, etc. central controller. as much as I was a fan of extending stuff, I'm now after I've seen how much more flexible the DI scheme is.
 
@kaiser Agree this is route I am going, logic for metabox is in one class and for options in another, just need to decouple further. Will send to you when done for you to review, maybe can provide some design input.
...I need to inject the FormAPI
 
I dropped every single attempt I have done so far (which probably have been around 10).
 
@kaiser it was more active when I just started to use WP (2008) but really struggled later
 
That's why I started with Form API first, its standalone drop-in for any PHP project...
Problem with all existing classes now is that they are tightly coupled with WP API... this approach does not make sense.
 
4:35 PM
Latest fields I had to do were for Widgets. I simply copy/pasted everything from one Widget to another. Fed up by trying again and again and again. Just too many cases, too many different things.
Your overall problem will be that you'll need scripts for classes -> WP Dependency. You'll need different MarkUp Wrappers -> WP Admin styles and politics. The list is just fucking endless.
 
What cases are the problem though?
 
That you need to shuffle MarkUp a lot.
 
...that bad? (hadn't got that far yet)
 
Yes
Tables. Tables with two columns - one for label, other for field. Table with both in a single td. No tables. Descriptions jump around. Block separators, block descriptions. No labels, etc. etc.
@userabuser I even started to use DOMElement and similar stuff to become more flexible. But nothing's flexible enough when every fucking single admin page is hand coded MarkUp...
 
Considered DOMElement for building form markup, but not bothered with that now... But I was just going to use Zurb Foundation CSS framework form control styling in admin. Surely not a problem
 
4:41 PM
Dare to use a custom styling on top...
That makes it just worse.
 
Well then I'll just do Label -> Field -> Desc (stacked)
solved...
 
It's already hard enough to get the MarkUp up and running as there're several field classes that only apply properly if you got the needed wrappers. So div#wtf surrounds div#wrapper to make input[type=number].small work.
And you'll want to stick with it as MP6 is ~4-5 month away from being brought into core.
 
yeah I wonder about that, what kind of effect it will have
 
Wait is MP6 actually slated to be merged into the core?
Nvm. Found relevant articles.
 
Hi everyone! Got a question that I cannot ask on WPSE, since it's highly subjective: has anyone ever used a PSD-to-WordPress-theme service? codeinwp.com, psdtowp.com, pixelpress.co are among the top search results. Any experiences to share? I'm thinking about it at the moment: just looks so cheap and time-saving. :)
 
4:54 PM
@dalbaeb any task can be completed: cheap, fast, properly. choose two.
2
 
@Rarst so you're saying those services are usually low quality? I wouldn't mind polishing their work, as long as the overall dev time is shorter.
 
the logic is saying that :) if they are cheap and fast, they can't be high quality
out of folks I know I think bluelimemedia.com specializes in PSD to WP. you can inquire for a quote and see how it compares.
 
@Rarst Thank you! Looks like it may not be the most smooth experience, yet I'm tempted to try just to have an idea and have a point of reference.
 
5:26 PM
WordPress Answers works best with JavaScript enabled – no shit?
 
 
2 hours later…
7:15 PM
ahaha do_accordion_sections( $screen, $context, $object )
 
@toscho ...do we want to know?
 
It is almost a duplicate of do_metaboxes()
 
7:59 PM
Tom Butler – some interesting PHP articles here. And a really nice domain name.
 
8:52 PM
worst thing about being a mod? being unable to use ignored tags because you might need to see the stuff to deal with it in mod capacity :(((
 
tags are useless on our site anyway
 
ah, wait! it just de-emphasizes now, not hides! ignore all the woocommerces!
 
@Rarst Can I do that...?
oh yup, seen it
wow, WPSE looks a lot less active now...
 
9:10 PM
all questions have been answered time to close the site
 
@userabuser @kaiser Beyond simple function wrappers for displaying an actual form element ( input / textarea / select / radio ), a form API for the admin is pointless. No consistency. As kaiser said each page is finely hand-crafted by the author to give it a unique quality - poetry, right? ;)
 
I can't find a single one to answer indeed :\
 
time to learn woocommerce^
 
time to learn Symfony :P
 
9:29 PM
@StephenHarris poetry only if you can make this a rhyme
EasyDigitalDownloads. single-download.php does not fall back to single.php... WTFs all along the way.
 
9:48 PM
Before I tempt to ask the Lords of the Repository anyone care to chime in with an opinion... Can you include Creative Commons 3.0 BY-SA images in WordPress repository plug-in
 
10:03 PM
As far as I know the GPL does not cover "creative" work , so you can do what you want license wise
Though the GPL is encouraged
From the codex... Even though graphics and CSS aren’t required to be GPL legally, the lack thereof is pretty limiting.
 
@Wyck link?
 
@Wyck What's legal and what WP says it will allow are completely different things :). Repo rules say not to CC, but its not clear if that just refers to code....
 
@StephenHarris Very true, but I think CC is compatible?
gnu.org/licenses/license-list.html#GPLCompatibleLicenses CC0 is compatable, but I'm not even sure what that is
"CC0 is a public domain dedication from Creative Commons."
"Both public domain works and the lax license provided by CC0 are compatible with the GNU GPL."
 
@Wyck CC BY-SA requires credits to copyright holder. I think that goes against GPL
 
10:13 PM
but is CC part of CC0 , I do not know
 
@EAMann To be honest, the WP_Session class is one of the most obscure constructs I've ever seen.
 
@Wyck CC is actually many different licenses, I think CC0 is the only GPL-compatible one. All the others add additional clauses:
<-- so no it seems
 
@StephenHarris Ya seems so
but will they nitpick that, not sure
 
@Wyck wait, still might be. Eurgh. Point is legally it is fine. GPL and CC don't mix as far as images are concerned. But I can't say the images are GPL (apart from the fact that doesn't make sense). And thats what repo want. Meh.
Ironically by being so staunchly GPL they're being more restrictive... yay for protecting my freedoms!
 
CC BY-SA is incompatible with the GNU GPL is says on Gnu site, so I guess that's the stance
 
10:17 PM
Actually to call it 'staunchly GPL' is misleading... staunchly meta-GPL :)
 
That's pretty limiting and I don't see how BY-SA or any others would harm it, shrug
most artists want some sort of attribution, jeez
Sort of shows you the limitation of GPL being a software framework and not working too great for "themes"
 
What exactly is their line of logic here?
> Can you imagine WordPress without any CSS or javascript? So as before, we will only promote and host things on WordPress.org that are 100% GPL or compatible.
 
Well it can be argued that CSS and JS are not derivatives of core code
 
1. Yes, it should work without CSS & js. But lets suppose it doesn't work at all ... what's that do with a plug-in's CSS or js?
 
in the case of css/js it's usually wether the project has any css/js of its own that's GPL'ed
in this case the js libraries in the WP JS APIs
or whatever it is you're talking about
 
10:28 PM
@Wyck I'd agree. I'd go as far to say that even php is cod is not necessarily derivative....
 
You can have non GPL CSS/JS and still comply with the GPL, but they don't want that
 
@TomJNowell Gone a bit off topic :). Sidetracked by reasoning on codex....
 
I understand it from a code perspective including CSS/JS, images and graphics less so
Most photographers/graphic artists don't even want to use CC let alone GPL
 

« first day (948 days earlier)      last day (3992 days later) »