This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Json means java script object notation. | |
Json is used for transfering the data from cleint side to server or vice versa. | |
Json formate is text only so it can easily send to and from server. | |
In Json data is key value pair, with data separated by comma and | |
curly braces hold object data and square bracket hold array data. | |
Key must be string and written in double quotes. | |
Value must be one of the following | |
* a string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is character Set and Encoding | |
=================================== | |
Character encoding are the important concept in process of converting byte streams into characters. | |
There are two things which are important in converting byte to character "character set and an encoding" | |
================= ####### ================= ####### ================== | |
In the earlier stage of computer encoding | |
There are diffrent methods of representing the character. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The below code is plugin codes used for adding new functionality setup | |
while updating the plugin or activating the plugin. | |
This is simple plugin code and it will add transient while updating or activating the plugin. | |
Clear transient once we finished the operation. | |
======================================================================================= | |
<?php | |
/*Plugin Name: Wordpress Update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wpdb->get_row() | |
==================== | |
get_row() returns single row of data from database table. | |
eg: | |
<?php | |
$mycustomer = $wpdb->get_row(“SELECT * FROM laundry_customers WHERE ID = 1”); | |
echo $mycustomer -> customer_name; | |
?> | |
$wpdb->get_results() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1)Constant Array | |
=============== | |
Now the constant data types in php can be defined as numerically indexed array and associative array. | |
So below line of code can be coded like as new constant array. | |
old | |
------ | |
<?php | |
define('COLOR_RED', '#f44141'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ob_start() and ob_get_clean() are used hold the value in the inter buffer memory. | |
Normal Buffering functions used are. | |
ob_start(); | |
--------------- | |
This function will turn on the out buffer While buffering is ON no output is sent from script (other then headers), | |
instead the output is stored in internal buffer. | |
ob_get_clean(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esc_html(): | |
It is wordpress function used to convert the html element to html entity. | |
Refer the below eg: | |
$html = esc_html( '<a href="http://www.example.com/">A link</a>' ); | |
so $html contain | |
<a href="http://www.example.com/">A link</a> | |
The output will display like below. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Static means they are unchanging. | |
static function means, it is a function namespaced by the name of its class. | |
To make a function static, we need to add the key work static in the function definition. | |
Like | |
public static function(){ | |
// Statement. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container-fluid"> | |
<div class="row"> | |
<!-- <div class="section-head text-center col-sm-12"> | |
<h4>My Work</h4> | |
<p>...</p> | |
</div> --> | |
<?php | |
$terms = get_terms( array( | |
'taxonomy' => 'work-category', | |
'hide_empty' => false, |