JQuery prepend a function

The admin_menu hook is not for displaying the menu, it’s actually part of the menu construction process to figure out exactly what goes in the menu, and this is where you should be making calls to functions like add_submenu_page. So when this action is fired, nothing has been printed out yet, there’s no head/body tags … Read more

where do I send my ajax calls

If you need to use the WordPress enviorment and functions in your ajax processing funciton then you need to post/get your AJAX request to admin-ajax.php, So change ‘ajaxurl’ => plugin_dir_url(‘my_plugin.php’) to ‘ajaxurl’ => admin_url(‘admin-ajax.php’)

how can I do something on new user registration?

You want to use the user_register hook, probably. Then use the Filesystem API to make the folder. Be aware that filesystem manipulation is dependent upon server configuration and may not always work, but using the API should ameliorate that problem as much as possible.

how can I query all wordpress users of a blog

Refer to the get_users() Codex entry. $users = get_users(); You can pass the function an array of arguments, including: $args = array( // Order by username (display name) // Note: ‘login’ is default ‘orderby’ => ‘display_name’, // Order (note: ‘ASC’ is default) ‘order’ => ‘ASC’ ); $users = get_users( $args );

Odd /wp-admin/admin-ajax.php entries showing in Wassup

/wp-admin/admin-ajax.php is the callback file for the WordPress Ajax API. I am assuming, but I am fairly confident, that your plugin is using that API (as it should be). It isn’t an issue. You have to have an AJAX call load some file. WordPress just standardized that location. Despite its location in /wp-admin that same … Read more

Saving widget options from class method

Why are you writing your own save handlers for widgets? The update method your widget class will take care of this. You’re saving per widget settings, exactly what the Widget API was designed to do. <?php class WPSE76224_Widget extends WP_Widget { public function __construct() { // Create the widget options and such here, then call … Read more

How to assign custom template to specific products in Woocommerce?

If the changes you need are strictly CSS, you can add the category names as classes to the body_class via the body_class filter. add_filter(‘body_class’,’wpa76627_class_names’); function wpa76627_class_names( $classes ) { if( is_singular( ‘product’ ) ): global $post; foreach( get_the_terms( $post->ID, ‘product_cat’ ) as $cat ) // maybe you want to make this more unique, like: // … Read more