WPGraphQL Widgets WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
This plugin adds widgets and sidebar queries to WPGraphQL.
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/benada002/wp-graphql-widgets/archive/refs/heads/master.zipWPGraphQL Widgets (Queries)
This plugin registers for each active widget a new widget type which exposes all settings of the widget (and for some widgets a rendered field more here) and implements the WidgetInterface which exposes the following fields.
WidgetInterface {
active
databaseId
html
id
idBase
title
type
}
It also adds sidebar queries.
Requirements
Installation
You can install and activate it just like any other WordPress plugin.
Usage
Widget Examples
widget(id: "nav_menu-3") {
... on WPNavMenuWidget {
navMenu
active
databaseId
html
id
idBase
}
}
widgets {
edges {
cursor
node {
type
title
idBase
id
html
databaseId
active
sidebar {
node {
databaseId
description
}
}
}
}
}
Rendered field
For the WPNavMenuWidget, WPMediaImageWidget, WPWidgetRecentPosts, WPWidgetCategories, WPWidgetPages and WPWidgetRecentComments types there is also rendered field which is a connection to their WPGraphQL type. Here is an example which would give you the menu of a menu widget.
widget(id: "nav_menu-3") {
databaseId
id
... on WPNavMenuWidget {
rendered {
node {
menuItems {
nodes {
label
path
}
}
}
}
}
}
Sidebar Examples
sidebar(sidebar: SIDEBAR) {
afterSidebar
afterTitle
afterWidget
beforeSidebar
beforeTitle
beforeWidget
class
databaseId
description
id
name
widgets {
edges {
cursor
node {
databaseId
}
}
}
}
sidebars {
edges {
cursor
node {
databaseId
name
id
description
class
beforeWidget
beforeSidebar
beforeTitle
afterWidget
afterTitle
afterSidebar
widgets {
nodes {
databaseId
}
}
}
}
}Releases
3 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.