‘all’ hook and get_option issue

get_option fires hooks itself so you are triggering a infinite loop (or something similar if not actually infinite). Your callback calls get_option, which triggers the hooks used by get_option. Each hook triggers the callback again, which used get_option which triggers the hooks used by get_option. And so on… Get your option value in the constructor, … Read more

‘all’ hook and add_action issue (class based plugin)

First, template_redirect is a front end hook. It never fires on your backend save. You need to choose a backend hook such as admin_init to hook your function. Secondly, based on your pastebin from you other question, your code has the checked attribute hard-coded for both of your radio boxes, thus causing it to default … Read more

E-commerce-like solution [closed]

If you’re looking to have a product catalog, with no option for purchase at this stage, and are looking to potentially have the option for visitors to purchase via the online store at a later date, I’d recommend using WooCommerce along with the Catalog Visibility Options extension. This enables you to disable the purchase functionality, … Read more

How do i use the use the wooCommerce functions in a wordpress plugin?

I believe, the hook is called differently add_filter( ‘manage_edit-product_columns’, … ) The ‘woocommerce_edit_product_columns’ is not a hook name, but a function name in WC 2.0 As for the access to global $woocommerce – as long as the WooCommerce plugin is loaded, it’s available. If, however, your plugin is loaded before WooCommerce (alphabetically), then you can … Read more

Change post permalink to external URL from custom field

Filter post_link (or post_type_link for custom post types), fetch and validate the post meta value, then return that instead of the original link. As a plugin: <?php /** * Plugin Name: External Permalinks * Plugin URI: http://wordpress.stackexchange.com/q/64285/73 * Description: Uses the value of post meta field <code>syndication_permalink</code> as permalink if available. * Version: 2012.11.13 * … Read more

conditional tags for the output of a plugin

You code is not wrong, probably the only problem is that you are using is_home() when you need is_front_page. However, just for a tip, I want show how your code can be semplified a lot: class donor_pdf_plugin extends WP_Widget { static $fields = array(); // Constructor function donor_pdf_plugin() { self::$fields = array( ‘link’ => __(‘Menu … Read more