13 Responses

  1. Brett Mason
    Brett Mason Published |

    Thanks Justin really interesting and (as normal) well written writeup. The increase in reliance and use of JavaScript within WordPress has been something I’ve been watching and, like you, trying to improve my JavaScript skills to keep up. This will be a great resource so thank you! 🙂

    Reply
  2. JavaScript templating in the WordPress customizer | WordPress Developer Notes
  3. Steven Zahm
    Steven Zahm Published |

    Thanks for the writeup!

    I found this walkthru extremely helpful:

    https://lkwdwrd.com/wp-template-js-templates-wp/

    It even goes into wp.template() and wp.ajax(), two very help WP JS API/s that there is also very little documentation and tutorials on as well.

    Any way, thought I’d mention this link because it was very helpful in learning about these API/s so I could put them to use in a new extension for my plugin.

    Reply
  4. Nick Halsey
    Nick Halsey Published |

    You shouldn’t need to manually set the value of the setting with JS here. I’m guessing the issue is that you may not be passing the data-link attribute in to the select element. In #30738, core will probably add this by default.

    I see that you have {{{ data.link }}} in the select element, but are you passing the link html in to_json()? Would be something like $this->json[‘link’] = $this->get_link();.

    Anyway, glad to see that people are interested in exploring this newer part of the API, it’s really powerful and it’ll be interesting to see what else it allows us to do (it’s central to Menus working effectively).

    Reply
  5. AB Associates
    AB Associates Published |

    hey Justin, nice post. I like it, this is very much helpful for me, I really need this.

    Thank you for sharing this, keep on writing.

    Reply
  6. Tom
    Tom Published |

    This is very useful thing, I’ll use it for sure. Thx!

    Reply
  7. ANAND
    ANAND Published |

    Thank You Justin it was very help full for me.

    Reply
  8. JavaScript templating in the WordPress customizer - Damon Cook
  9. WordPress Customizer resources - rweber.net

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.

css.php