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
| 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
| $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
| 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
| 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
| 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
| In woo-commerce there are lot of filter they are dynamically generated for the multiple function use. | |
| So these hooks are hard to find and can't be found while searching the woocommerce folder. | |
| The below hook is the one of the dynamic hooks used in the woocommerce | |
| 1) get_property hooks for the woocommerce product class (woocommerce_product_get_price). | |
| ========================================================= | |
| All the get_functions in the WooCommerce product class, like $product->get_price(), | |
| use the get_prop() method under the dynamic filter hook | |
| This is part of the WC_Data class that WC_Product extends. |
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
| When we apply the float to inner elements and the outer div is not taking the height. Then you can use below snippets. | |
| <div class="containing-div"> | |
| <div class="floating-div"> | |
| <ul> | |
| <li>List Item One</li> | |
| <li>List Item Two</li> | |
| <li>List Item Three</li> | |
| <li>List Item Four</li> | |
| </ul> |
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
| If we are using the button in the form for submitting the data, then it will work if we click the button. | |
| If we are using the jQuery.submit() function for submiting the form. Then the button value doesn't submit. | |
| For working form with the button value without an issue you just need to configure the a hidden input | |
| and add all the button property to the hidden field. | |
| Below is the code for configuring the form. | |
| $("input[type=submit], input[type=button], button").click(function(e) { | |
| var self= $(this), |
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
| Introduced in the PHP 5. | |
| PHP will call this method, when ever we create a new object. So it is used for the any initialisation before object start. | |
| Parent constructors are not called implicitly in the child class. In order to get the parent constructors in child class | |
| we need to add the statement parent::__construct() within the child constructor. | |
| If the child doesn't contain any __construct(), then the parent class __construct() method will be inherited. | |
| <?php | |
| class grandpa{ |