How to properly rewrite url by custom var

I’ve been trying to rewrite a shop uri, and what I have now is this code: add_filter(‘rewrite_rules_array’,’wp_insertMyRewriteRules’); add_filter(‘query_vars’,’wp_insertMyRewriteQueryVars’); add_filter(‘wp_loaded’,’flushRules’); // Remember to flush_rules() when adding rules function flushRules(){ global $wp_rewrite; $wp_rewrite->flush_rules(); } // Adding a new rule function wp_insertMyRewriteRules($rules) { $newrules = array(); $newrules[‘shop/brand/(brand)/?$’] = ‘shop.php?brand=$matches[1]’ ; //$wp_rewrite->rules = $new_rules + $wp_rewrite->rules; return $newrules + … Read more

Do you clean up your self-written plugins’ at deactivation?

After developing some plugins for myself, some of them is ready to be published. For all, I’ve written deactivation functions, which deletes the set options, the database, etc. after themselves. But I’m having doubts about the reason for these, for example, what if it’s only a temporary inactivation? What do you think, does a process … Read more

Unix timestamp for post comment

Is there any function/code snippet to retrieve the unix time stamp of the comment on a post? The WordPress default function comment_time(); returns the time of the post in 12hr format (not helpful). 4 Answers 4 Use: global $comment; $timestamp = strtotime(“{$comment->comment_date_gmt} GMT”); Regards.