KHALAF Shortcodes CPT, Pages, Template
Description
KHALAF Shortcodes CPT, Pages and Template adds a dedicated, one-click copyable shortcode column (“Shortcode (KHALAF)”) to your WordPress admin tables for every public post type (Pages, Posts, WooCommerce Products, Custom Post Types, Templates) and every public taxonomy (Categories, Tags, Product Categories, and custom taxonomies).
Simply click on any shortcode field inside your admin tables to copy it instantly to your clipboard and reuse that content, template, or archive grid anywhere on your website!
Key Features
- Copy-Ready Admin Columns: Instant copy-to-clipboard fields directly inside admin list tables.
- Universal Post & Template Shortcode:
[khalaf-content id="123"]works across pages, posts, WooCommerce products, CPTs, and templates. - Smart Layout Engine: Supports
layout="auto"(default),full(complete article with featured image and metadata),product(complete WooCommerce product page),card(clean modern card),shop(WooCommerce grid), andblog(latest posts grid). - Taxonomy Term Shortcode:
[khalaf-term id="12" taxonomy="category"]outputs term posts grids, term cards, images, titles, or archive links. - Built-in Term Image Support: Adds a lightweight media uploader for category and taxonomy term images, fully compatible with themes and shortcodes.
- Performance Optimized: Zero database clutter, assets are loaded on demand only when shortcodes or admin tables are rendered.
- Elementor & Page Builder Friendly: Seamlessly renders Elementor templates or page builder layouts when active, with smooth fallback to standard content.
Post & Content Shortcode
[khalaf-content id="123"]
The layout attribute controls the output presentation:
* auto (default) – Page builder content if present; complete WooCommerce product layout for products; content for pages and templates; styled article for posts.
* full – Featured image, post title, author, date, categories, tags, and full content.
* product – Complete WooCommerce product page (gallery, price, add to cart button, tabs).
* card – Modern styled responsive card.
* content – Raw content only.
* shop – WooCommerce products grid (useful for embedding catalog items).
* blog – Latest posts grid.
Other supported attributes: show_title, show_image, show_meta (yes/no), columns, limit, orderby, order.
Taxonomy Term Shortcode
[khalaf-term id="12" taxonomy="category"]
Term attributes:
* show="posts" (default) – Grid of posts/products associated with this term.
* show="card" – Compact term card (image, name, description, button).
* show="image" – Term image only (size, link="yes").
* show="description" – Term description only.
* show="title" – Term name only.
* show="link" – Direct archive link.
Built-in Security
- Strict Authorization: Private, draft, and scheduled content is only rendered to logged-in users with appropriate editing permissions.
- Password Protection: Password-protected posts are never exposed through shortcodes.
- Anti-Recursion Shield: Automatic recursion detection blocks circular inclusions (e.g. Post A calling Post B which calls Post A).
- Sanitized & Escaped: All inputs, IDs, attributes, and output markup are strictly sanitized and escaped following WordPress coding standards.
Installation
- Upload the
khalaf-shortcodes-cpt-pages-templatefolder to your/wp-content/plugins/directory. - Activate the plugin via Plugins Installed Plugins.
- Open any admin list screen (Pages, Posts, Products, Categories…) and click on the shortcode field to copy it.
- Paste the shortcode into any page, post, widget, or page builder block.
FAQ
-
Does this plugin require Elementor?
-
No. The plugin is completely independent and works natively with the WordPress Block Editor (Gutenberg), classic editor, or any page builder. If Elementor is active, it also supports Elementor templates.
-
Does it work with WooCommerce products and categories?
-
Yes. Products receive
[khalaf-content]and product categories receive[khalaf-term taxonomy="product_cat"]automatically. -
What shortcodes are supported?
-
The official shortcodes are
[khalaf-content]and[khalaf-term]. Additional aliases such as[khalaf-post],[khalaf-template], and[khalaf-elementor-template]are also supported. -
Why does a password-protected post output nothing?
-
Password-protected content is deliberately filtered out to safeguard sensitive data from unauthorized exposure.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“KHALAF Shortcodes CPT, Pages, Template” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “KHALAF Shortcodes CPT, Pages, Template” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial public release on WordPress.org.
- Universal
[khalaf-content]shortcode for pages, posts, CPTs, products, and templates. - Taxonomy term shortcode
[khalaf-term]with dynamic posts grid and term cards. - One-click copyable admin table columns.
- Circular inclusion prevention and permission-based visibility.
- Native term image uploader for custom taxonomies.