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

Rewrite in plugin

You’re almost there, but your understanding of how rules work is slightly off. Also I would recommend using the page_rewrite_rules filter: function wpse_224942_page_rewrite_rules( $rules ) { global $wp_rewrite; /* Don’t forget to change “my_query_var” in the rewrite rule too */ $new_rules = array( ‘bz/([^/]+)/?$’ => $wp_rewrite->index . ‘?pagename=bz&my_query_var=” . $wp_rewrite->preg_index( 1 ), ); return $new_rules … Read more

Creating plugin for changing slug

You can change the slug as you want in wordpress. Just go to the post or to the page. Edit the Post or the Page you want to change the slug. On the right side there is a button: Screen Options. Click it and Check slug. Then you’ll manually can give what ever slug you … Read more