Disable qTranslate by post type in admin + disable per page / post ID on front-end [closed]

Following snippet will disable it for post_type post (modify array below to affect other post_types): function qtrans_disable() { global $typenow, $pagenow; if (in_array($typenow, array(‘post’)) && // post_types where qTranslate should be disabled in_array($pagenow, array(‘post-new.php’, ‘post.php’))) { remove_action(‘admin_head’, ‘qtrans_adminHeader’); remove_filter(‘admin_footer’, ‘qtrans_modifyExcerpt’); remove_filter(‘the_editor’, ‘qtrans_modifyRichEditor’); } } add_action(‘current_screen’, ‘qtrans_disable’); Similarly you can disable it for specific post IDs. … Read more

“Donate to this plugin” for WordPress.org Plugin Authors

It is read from the infos on your plugins readme.txt. Example from my Default Values for Attachments === Plugin Name === Contributors: moraleida.me Donate link: http://moraleida.me/ Tags: attachments, default values, caption, title, description Requires at least: 2.5 Tested up to: 3.3.2 Stable tag: 0.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html

How to make sure a wp-cron job runs

Yes. No, because the scheduled job hasn’t reached the time yet. Yes, but not until 7:03pm. Basically, any hit to the site after the scheduled time will cause the queued job to run. The WP_Cron is a “best effort” system, not an exact timer. This is generally good enough though, since if nobody’s visiting the … Read more

Show a confirm message before plug-in activation

You can read more about the details of activation on this answer. Basically you need to hook a function to register_activation_hook() – assuming, that this is from within your main plugin folder and not a subfolder: register_activation_hook( __FILE__, ‘on_activation’ ); function wpse65190_on_activation() { // Add an admin notice: add_action( ‘admin_notices’, ‘wpse65190_on_activation_note’ ); // Then you … Read more

X-Pingback and XMLRPC

I think that when talking about XMLRPC in the context of wordpress you usually mean to talk about authoring tools utilizing the XMLRPC protocol, and not about the protocol in general. In case of pingbacks and trackbacks the XMLRPC protocol is utelized to send content (comment) to your site by some other entity which is … Read more

Woocommerce product categories order [closed]

Woocommerce stores ‘order’ metakeys in the table wp_woocommerce_termmeta. The mechanism it uses is the same as menu_order for posts. Something like this should work: $terms = get_terms(‘product_cat’); //sort $terms somehow $i = -1; foreach ($terms as $term) { $i++; update_woocommerce_term_meta( $term->id, ‘order’, $i); } The same procedure can be used to sort other Woocommerce taxonomies … Read more

How to run Two WordPress blogs with different themes and with single database and same content

I’ll try to explain how it might be done, but not sure it will work: Install 2nd website with single db (2 copies). Create new table in your db. Call it wp_options2 and copy everything from wp_options into the new table in second install in wp-config.php, before if ( !defined(‘ABSPATH’) ) add define( ‘M7_OPTIONS_TABLE’, ‘wp_options2’ … Read more