Can’t pull metadata for a term in my theme’s function.php

woocommerce_add_to_cart_validation is a filter that is run in the add_to_cart_action method of the WC_Form_Handler class. This method is attached to the init hook. add_action( ‘init’, array( $this, ‘add_to_cart_action’ ) ); Your taxonomy is quite probably also registered at the init hook. The WooCommerce action has no priority set, so the default would be 10. I … Read more

Build and ajax plugin not work

You never enqueued the ajax_init in a function. Also you can use plugins_url() and split into two functions with a shortcode, like this: (not tested) <?php /* Plugin Name: Ajax Plugin Description: Plugin for adding ajax Version: 1.0 */ /*——————————————————-*/ /* Register Scripts /*——————————————————-*/ add_action( ‘wp_enqueue_scripts’, ‘ajaxp_init’ ); function ajaxp_init(){ /* * registro del script … Read more

How to get WordPress Adminmenu items?

Menu and submenu data is accessible through the $menu and $submenu globals: add_action( ‘admin_notices’, ‘so19890599_print_menus’ ); function so19890599_print_menus() { global $menu, $submenu; echo ‘<pre>’; print_r( $menu ); echo ‘</pre>’; echo ‘<pre>’; print_r( $submenu ); echo ‘</pre>’; }

Session alternative for plugins (due to caching)

A similar question popped at [wp-hackers] and apparently Eric Mann‘s plugin, WP Session Manager, is the way to go. I haven’t analyzed the plugin’s code, so cannot tell about its inner workings. Pippin Williamson embeds WPSM in his Easy Digital Downloads plugin. Given Pippin’s review and Eric being such a pro-old-timer-wp-ninja, I wouldn’t look no … Read more