WordPress Developer Ukraine, Kyiv
WordPress block.json Schema: apiVersion, Attributes, Supports, and Auto-Registration

WordPress block.json Schema: apiVersion, Attributes, Supports, and Auto- ...

block.json in WordPress: apiVersion, attributes, supports and registration Since WordPress 5.8 a block can be described completely in a block.json file. It is the single source of truth for the block: name, title, category, icon, attributes, supported features, scripts and styles. WordPress reads it in PHP with register_block_type() and in JavaScript, and enqueues the assets…
WooCommerce wc_get_product(): Read Product Data, Pricing, Stock, and Variations with WC_Product

WooCommerce wc_get_product(): Read Product Data, Pricing, Stock, and Var ...

wc_get_product(): read and change WooCommerce product data A WooCommerce product is a post, but its data (prices, stock, SKU, dimensions, gallery) is managed by WooCommerce’s product classes. Since WooCommerce 3.0 the right way to read and change it is the product object returned by wc_get_product(), with getters like get_price() and setters plus save(). Reading post…
Register a custom post type in WordPress the right way

Register a custom post type in WordPress the right way

Register a custom post type in WordPress the right way WordPress has two built-in content types, posts and pages. As soon as a site needs structured content of another kind (portfolio items, events, team members, properties), putting it into posts with custom fields gets messy: the blog list mixes articles with team profiles, the editor…