Defining the value of a variable before a function?

Wrong approach. $print_submenu_navigation will be filled in local scope when function is called with arguments, it’s not a matter of global variables. You want something like this when function is called (not defined): load_view( ‘name’, array(), current_user_can(‘administrator’) ) { Alternatively you can add your snippet inside the function, then input value for $print_submenu_navigation will overwritten … Read more

SQL error with custom query

Should be: $where .= ” AND voted > 1″; Other notes: instead of hardcoding table names you should use $wpdb->prefix . ‘post_votes’; instead of checking in global $_GET you should declare your filters as accepting two arguments and code functions accordingly, these filters pass as second argument object that contains all of query data. Like: … Read more

How to add coupon printer?

You might be probably looking for a plugin that offer’s groupon-like functionality (“Groupon 1.0 started on a WordPress blog.”). By googling I learned that there is a plugin called WP Coupon (WordPress Plugin) (review). No idea if it fits in what you need, but it looks like it does what you’re looking for. But it’s … Read more