Filter Orders in Admin area, based on Custom meta

Solved it, using pre_get_posts filter and WP_Query->set() method function foo_filter_orders($query) { global $pagenow; $qv = &$query->query_vars; $currentUserRoles = wp_get_current_user()->roles; if (in_array(‘shop_manager’, $currentUserRoles)) { if ( $pagenow == ‘edit.php’ && isset($qv[‘post_type’]) && $qv[‘post_type’] == ‘shop_order’ ) { $query->set(‘meta_key’, ‘handle_by’); $query->set(‘meta_value’, ‘shopmanager1’); } } return $query; } add_filter(‘pre_get_posts’, ‘foo_filter_orders’);

How wordpress detects a plugin update

Every 12+ Hours WordPress automatically goes out and checks if a plugin needs to be updated via the WordPress Repository. There’s 3 cron jobs that WordPress runs to check on things: wp_version_check – Checks for Core Updates wp_update_plugins – Check for Plugin Updates wp_update_themes – Checks for Theme Updates A neat little plugin to view … Read more

Override plugin localization

From what you are saying you have translated your plugin and now you want to be sure the future update won’ be overwritten. So to avoid that happening you can always put your po/mo translation files (if provided) in global languages folder that is located on your server in wp-content/languages/plugins folder. If plugin have language … Read more

Can’t set proper WooCommerce language translation [closed]

After installing WordPress version 4.6.1 and WooCommerce version 2.6.6, both with the default enabled language, English (United States), I followed the steps below and had the translation successfully installed and working: Set a language for your WordPress installation Click on the General sub-menu item under Settings from the Dashboard of your WordPress installation, and scroll … Read more

Create plugin with 3rd party MIT license code

yes, you can include Expat (MIT) licensed libraries in your GPL plugin. WordPress plugin guidelines states, Although any GPL-compatible license is acceptable, using the same license as WordPress — “GPLv2 or later” — is strongly recommended. All code, data, and images — anything stored in the plugin directory hosted on WordPress.org — must comply with … Read more

How can I mass-update/save all WordPress posts and pages?

Add to your functions.php file, but dont forget to take it off after use it !!!!! function update_all_posts() { $args = array( ‘post_type’ => ‘post’, ‘numberposts’ => -1 ); $all_posts = get_posts($args); foreach ($all_posts as $single_post){ $single_post->post_title = $single_post->post_title.”; wp_update_post( $single_post ); } } add_action( ‘wp_loaded’, ‘update_all_posts’ ); PS : BE SURE TO MAKE A … Read more

Sync my svn repositories

Maybe the svn switch — relocate repository option can help you here: svn switch –relocate oldURL newURL . ( http://svnbook.red-bean.com/en/1.1/re27.html ) But… a lot more options here: https://stackoverflow.com/questions/580443/svn-one-working-copy-two-repositories

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)