Giter Site home page Giter Site logo

Comments (4)

tombroucke avatar tombroucke commented on June 7, 2024

I'm having a similar issue with translations. In the plugins_loaded hook, get_locale() returns en_US, while the language is set to nl_NL in my config/intervention.php file. Database value is EMPTY. I need to update the database value in order to get the correct translation.

Am I missing the point? Is intervention only disabling the options, but not settings their values?

from intervention.

darrenjacoby avatar darrenjacoby commented on June 7, 2024

Hey @tombroucke,

I will check on the first issue regarding the timezone.

I'm using the WordPress switch_to_locale function for languages, with the init hook. https://github.com/soberwp/intervention/blob/main/src/Application/General.php#L125-L134

The plugins_loaded hook fires before and therefore Intervention has not yet applied the function.

Regarding database values, Intervention uses pre_option when available, and therefore does not update the DB. Here's the thread on the reasoning behind that. #64

You can import values under Tools > Intervention > Application which will run update_option and update the database values according to the Intervention config file. (please do a database backup prior!). This should solve your issue with the plugins_loaded hook firing first.

from intervention.

darrenjacoby avatar darrenjacoby commented on June 7, 2024

@tombroucke I seem unable to reproduce the timezone issue with a post changing from publish to schedule. Do you have any other plugins installed which may affect this?

from intervention.

tombroucke avatar tombroucke commented on June 7, 2024

Hi,

Please see the screen recording below. Fresh install, twentytwentyone & intervention as the only active plugin. When I deactivate intervention, I can correctly publish new posts.

<?php
return [
    'wp-admin' => [
        'editor|shop_manager' => [
            'common' => [
                'adminbar' => [
                    'comments' => false,
                    'search' => false,
                    'updates' => false,
                    'site' => [
                        'themes' => false
                    ]
                ],
                'updates' => false,
            ],
            'comments' => true,
            'dashboard' => 'pages',
            'tools' => true,
        ]
    ],
    'application' => [
        'theme' => 'twentytwentyone',
        'general' => [
            'membership' => false,
            'default-role' => 'subscriber',
            'timezone' => 'Europe/Brussels',
            'date-format' => 'j F Y',
            'time-format' => 'H:i',
            'week-starts' => 'Mon',
        ],
        'writing' => [
            'emoji' => 'false',
        ],
        'reading' => [
            'posts-per-page' => 10,
            'posts-per-rss' => 10,
            'rss-excerpt' => 'full',
        ],
        'media' => [
            'sizes' => [
                'thumbnail' => [
                    'width' => 300,
                    'height' => 200,
                    'crop' => true,
                ],
                'medium' => [
                    'width' => 800,
                    'height' => 800,
                    'crop' => false,
                ],
                'large' => [
                    'width' => 1920,
                    'height' => 1920,
                    'crop' => true,
                ],
            ],
            'uploads.organize' => true,
        ],
        'permalinks' => [
            'structure' => '/%postname%/',
            'category-base' => 'category',
            'tag-base' => 'tag',
            'search-base' => 'search',
        ],
    ],
];
Screen.Recording.2021-12-20.at.09.14.23.mov

from intervention.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.