Adding fields to category manager. Does a method exist to get the link to the category edit screen?

The function which is used internally (since 3.1) is get_edit_term_link( $term_id, $taxonomy, $object_type=”” ). Source view here. There’s also a function called edit_term_link that will format the link output for you. The built-in functions are probably better to use, because they check for user capabilities, etc., and are better for future compatability. That said, I … Read more

What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?

Completely skipping wp_head and wp_footer doesn’t seem like a good idea, many core components and plugins depend on these hooks. Instead, you could create a light header and footer, and load them via an extra argument to get_header() and get_footer(). get_header( ‘light’ ) will load header-light.php instead of the regular header file. Create one without … Read more

Plugin Development/ Stop CSS clashes.

If you don’t know, and can’t control, the content width, then your Plugin shouldn’t assume any given content width. Also, even though templates may be 960px in total width, the content width will almost assuredly be less than that. If you must apply explicit width to your output, you could try returning the value set … Read more

Can’t get CSS Into the Head via add_action

You don’t call enqueue or register functions hooking into the wp_head hook. At that hook its too late to add more, I guess, unless you play with priority parameter. Use the init hook to call wp_enqueue_* & wp_register_* functions. Do it like this: <?php add_action(‘wp_enqueue_scripts’, ‘addCSS’); function addCSS() { wp_register_style( ‘prefix-style’, plugins_url(‘AddToCartStyles.css’, __FILE__) ); wp_enqueue_style( … Read more

How do I add a favicon that only shows during viewing of my plugin’s admin panel?

When you add your admin (sub)page, then you’re (hopfully) using add_*menu_page(). You can simply save its result in a var. This var is the $hook_suffix. Then you can simply add your callback (that adds the favicon) to the admin_head-{$suffix} hook Source Link. As the plugins screenshot shows you, there’re also the load-{$hook_suffix}-hooks Source Link, which … Read more

wp_get_post_terms Order by not working

Your title is wp_get_post_terms Order by not working but if you use a custom post type you need to use wp_get_object_terms() I’m not sure what your aim is, but here is a code example you can try: $my_post_type=”post”; // edit this $my_taxonomy=”category”; // edit this $my_query = new WP_Query(array(‘post_type’ => $my_post_type,’posts_per_page’=>10)); if ($my_query->have_posts()) : while … Read more