This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query ExportData { | |
postTitleTemplate: _echo(value: "Photograph: {label}" | |
) | |
@export(as: "postTitleTemplate") | |
postContentTemplate: _echo(value: """ | |
<!-- wp:paragraph --> | |
<p>This is a photograph of: <strong>{label}</strong></p> | |
<!-- /wp:paragraph --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query GenerateURLs( | |
$total: Int! | |
$offset: Int! | |
$limit: Int! = 10 | |
) { | |
numbers: _arrayFill(count: $total, value: "") | |
@remove | |
boundNumbers: _arraySlice( | |
array: $__numbers, | |
offset: $offset, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( | |
"gatographql__executed_query:ImportPostFromRSSFeed", | |
function (Response $response) { | |
/** @var string */ | |
$responseContent = $response->getContent(); | |
/** @var array<string,mixed> */ | |
$responseJSON = json_decode($responseContent, true); | |
$postID = $responseJSON['data']['createPost']['post']['id'] ?? null; | |
if ($postID === null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query FetchPodcastRSSData( | |
$url: URL! | |
) | |
@configureWarningsOnExportingDuplicateVariable(enabled: false) | |
{ | |
_sendHTTPRequest(input: { url: $url, method: GET }) { | |
body @remove | |
rssJSON: _strDecodeXMLAsJSON( | |
xml: $__body | |
alwaysArrayTagNames: ["itunes:category"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query ExportData { | |
roles { | |
capabilities | |
@export(as: "roleCapabilities", type: DICTIONARY) | |
} | |
capabilities | |
@export(as: "allCapabilities") | |
@remove | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Helper Plugin - Disable user edit profile for WP PoP API | |
Version: 0.1 | |
Description: It removes the edit profile page for all users other than admins | |
Plugin URI: https://gist.github.com/leoloso/4e367eb8d8014a7aa7580567608bd5b4 | |
Author: Leonardo Losoviz | |
*/ | |
/** | |
* @see: https://wordpress.stackexchange.com/a/45892 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query IntrospectionQuery { | |
__schema { | |
queryType { | |
name | |
} | |
mutationType { | |
name | |
} | |
subscriptionType { | |
name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Helper Plugin - Disable user edit profile for WP PoP API | |
Version: 0.1 | |
Description: It removes the edit profile page for all users other than admins | |
Plugin URI: https://gist.github.com/leoloso/4e367eb8d8014a7aa7580567608bd5b4 | |
Author: Leonardo Losoviz | |
*/ | |
/** | |
* @see: https://wordpress.stackexchange.com/a/45892 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is the prettyprinted version of a block's `build/index.js` after running `npm run build` | |
// It works well, by adding this code anywhere in the block: | |
// const fixIncreadiblyWeirdBug = { | |
// ...{}, | |
// } | |
! function(e) { | |
function t(t) { | |
for (var r, s, a = t[0], u = t[1], c = t[2], p = 0, d = []; p < a.length; p++) s = a[p], Object.prototype.hasOwnProperty.call(o, s) && o[s] && d.push(o[s][0]), o[s] = 0; | |
for (r in u) Object.prototype.hasOwnProperty.call(u, r) && (e[r] = u[r]); | |
for (l && l(t); d.length;) d.shift()(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Related to https://github.com/WordPress/gutenberg/issues/23607 | |
// This is the prettyprinted code for a block's `build/index.js` after running `npm run build` | |
// This code doesn't work! It compiles, but the block is not added under `wp.blocks.getBlockTypes()` | |
// When loading the editor in the browser, the block is not loaded, and it throws this error in the console: | |
// Uncaught TypeError: e[t] is undefined | |
! function(e) { | |
function t(t) { | |
for (var r, s, a = t[0], u = t[1], c = t[2], p = 0, d = []; p < a.length; p++) s = a[p], Object.prototype.hasOwnProperty.call(o, s) && o[s] && d.push(o[s][0]), o[s] = 0; | |
for (r in u) Object.prototype.hasOwnProperty.call(u, r) && (e[r] = u[r]); | |
for (l && l(t); d.length;) d.shift()(); |
NewerOlder