Google Analytics post views in WordPress? [closed]

Please check out the WordPress Post Analytics Plugin that we (WisdmLabs) have created. http://wordpress.org/extend/plugins/wordpress-post-analytics/ This is available on the WordPress plugin repository as a free download. We link your Google Analytics account to the plugin and pull data from the Analytics backend to showcase stats right inside any post. You have a choice of using … Read more

How to restrict Front-End Editor on a page?

From the GitHub-Wiki The ‘front_end_editor_disable’-filter Use this filter if you want to completely disable the plugin for certain URLs. Callback arguments: bool $disable: The current state. Default: false You can use conditional tags: Conditionals tags return bool true/false, which means, if you want to disable it on a page, simply use is_page(), as it returns … Read more

jQuery plugin only in one page/post

If you only want to use the library “jquery.typist” on one page you could just add it by the conditional is_page() but if you want to use it on more than one page you should just minifyi all your js-files into a single one and compress it and cache it. It is better to use … Read more

How to solve a conflict between a plugin and a theme?

If the theme was coded using Theme Development Standards, then you can use the function wp_deregister_script to remove conflicting scripts from the page where the slider is being used. [update] The original solution (at the bottom) worked in a specific plugin situation (with WP Touch). I think this is the proper one: add_action( ‘wp_enqueue_scripts’, ‘wpse_77772_remove_theme_enqueues’, … Read more

Extending WC_Cart in woocommerce

Extending WooCommerce cart class is a bit tricky, but possible. Lets assume you have a plugin and a file class-my-wc-cart.php with extended cart class inside. Then in the main plugin file you need to do following: // load your My_WC_Cart class require_once ‘class-my-wc-cart.php’; // setup woocommerce to use your cart class add_action( ‘woocommerce_init’, ‘wpse8170_woocommerce_init’ ); … Read more

Creating button next to “add media” that allows you to choose a single post

For WP versions before 3.5.0, use the media_buttons_context filter: add_filter( ‘media_buttons_context’, function($context ) { global $pagenow; if ( in_array( $pagenow, array( ‘post.php’, ‘page.php’, ‘post-new.php’, ‘post-edit.php’ ) ) ) { $context .= ‘<a href=”#” class=”button”>Button</a>’; } return $context; } ); For 3.5.0+, use the media_buttons action: add_action( ‘media_buttons’, function($editor_id){ echo ‘<a href=”#” class=”button”>Button</a>’; } ); Both … Read more

Editor access to plugin settings

Unfortunately, the plugin author did not leave room for a filter. But I did request one for you here. I suggested changing: /* Add option page */ function cd_setting_page(){ add_options_page( ‘Commenter data Settings’, ‘Commenter data Settings’, ‘administrator’, ‘commenterdata-settings’, array( $this, ‘cd_renderer’ )); } to /* Add option page */ function cd_setting_page(){ $cap = apply_filters( ‘commenter_data_settings_page_capability_filter’, … Read more

Prevent multisite sites from using a plugin

Multisite is setup to do this by default. If you simply install the plugin without ‘network activating’ it, you are able to limit the use to any single site in the network. To do this, you must be logged in with an account with super-admin rights. Install the plugin on the single-site dashboard > plugins; … Read more