Categories
Apply to

Headless WordPress with React


An intro to building decoupled WordPress-powered websites using the WordPress REST API and Create React App

Source: Headless WordPress with React

Categories
Writing

How to add WordPress Theme Styles to Gutenberg — Rich Tabor

Potential pitfallsIf your WordPress theme registers its entire front-end stylesheet for the Gutenberg editor, you’ll end up with a complete mess:

Source: How to add WordPress Theme Styles to Gutenberg — Rich Tabor

Categories
Blocks

Add Theme Color Palette to the Gutenberg Block Editor for WordPress

A comprehensive guide to creating theme color palettes. Learn more about styling themes for the new Gutenberg block editor in WordPress.

Source: Add Theme Color Palette to the Gutenberg Block Editor for WordPress

Categories
Apply to

Ajax function to return value – JavaScript – The SitePoint Forums

function cityconfirm(){
    var cityid = document.getElementById('city').value;
    alert(getcityvalue(cityid));
    return confirm('Are you sure you want to delete')
}

function getcityvalue(cityid){
    // this will generate another thread to run in another function
    jQuery.ajax({
        url: 'http://mysite.com/lookupcity.asp?cityid=' + cityid,
        type: 'get',
        dataType: 'text/html',
        success: function(data){
        //
        return(data);
        }
    });
    // it will always return here in function
    return "Hello";
}

Source: Ajax function to return value – JavaScript – The SitePoint Forums

Categories
Apply to

jQuery binding click to a link after AJAX call

Source: jQuery binding click to a link after AJAX call

Categories
Apply to

[PHP] Singletons and Shared Instances – Alain Schlesser – Level Up WP

Experience Level: Intermediate to Advanced PHP In the post – published July 17, 2017 – Alain Schlesser examines use of the Singleton pattern in WordPress development with PHP, whether it’s a good or bad idea, and alternative approaches to solve the same problems. Article: Topics: What is a Singleton? Problems with the Singleton pattern: Singleton […]

Source: [PHP] Singletons and Shared Instances – Alain Schlesser – Level Up WP

Categories
Apply to

How to Create a WordPress Database Table

Add a table to your WordPress database and pull data from it to your website. Learn how to query and insert data with the $wpdb class.

Source: How to Create a WordPress Database Table

Categories
Apply to

JS dump()

The dump() function for JavaScript tries to emulate the print_r() function of PHP.

Categories
Apply to

SelectControl

https://gist.github.com/rogerlos/7502541070942e16a1188dd0bb9ac2b9

 

Categories
Apply to

JavaScript Promises

Promises are becoming a big part of the JavaScript world, with many new APIs being implemented with the promise philosophy.

Source: JavaScript Promises