All wp-json routes suddenly return 404
Okay, it was really weird. I just went to the Permalink settings and clicked Save without changing anything. That somehow fixed it.
Okay, it was really weird. I just went to the Permalink settings and clicked Save without changing anything. That somehow fixed it.
When developing a block with @wordpress/scripts, wp-scripts uses @wordpress/dependency-extraction-webpack-plugin to allow you to import dependencies from WordPress by replacing the import statements with references to the global variables loaded by the enqueued scripts. For example, this: import { useEffect } from ‘@wordpress/element’ Will become: const { useEffect } = wp.element; And wp-element will be added … Read more
According to ACF documentation, a foreach loop is to be used to access the items in a Relationship field. Untested: $templates = get_field( ‘field_61318c078a746’ ); foreach ( $templates as $template ) { $template_image_id = absint( get_field( ‘Image’, $template ) ); $template_image_url=”https://example.com/fallback-image.jpg”; if ( ! empty( $template_image_id ) ) { $template_image_url = wp_get_attachment_image_url( $template_image_id, ‘large’ ); … Read more
I was able to achieve the functionality I desired by simply using the scrollIntoView API documented here to scroll the selected slide into view after my slider adjusted its position.
You’ll start with add_menu_page(), to create the actual admin page. From there, it’s really up to you, but I recommend using the WP_Posts_List_Table: nearly everything is built-in and ready to use. There are several comprehensive articles on creating a custom list table; most of them should be sufficient for getting you started.
When moving a WordPress Multisite install to a different domain (such as from a live site to localhost), there are a few steps you need to follow to ensure that the site works correctly. These include updating the database and adjusting the wp-config.php file. Firstly, the DOMAIN_CURRENT_SITE in your wp-config.php file should not include ‘http://‘. … Read more
My recommendation is to structure the array so that your variations become “regular rows”. I would use your implementation of prepare_items for that. Here your array is changed to something like that: $this->items = array( array( ‘id’ => 2, ‘page’ => ‘page2’, ‘url’ => ‘page2’, ‘alt-id’ => null, ‘alt-title’ => null ), array( ‘id’ => … Read more
The problematic line is the one for the transition_post_status action’s callback as the input parameter is post status (string) but not post ID (integer): https://developer.wordpress.org/reference/hooks/transition_post_status/
This happens because WordPress doesn’t have provide multi-lingual functionality by default. When you call get_category_link( 22 ), you’ll get exactly that – the link for category with the ID of 22. WordPress isn’t aware that there might be a translation for the term and it should be used instead. The multi-lingual support needs to come … Read more
Usually when I run into email sending problems, the solution is SMTP. You can set up a free account with SendGrid and install WP Mail SMTP. I believe SendGrid is a free option in that plugin as well. WP Mail SMTP has instructions on how to configure SendGrid. Once you’ve configured SendGrid and installed WP … Read more