bcw00
Forum Replies Created
-
Forum: Plugins
In reply to: [Image Source Control Lite – Show Image Credits and Captions] GraphQL data?I guess the number of people using GraphQL to display WordPress data via another framework in a headless setup may be few and far apart. Seems I just have to register the variables myself rather than putting that burden on you. Here’s a quick Claude code plugin.
<?php
/**
* Plugin Name: ISC + WPGraphQL Bridge
* Description: Exposes Image Source Control attachment meta in WPGraphQL.
* Version: 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'graphql_register_types', function() {
register_graphql_field( 'MediaItem', 'imageSourceControl', [
'type' => 'ImageSourceControlMeta',
'description' => __( 'Image Source Control metadata for this media item.', 'your-textdomain' ),
'resolve' => function( $media_item ) {
$attachment_id = isset( $media_item->databaseId ) ? (int) $media_item->databaseId : 0;
if ( ! $attachment_id ) {
return null;
}
$license = get_post_meta( $attachment_id, 'isc_image_licence', true );
if ( empty( $license ) ) {
$license = get_post_meta( $attachment_id, 'isc_image_license', true );
}
return [
'source' => get_post_meta( $attachment_id, 'isc_image_source', true ),
'sourceUrl' => get_post_meta( $attachment_id, 'isc_image_source_url', true ),
'license' => $license,
'isOwnSource' => (bool) get_post_meta( $attachment_id, 'isc_image_source_own', true ),
];
},
] );
register_graphql_object_type( 'ImageSourceControlMeta', [
'description' => __( 'Metadata from the Image Source Control plugin.', 'your-textdomain' ),
'fields' => [
'source' => [
'type' => 'String',
'description' => __( 'Image source name.', 'your-textdomain' ),
],
'sourceUrl' => [
'type' => 'String',
'description' => __( 'Image source URL.', 'your-textdomain' ),
],
'license' => [
'type' => 'String',
'description' => __( 'Image license.', 'your-textdomain' ),
],
'isOwnSource' => [
'type' => 'Boolean',
'description' => __( 'Whether the image is marked as in-house / own source.', 'your-textdomain' ),
],
],
] );
} );Any update?
@meattle Ohhh yea. I see what you mean, but I had figured that part before haha. That’s why I marked it solved so I wouldn’t waste your time.
@meattle Not sure what you are referring to about the path. I mentioned they can use the name of the template (assuming they have one in their custom theme folder).
@subscribetech
It’s just basically the shortcode in a php wrapper. Here is an example. It’s saying to use the yarpp-template-photoblog (you can change that to your own template) and limited to 3 posts. In the HTML itself, it has its own wrap, so you might have to add some additional styling if you’re mixing it in with something else.
https://ww.wp.xz.cn/plugins/yet-another-related-posts-plugin/#installation<?php echo do_shortcode('[yarpp template="yarpp-template-photoblog" limit=3]'); ?>Ahh ok didn’t know that was an issue BUT I actually don’t mind sacrificing the block editor fields for the media library. Adding the one extra step to get to media library is not an issue, so my problem is indeed solved.
Found an easier solution with the shortcodes.
Forum: Plugins
In reply to: [Autoptimize] How does Autoptimize treast @import?Perfect, thank you!
I am not sure what happened. Re-downloaded and it’s fine. I was looking at the public.php file. Maybe I pasted in something in that line in error and didn’t even notice (that was the only difference between my copy and the official download). Sorry to waste your time.
Wonderful. The CSS option was the quickest fix for me. Thanks!
Legend. Works perfectly 😀
Forum: Plugins
In reply to: [Easy Table of Contents] Header no longer showing in Pure CSS modeYes it works now, thank you!
Forum: Plugins
In reply to: [Easy Table of Contents] Header no longer showing in Pure CSS modeHi there. Thanks for the response. I’m using 2.0.51.1
Forum: Plugins
In reply to: [Extensions for Leaflet Map] Creating marker filter without a cluster?I understand. No problem
Forum: Plugins
In reply to: [Leaflet Map] Pop ups flashing when tapped from mobile viewThank you 😀