How to Get Current Custom Post Type Associated Taxonomy Term

// First, get associated taxonomies of the post/object. $object_taxonomies = get_object_taxonomies( get_post() ); // Next, get associated terms of the post/object. $object_terms = wp_get_object_terms( get_the_ID(), $object_taxonomies ); $terms = array(); // returned object terms could be WP_Error, so check that first. if( ! is_wp_error($object_terms) && is_array($object_terms) ) { foreach( $object_terms as $object_term ) { // … Read more

Creating Admin Plugin – Content of a page is displayed at global scope as well

Question #1 – The above code will output 23123 twice, when visiting plugin page and when not. How do I make it print the content of my page only when page is the current screen? Basically: http://localhost/wp-admin/admin.php?page=camden-vmtool When you initialize the class, you are hooking the pageInit() method into a hook that fires on all … Read more