Michael Burridge
Forum Replies Created
-
I’m not able to reproduce your problem. When I use your code in the
Edit()component of a block everything works fine – your code is good.I did not need to reload the page (apart from making code changes when I expect to have to reload the editor page).
The only difference in my testing is that I used a standard category instead of a custom taxonomy.
Here’s the version I tested with:
import { useBlockProps } from '@wordpress/block-editor'; import { useSelect } from '@wordpress/data'; export default function Edit() { const currentPost = useSelect( ( select ) => select( 'core/editor' ).getCurrentPost() ); console.log( currentPost ); const currentTaxonomies = useSelect( ( select ) => select( 'core/editor' ).getCurrentPostAttribute( 'categories' ) ); console.log( currentTaxonomies ); let fetchedCurrentThematique = useSelect( ( select ) => select( 'core' ).getEntityRecord( 'taxonomy', 'category', currentTaxonomies[ 0 ] // or currentPost.thematiques[0] works as well ) // [ currentTaxonomies ] ); console.log( fetchedCurrentThematique ); return ( <p { ...useBlockProps() }> { fetchedCurrentThematique ? fetchedCurrentThematique.name : '' } </p> ); }Forum: Plugins
In reply to: [Gutenberg] Handling dynamic datas inside Custom Formatting — Formatting ApiYou may need to do a check for
isResolvingbefore attempting to use the data inpost. See this article.Another, perhaps simpler approach, might be to use the
useEntityRecordhook. This returns an object with the data as well as the resolving state. See this article.Hope this helps.
Forum: Plugins
In reply to: [Gutenberg] Convert Dynamic Block To Static@shridham what error are you getting? Can you show us the error message please.
Dynamic blocks do not show the character/word count because they are server-side rendered. There’s no way for the editor to know how may characters/words are in the content.
Forum: Plugins
In reply to: [Gutenberg] set tax_query of query loop block with pre_get_post actionA Taxonomy is a way of grouping posts. ‘Category’ is an example of a taxonomy. ‘Tag’ is another example. Taxonomy is the umbrella term which encompasses categories and tags. It’s also possible to create Custom Taxonomies, and it looks like you’ve already done this by defining
category_faq.Hi, I don’t see the error on that page. Have you managed to resolve this issue?
Forum: Fixing WordPress
In reply to: white screen of death; no token in emailDo you have automatic updates enabled? Are you able to restore from a backup of your site in your hosting’s cPanel?
You could also try raising the PHP memory limit.
There are also some other troubleshooting strategies in the same article.
You should be able to add a meta description tag with Yoast. This page may be able to help you with that.
Forum: Fixing WordPress
In reply to: Unable to update to WordPress 6.1It may be the directory permissions on the server. Use an FTP client to check file and directory permissions. Directory permissions should be set to 755 and file permissions to 644. Please see this page for more info.
There’s also this related issue which you may find helpful.
Forum: Fixing WordPress
In reply to: Mobile view menu font colour in Twenty TwentyTry adding this CSS and see if that solves the problem for you:
.overlay-header .toggle { color: black; }Hope this helps. Let me know.
Forum: Fixing WordPress
In reply to: Wrong time take over in postsCheck with your hosting company that the server admins have changed the time from Daylight Saving Time.
Forum: Fixing WordPress
In reply to: Creating a slug-tag for pagesYou could probably do that with a 301 redirect. There are a number of 301 redirect plugins in the repository.
Forum: Fixing WordPress
In reply to: Cannot Access DashboardThere’s a previous query which may help you to resolve this issue.
Forum: Fixing WordPress
In reply to: Wideget and side bar erorrsHave you tried the Classic Widgets plugin?
Forum: Fixing WordPress
In reply to: 500 Internal Server ErrorThere’s a couple of things you can do to backup your posts.
Firstly you can take a backup of the whole database using something like phpMyAdmin which should be available from your hosts cPanel.
Secondly you can export your content from the WP Admin. Select Tools -> Export.
For a belt-and-braces approach do both! 😅
Forum: Accessibility
In reply to: inaccessible backendGood to hear that you’ve resolved your problem. I suggest you change the permissions to the recommended as 7 for group permissions allows modify and delete.