[Solved]: Add store to custom wordpress plugin?
The solution was simpler than expected. I just had to add the following to my store file. // Check if store already exists if (!select(STORE_NAME)) { register(store); }
The solution was simpler than expected. I just had to add the following to my store file. // Check if store already exists if (!select(STORE_NAME)) { register(store); }
Use the ACF field name, not the field key. This works: update_field(‘forecast_link’, $json_data[‘properties’][‘forecast’], $post_id); update_post_meta($post_id, ‘forecast_link’, $json_data[‘properties’][‘forecast’]); Use array keys to access nested data as needed. Reference (ACF Docs): https://www.advancedcustomfields.com/resources/update_field/
As far as I can tell you shouldn’t need archive_template_hierarchy, just name the template properly according to the template hierarchy. So offerings//archive-offerings.
You can update this through the database (wp_options) table. The option_name is called “admin_email”
Currently that is not an option inside the block editor. You need to add custom CSS to do it.
the plugin Site Kit by Google plays with the capabilities to do that. you can see that in the source code here. this works actually with WordPress 6.8.1 but it’s not sure this trick will work with next versions. to use the same trick in your code, you have to change the 2 parameters with … Read more
Meta Query meta_query takes an array of meta query arguments arrays. You may check WordPress documentation for examples. This construct allows you to query multiple metadatas by using the relation parameter in the first (outer) array to describe the boolean relationship between the meta queries. Accepted arguments are ‘AND’, ‘OR’. The default is ‘AND’. Solution … Read more
this filter modifies the answer of the api route wp/v2/taxonomies when gutenberg request it. it relies on the http header Referer which is set by the client. then, there is no security checks, it’s only a cosmetic customisation. add_filter(“rest_prepare_taxonomy”, function ($response, $taxonomy, $request) { if (“bundles” === $taxonomy->name) { // searching the post id preg_match( … Read more
Assuming that your search block is inside the group block, you need to set the attribute via $processor->set_attribute( ‘data-wp-interactive’, ‘wpse/local-search’ ); inside your wpse_locals_filter_search function as well, since inner blocks are processed before the outer blocks (see line 11 below): function wpse_locals_filter_search( $block_content, $block ) { if ( isset( $block[‘attrs’][‘className’] ) && ‘wpse-local-filter’ === $block[‘attrs’][‘className’] … Read more
You’re better off running two queries, then merging the results. $first = get_posts( [ ‘fields’ => ‘ids’, ‘s’ => $s, // … ] ); $second = get_posts( [ ‘fields’ => ‘ids’, ‘meta_query’ => … ] ); $ids = array_values( array_unique( array_merge( $first, $second ) ) ); $query_args = [ ‘post__in’ => $ids, // … ]; … Read more