How to change text in a page by utilizing a custom user id?

You could use a function like so: function construction_intro( $id = ”, $echo = true ){ $id = absint( $id ); switch ($id) { case 123 : $name = “Hillary’s”; $location = “Washington D.C.”; break; case 9999 : $name = “Bernie’s”; $location = “Burlington”; break; case 47679 : $name = “Donald’s”; $location = “New York”; … Read more

Is it possible to get a shortcode generated by a plugin, then, using a function, create a new post using that shortcode?

I played around with the plugin files and was able to figure it out myself. For anyone who’s wondering, you can use wp_insert_post. You just need to find what variable the generated shortcode is stored in, which can take a little digging through the plugin files. For the plugin I was working with, it went … Read more

Display subcategories in the filter on CPT

You need to hook in to the Posts list table using the manage_posts_extra_tablenav filter, but you can show the filter yourself by using the wp_dropdown_categories() function. The only two $args that you are really interested in are depth and taxonomy, but I’ve included all of the defaults below. Full details of the wp_dropdown_categories() function can … Read more