Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @andrecpe15 ,

    I recently encountered a similar issue! If you used the @wordpress/create-block package to generate your block files, registration should work without issues. Here’s a potential solution:

    1. Try updating WordPress to the latest version or clearing your cache!

    If you manually created the block files, I recommend comparing your structure with the default one generated by @wordpress/create-block. Ensure everything matches, and also double-check that you’re correctly registering the block using register_block_type() .

    <?php
    function my_custom_block_init() {
    // Register the block using the block.json file or directly specify attributes.
    register_block_type( DIR . '/build' );
    }
    add_action( 'init', 'my_custom_block_init' );

    @ipwsite the information you have shared is not enough for debugging the issue !

    These are some possible fixes i can think of

    1. Check MySQL Server Status: Ensure that the MySQL server is running in XAMPP. You can check this by:
      • Opening the XAMPP control panel.
      • Verifying that the MySQL service is running (it should be green).
    2. Use?127.0.0.1?Instead of?localhost: Sometimes, XAMPP on macOS may have issues resolving?localhost. Try changing?DB_HOST?to?127.0.0.1?in your?wp-config.php?file:define('DB_HOST', '127.0.0.1');
    3. Check the User Privileges: Ensure that the?admin?user has privileges for the?wordpressdb?database. In phpMyAdmin:
      • Go to the?Users?tab.
      • Check if the?admin?user has been assigned appropriate privileges for the?wordpressdb?database.
    4. Check for MySQL Port Conflict: Verify that MySQL is running on the default port (3306). If it’s running on a different port, you’ll need to specify it in?wp-config.php:define('DB_HOST', '127.0.0.1:3306'); // Replace with the correct port if it's different




    Hello @salvatorenoschese ,

    I think you are using this way !
    _e( 'Administration Email Address' );
    _e( 'Anyone can register' );

    So when you use the same string in your plugin without a text domain, Poedit will treat it as belonging to your plugin and might add it to your translation file.

    To avoid this and to ensure that the string is recognized as part of WordPress core translations, you should specify the 'default' text domain when using core strings in your plugin like this

    _e( 'Anyone can register', 'default' );

Viewing 3 replies - 1 through 3 (of 3 total)