« first day (1407 days earlier)      last day (3533 days later) » 

6:56 AM
@G.M. shouldn't that be in_array( $type, ....? on another note you could just as well use array_search to map to a hash table and just return the key of the found result as the callback method. @toscho I don't get what you mean by hard to track used vs unused methods, can you give some context as to what you mean by that?
 
7:20 AM
@userabuser sure you're right about in_array( $type, ... regarding array_search I know that function, but I can't understand how it can improve my snippet. Regarding what @toscho says, I guessed is related to code analysis tools
Only who uses/cares about code analysis uses words like "cyclomatic complexity"
 
8:01 AM
@userabuser Code analysis, and I want to be able to click on a function when it is called. I cannot do that when it is just a string in a list of callbacks.
One option would be to drop that method altogether and to make the called methods public. Instead of a simple integer, I could require a custom type for site id.
 
So my guess was right. @toscho I think that making inner methods public is the only alternative that responds to all your requirements
@Rarst I created an issue on fragment cache. Though about to first ask here, but github issues are there for a purpose, so...
 
hmm, if I do that, I can drop the constants altogether.
 
and it's a problem?
 
no
the only problem is the site_id preparation
I don’t want to repeat the preparation call in four methods, so I need a new class for the type
 
Seems you don't like wet code
 
8:13 AM
wet?
 
not DRY
 
ah. of course not
 
1
Q: How to display this '𪇆' in the post of wordpress?

kenmuxas mentioned, i just use the latest version of wordpress (v3.9.2,Taiwan Chinese Traditional), and found it could not display this Chinese word:'𪇆', but other chinese words could be displayed normally. i just use this word on a post, and found all the contents after it all lost (became blank, th...

It seems the word means "shrew"
 
8:50 AM
I could put the site id into the constructor, and then create two instances when I have to copy tables.
 
So you prepare the id before to create the instance of the class?
 
yes. hmm, in fact, I probably have to check the id anyway before I even know that I need a table name
bonus: the methods are easier to test
 
When code is split in littler pieces the tests are always easier
 
goes refactoring the freshly refactored code
 
9:16 AM
I hate it when users flag their own question, demanding a solution. I need help asap!
 
10:10 AM
@toscho aargh!
 
10:53 AM
-1
Q: What do Plugins do in general

Kasiviswanathan SelvakumarI have a small PHP application that need additional support of style.css and myapp.js. I wish to use this application in WordPress generated web pages, post, etc. If I'm not wrong, The solution is to create a plugin and provide a Shortcode [my-plugin] for wp users. My question is do plugins are...

Crappy question gets crappy answers.
ohh
0
Q: What do Plugins do in general

Kasiviswanathan SelvakumarI have a small PHP application that need additional support of style.css and myapp.js. I wish to use this application in WordPress generated web pages, post, etc. If I'm not wrong, The solution is to create a plugin and provide a Shortcode [my-plugin] for wp users. My question is do plugins are...

 
11:12 AM
:)
 
 
7 hours later…
6:08 PM
Hey guys. Anybody in here?
Needing some help with WP_List_table
 
 
5 hours later…
11:34 PM
What’s wrong with that code?
  /**
   * Constructor.
   *
   * This constructor does everything needed for the administration panel.
   *
   * @param no parameter is provided.
   */
  function __construct() {
 
11:59 PM
Hello
Anyone online?
 

« first day (1407 days earlier)      last day (3533 days later) »