*, PHP
PHP cURL In general, we use cURL to communicate with API endpoints. Using cURL might not be the most pretty approach, but it definitely does the job. See the example below: // Method: POST, PUT, GET etc // Data: array(“param” => “value”)...
PHP, WordPress
If you ever need to create a homepage which is build from different pages as sections you can create an index.php page in theme main directory and use the following WordPress get_page/get_post functions which will return WP_Post Object. See example below: get_page is...
PHP, WordPress
Adding shortcode in WordPress is very simple. You can do it from functions.php of your child theme: // function that runs when shortcode is called function wpb_demo_shortcode() { // Things that you want to do. $message = ‘Hello world!’; // Output needs to...
PHP
If you need to test PHP between different PHP version try this online sandbox:https://sandbox.onlinephpfunctions.com/ 1 How to not get an “apple” element from the array $a = array(“a” => “apple”, “b” =>...
*, PHP, Standards
Quick preview – Develop PHP with standards. Fallow this rules to ensure your code is legit and well formed. Keep up with those principle and you will become a better programer. KISS – “Keep It Simple, Stupid” The simpler your code is, the...
*, PHP
https://cheatography.com/davechild/cheat-sheets/php/pdf/