HOW TO Insert Existing PHP Code to WOrdPress

Generally speaking, you can typically take PHP code and place a comment at the top: <?php /* Plugin Name: My SOAP Plugin */ ?> You can then create a folder for the plugin inside /wp-content/plugins/ (for example, /wp-conten/plugins/my-soap-plugin/) and place the PHP file inside that folder. At that point, you can activate the plugin from … Read more

soap request in wordpress for a fedex pickup request [closed]

It looks like it was my original assumption. I placed all my codes into functions and then made a plugin and everything is working almost perfectly. The major hurdle was that because it was being handled on 2 pages and outside functions wordpress just didn’t seem to know what it/I was doing. Thanks again @tomjnowell … Read more

Showing how many times is plugin activated or deactivated

Although you might have already managed to solve the problem you faced, here’s few thoughts. You could use register_activation_hook(), register_deactivation_hook() and register_uninstall_hook() functions to trigger a wp_remote_post() call to your (custom) API endpoint to count the times when your plugin is activated, deactivated or deleted. If the recieving site, where you keep track of the … Read more

Unexpected T_FUNCTION

Check that the user has php >= 5.3 installed. The inline function syntax used on that line only works with that or higher. You can rewrite the line to create a separate function and then call it like this: usort($mz_classes, ‘myFunction’); For more info: http://php.net/manual/en/function.usort.php