When accessing a wordpress blog, I want to force http when accessing wordpress via xmlrpc otherwise force https

The XML-RPC request is presumably to /xmlrpc.php in the root. In which case you can just make an exception for this at the very top of the .htaccess file (no need for the front-controller to be processed). For example: # Prevent remaining mod_rewrite directives to be processed RewriteRule ^xmlrpc\.php$ – [END] HOWEVER, WordPress itself is … Read more

How to include block style variations for blocks in posts dynamically rendered via the Interactivity API

Block variation styles are parsed and processed through wp_render_block_style_variation_support_styles(). This is marked as private and thus should not be called by third-party code outside WordPress core. This function is called by virtue of being hooked into the render_block_data hook. Thus, if you have a subset of known block structures that may appear, you could consider … Read more

set allowedBlocks to a specific variant

First: It is impossible allowedBlocks only accepts block names as strings — not specific variations or object definitions. Second: What’s the correct approach? Use the base block name, then define the variation via className or attributes in the template. How to find a variation’s className? Insert the block (e.g., core/group) and select the desired variation. … Read more

Hook to modify content on a column on the edit.php (list of posts page)?

you can do this customisation by removing the core author column and replace it with a custom one. $post_type = “kea_activity”; add_filter(“manage_{$post_type}_posts_columns”, function ($posts_columns) { $posts_columns[“author_custom”] = “Author”; unset($posts_columns[“author”]); return $posts_columns; }); add_action(“manage_{$post_type}_posts_custom_column”, function ($column_name, $post_ID) { if (“author_custom” === $column_name) { $author = get_the_author(); echo esc_html($author) . ” <strong>information</strong>”; } }, 10, 2);

Which approach for managing automatic updates would be more robust?

I don’t think your first snippet is doing what you’ve intended. The third argument to wp_schedule_event is a hook name, which in your case is wp_automatic_updater. This means that as soon as this event is fired, it will run: do_action( ‘wp_automatic_updater’ ); From a quick look at the WordPress codebase, I don’t see anything scheduled … Read more

Implement a webhook endpoint into a plugin

you can create a new API route like that : add_action(“rest_api_init”, function () { register_rest_route( “test_api” , “reading_http_json” , [ “methods” => WP_REST_Server::EDITABLE, // POST PUT PATCH “callback” => function (WP_REST_Request $request) { $body = file_get_contents(“php://input”); $json = json_decode($body, TRUE); // here you have data in the array $json return NULL; }, “permission_callback” => fn … Read more

Custom Gutenberg blocks not showing in WP editor

The import syntax only works if you are using a build system (the npm/npx stuff). If you don’t want to use that right now, you can replace the import with wp.<module> like: const { registerBlockType } = wp.blocks; registerBlockType(‘custom-blocks/simple-block’, { edit: () => ‘abc’, save: () => ‘abc’ }); Or directly like: wp.blocks.registerBlockType(‘custom-blocks/simple-block’, { edit: … Read more

How to change WP Query to display related posts

I wrote the code and it works but when I add another Query Loop block (latest posts) to that page it shows the related posts. That happens because although your filter callback is registered only when blockName is related-posts, the query_loop_block_query_vars hook still applies globally to all Query Loop blocks rendered after that. How do … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)