wp db request without refreshing the page

Instead of querying the database directly, you could use WP_User_Query, but you’ll get the best results by querying the REST API endpoint with a GET request at /wp-json/wp/v2/users which already lists out the users in a WordPress install. Just remember to account for pagination.

Including Google Map within a wordpress plugin

Problem 1 neither I see the function initMap in the footer. This is because of the action here: add_action(‘wp-footer’, [$this, ‘init_google_map’]); There is no wp-footer hook. You probably intended to use wp_footer: https://developer.wordpress.org/reference/hooks/wp_footer/ Though keep in mind this isn’t guaranteed to be in a footer, just at the end of the HTML document before the … Read more

Best approach to change mobile background image and adding its class

As I am extending core/group block to add option for setting different image for smaller displays I used render_block_core/group filter to add style tag. I am already adding data-mobile-background-image to each group for its mobile view background image so there is no need for updating it through ID as suggested by Tom J Nowell. Final … Read more

Executing ACF field as a shortcode

you are trying to output the value of an ACF field containing an embed code for a Google Map as a shortcode within your WP theme files . If the shortcode is not being executed, the get_field() function may be returning the raw value of the field rather than parsing it as a shortcode. Replace … Read more

Adding “Changelog” as a second tab to the auto updater custom plugin

I believe you have to add it into your plugin data array, see below: $packages[‘plugin-slug’] = [ ‘versions’ => [ ‘1.0.0’ => [ ‘name’ => ‘WP Awesome Plugin’, ‘version’ => ‘1.0.0’, ‘new_version’ => ‘1.0.0’, ‘date’ => ‘2023-02-10 14:17:00’, ‘tested’ => ‘6.1.1’, ‘package’ => ‘https://127.0.0.1/plugin-slug-1.0.0.zip’, // ‘author’ => ‘<a href=”https://127.0.0.1/”>Author</a>’, ‘author_profile’ => ‘https://127.0.0.1/’, ‘homepage’ => ‘https://127.0.0.1/wordpress-plugins/plugin-slug/’, … Read more

Redirect OLD/Path to NEWURL/Path

<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^olddomin\.com RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L] </IfModule> This is what you’re looking for, before the WP block in your .htaccess.

Is it a good idea to restrict the REST API

You can use the rest_dispatch_request filter to catch the /wp/v2/users routes before they deliver their data to the user. add_filter( ‘rest_dispatch_request’, ‘wpse425815_authenticate_user_route’, 10, 4 ); /** * Forces authentication on the wp/v2/user route(s). * * @param mixed $result The current result. * @param WP_Request $request The REST request. * @param string $route The requested route. … Read more

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