How do I return XML to an API post request

because you don’t return JSON, you can use admin-post.php. create a hook like that : add_action(“admin_post_nopriv_MY_PLUGIN__answer”, function () { header(“Content-type: text/xml”); echo “<abc><def>1</def></abc>”; exit(); }); and then use the url /wp-admin/admin-post.php?action=MY_PLUGIN__answer. when you do debugging, don’t forget that admin_post_nopriv only answers on unconnected users then you can open the url in another browser.

Add taxonomy or category slug to custom post types URL

You would do it by assigning the taxonomies when registering the post type: ‘taxonomies’ => [ ‘taxonomy1’, ‘taxonomy2′, ..etc ], https://developer.wordpress.org/reference/functions/register_post_type/#taxonomies https://developer.wordpress.org/reference/functions/register_post_type/#taxonomies-2 You can also use register_taxonomy_for_object_type to do this if you want a function call. You still need to register the taxonomies though or this won’t work. Note that this won’t change your CPT’s … Read more

Select a Text for CSS

Start by creating a stylesheet for your plugin.Then you can use the do_action(‘admin_enqueue_scripts’) to enqueue it in the controlpanel only, avoiding it to be loaded in the frontend. You could do something like this: function my_plugin_admin_styles() { wp_enqueue_style(‘my-plugin-admin-style’, plugin_dir_url(__FILE__) . ‘assets/css/admin-style.css’, array(), ‘1.0.0’, ‘all’); } add_action(‘admin_enqueue_scripts’, ‘my_plugin_admin_styles’); Just make sure to correct the path for … Read more

Remove `View post` Text

I think the issue is this piece of code $messages[‘game’] = $messages[‘post’];. $messages will contains all the updated messages for all custom post type. In this case, your CPT is game, so you should change the array item of game only. The correct code should be public function game_updated_messages( $messages ) { $messages[‘game’][1] = ‘Post … Read more

How can I catch WordPress custom settings page slug has already changed?

you can use the admin_init hook along with the add_query_arg() function to modify the redirection URL for handle the situation. Redirect users to the correct URL admin.php?page=management if they access the settings page with an unexpected slug. Modify the redirection URL after settings have been updated to include the current page slug management, ensuring that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)