Efficiency of web page increases when minimized version of jQuery is used.min.js file will be more than 50% less than the normal js file. Reduction in the file size makes the web page faster.
Explain the difference between the .detach() and .remove() methods in jQuery.
The .detach() and .remove() methods are the same, except that .detach() retains all jQuery data associated with the removed elements and .remove() does not. .detach() is therefore useful when removed elements may need to be reinserted into the DOM at a later time.
What are the four parameters used for jQuery Ajax method?
The four parameters are
- URL – Need to specify the URL to send the request
- type – Specifies type of request(Get or Post)
- data – Specifies data to be sent to server
- Cache – Whether the browser should cache the requested page
What’s the difference between document.ready() and window.onload()?
The document.ready() event occurs when all HTML documents have been loaded, but window.onload() occurs when all content (including images) has been loaded. So generally the document.ready() event fires first.
What are the basic selectors in jQuery?
Following are the basic selectors in jQuery:
- Element ID
- CSS Name
- Tag Name
- DOM hierarchy
How to disable comments in WordPress?
To disable comments in WordPress, Please follow below steps
Step 1: Login to your WordPress admin panel.
Step 2: Go to the Settings menu.
Step 3: Under Settings menu click on Discussion.
Step 4: Uncheck Allow people to post comments on new articles. checkbox
Step 5: Click on save changes button, you done
What are minimum requirements to run WordPress?
- PHP 7 or greater
- MySQL 5.6 or greater OR MariaDB 10.0 or greater
- The mod_rewrite Apache module
- HTTPS support(Recommended)
What is usermeta function in WordPress?
The usermeta function is used to retrieve the metadata of users. It can return a single value or an array of metadata.
Syntax is: get_user_meta( int $user_id, string $key = ”, bool $single = false )
User id is the required user id parameter
Key is the optional parameter which is the meta key to retrieve. By default, it returns data for all key values.
Single is an optional parameter that tells whether the single value will return. By default, it is false.
Deactivated Plugins Slow Down a WP Website?
WordPress will only load the active plugins and if there are any deactivated plugins preset, it will be the same as if they weren’t there.
How to register new order status in WooCommerce
In this article, I will show you how to add/register new order status in the WooCommerce. Here is an example to add Manufacture status in to the WooCommerce order status. Add this to your theme’s functions.php
function register_manufacture_order_status() { register_post_status( 'wc-manufacture', array( 'label' => 'Manufacture', 'public' => true, 'exclude_from_search' => false, 'show_in_admin_all_list' => true, 'show_in_admin_status_list' => true, 'label_count' => _n_noop( 'Manufacture (%s)', 'Manufacture (%s)' ) ) ); } add_action( 'init', 'register_manufacture_order_status' ); // Add to list of WC Order statuses function add_manufacture_to_order_statuses( $order_statuses ) { $new_order_statuses = array(); // add new order status after processing foreach ( $order_statuses as $key => $status ) { $new_order_statuses[ $key ] = $status; $new_order_statuses['wc-manufacture'] = 'Manufacture'; } return $new_order_statuses; } add_filter( 'wc_order_statuses', 'add_manufacture_to_order_statuses' );
You can change wc-manufacture and Manufacture into your custom status to register new order status in WooCommerce.
Have any doubt, then comment here!