[Official] On-Demand Loading of coding scripts and styles

Source: Internet
Author: User
Wandering in the little monster, I went into mu and saw the article "loading the code-related script file on demand". Its code implements loading of the Code on demand. According to the article, another foreign friend wrote something about the boiled fish. By judging whether the article has short code, this can indeed be achieved (loaded on demand ). Although the official Wordpress text

Wandering in the little monster, I went into mu and saw the article "loading the code-related script file on demand". Its code implements loading of the Code on demand. According to the article, another foreign friend wrote something about the boiled fish. By judging whether the article has short code, this can indeed be achieved (loaded on demand ). Although the official Wordpress text

Wandering in the little monster, I went into mu and saw the article "loading the code-related script file on demand". Its code implements loading of the Code on demand.

According to the article, another foreign friend wrote something about the boiled fish. By judging whether the article has short code, this can indeed be achieved (loaded on demand ).

Although the official Wordpress documentation does not elaborate on this aspect, the official coding Code has provided us with a simple implementation method. And performance-based.

How is a standard response code loaded on demand implemented? I wrote it as follows:

 Instance ++; $ atts = export code_atts (array ('test' => ''), $ atts, 'example _ example Code'); // something... (1 ===$ this-> instance) & wp_enqueue_xxx or call_function or do_action; // something... return something ;}}

By defining a variable, when the callback code is called, the variable becomes True, and the relevant js, css, or other relevant calls are automatically loaded.

Compared with Mu's article, judging whether post has short code (has_short Code) is intelligent and has a lot of performance.

It seems that there is nothing to say about this, so it contributes.

In other words, the test and debugging of the New Playlist coding code have been completed. For some reason, the Code is not released for the time being and may need to be delayed.

For details about the effects, see the original sound album "prank kiss" and other albums.

It feels good to be able to access external links.

This is the last article at the end of September.

Bong II is down, and the whole person is not good .. .

Reprinted please note

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.